Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Toggle Verified Flag by code

Hi,

New here. I would like to know how to set the member verified flag by code. I'm doing some subscription on site and thinking of using this instead of creating a new role.

How do you check and toggle verified membership?

thanks.

Comments

  • RiverRiver MVP
    edited September 2016

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • xifekoboxifekobo New
    edited September 2016

    Thank you, yes verified. can I use this outside a custom php file? what do I need to include to make it work?

  • RiverRiver MVP
    edited September 2016

    if you want to do something outside vanilla. you probably need to update the sql database for the proper user ID.

    verify is the column in the user table. verified is 1

    http://www.w3schools.com/sql/sql_update.asp

    if you are within vanilla possibly something like this.

    $Verified = 1;  //  set Verified flag on
    Gdn::userModel()->setField($UserID, 'Verified', $Verified);
    

    or the json method.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • I prefer to use within vanilla but using a separate file to not mess it up and probably load some headers, kind of like an addon but you don't register it. or maybe just add this on my custom theme php files but I don't know where to place it exactly. thanks

  • @xifekobo said:
    I prefer to use within vanilla but using a separate file to not mess it up and probably load some headers, kind of like an addon but you don't register it. or maybe just add this on my custom theme php files but I don't know where to place it exactly. thanks

    If you stated your exact goal and what you want to appear with a sample screenshot (with intended look) and what you want to do, I'm pretty sure @r_j could guide you through a plugin, he likes that :)

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • Ok I still have to prepare this as it looks like it's more complicated than it sounds. I appreciate the help River, thanks!

Sign In or Register to comment.