Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fredrik Esseen 594 posts 830 karma points
    Jun 14, 2011 @ 12:47
    Fredrik Esseen
    0

    Delete members by membergroup

    Hi!

    I want to delete all members within a certain member group.

    Is there an easy way to achieve this?

  • Fredrik Esseen 594 posts 830 karma points
    Jun 20, 2011 @ 14:45
    Fredrik Esseen
    0

    PS: This i an old version - 4.0.2.1 and upgrading is not an option right now since there is too much custom coding involved. So I cannot use any of the great packages there is to achieve this, plus its a MySql installation to complicate it even more..

    One "hack" I can use is to build a simple usercontrol that loads an xml list with all member ids that i filtered by member group and just delete them from CmsMember.

    Is that ok or will it mess upp the system?

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Jun 20, 2011 @ 14:53
    Steen Tøttrup
    0

    If you have all the member ids, I would use the API to delete them to avoid any chance of messing the DB up - it might just be me being a chicken, but that's what I would do.

    I'm "stuck" on a later version, but I don't think the API has changed much in this area:

                umbraco.cms.businesslogic.member.Member mbr = new umbraco.cms.businesslogic.member.Member(id);
                mbr.delete();

    regards, Steen

  • Fredrik Esseen 594 posts 830 karma points
    Jun 20, 2011 @ 15:04
    Fredrik Esseen
    0

    The problem is that there is over 2500 members that should be deleted and I wonder if umbraco.cms.businesslogic.member is too slow to handle that?

    I know that working with that often chokes the connection to the db.

  • Fredrik Esseen 594 posts 830 karma points
    Jun 20, 2011 @ 16:00
    Fredrik Esseen
    0

    I created a usercontrol and used the API code and it worked!

    Except one strange thing: The member is still in the DB but not in the backend?

    Is the member inactivated or something or am I just crazy??

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Jun 20, 2011 @ 16:16
    Steen Tøttrup
    0

    :) Is that a question for me?

    Not really sure, I'm not totally sure as to how it is done, but maybe the transaction is not done clearing the data out of the tables?

     

  • Fredrik Esseen 594 posts 830 karma points
    Jun 21, 2011 @ 10:47
    Fredrik Esseen
    0

    I feel like going crazy when it doesnt make any sense :)

    Well, the mist important thing is that it looks ok in the backend..but still strange..

    Thx for the help!

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Jun 21, 2011 @ 11:00
    Steen Tøttrup
    0

    np, and the members are still in the database?

  • Fredrik Esseen 594 posts 830 karma points
    Jun 21, 2011 @ 11:16
    Fredrik Esseen
    0

    I think I found the problem...

    The row with the user in UmbracoNode is deleted but not the other connected rows.
    Very strange..and I know that the loop of deleteing finished.

    Is that the way the api around member.delete() should work?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies