Copied to clipboard

Flag this post as spam?

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


  • Chris Bodman 13 posts 93 karma points
    Mar 13, 2018 @ 13:02
    Chris Bodman
    0

    Disable Member Account via SQL

    Hi Everyone,

    We have some pretty heavy integration, and something I'd like to do is to be able to disable a member via SQL.

    We can maintain they're record via sql, but I cant see anything immediately obvious in regards to disabling their account.

    I'd like to avoid deleting the account if possible.

    B

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 13, 2018 @ 13:22
    Michaël Vanbrabandt
    100

    Hi Chris,

    Something like this:

    USE [YourDatabase]
    
    GO
    
    ;WITH DataProp as (SELECT pd.*
      FROM cmsPropertyData as pd
      JOIN cmsPropertyType as pt ON pt.Id = pd.propertytypeid AND pt.Alias = 'umbracoMemberApproved'
      WHERE contentNodeId = ( SELECT Id
      FROM umbracoNode
      WHERE text LIKE '%your member name%' ))
      UPDATE DataProp SET dataInt = 0
    

    The part dataInt = 0 sets the property Is Approved to false, if you want to approve the member, set this to 1.

    I now do a search on text for getting the right Member, you should be able to change this and pass the id of the member if you have this at your end:

    WHERE Id = YourId
    

    Hope this helps!

    /Michaël

  • Chris Bodman 13 posts 93 karma points
    Mar 13, 2018 @ 13:29
    Chris Bodman
    0

    You absoultey beautiful person.

    Thank you!

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 13, 2018 @ 13:29
    Michaël Vanbrabandt
    0

    No problem, glad it solved your problem!

    Have a nice day.

    /Michaël

Please Sign in or register to post replies

Write your reply to:

Draft