Skip to:
Content
Pages
Categories
Search
Top
Bottom

not activated users – how to create new activation key


  • lustek
    Participant

    @lustek

    Hi guys,
    I have a small problem with not acitvaed accounts.

    I have less users listed here:
    /wp-admin/users.php?page=bp-signups
    than in the wp_users table with status 2. I checked wp_usermeta and those missing users have activation_key defined for each of them.

    So they are in the database, they have activation key defined, but they are not in the back office panel.

    I suspect the reason is that those records are very old. Is there a mechanism to hide old sign-ups without activation?
    thanks in advance

    EDIT:
    I’ve just realised, that those users were moved from our previous cms and they have activation key from that system.

    I made a test and it occurs that during activation it’s not the value of activation_key from wp_usermeta taken to compare. For a new user registered I changed this value in the database, but it could still be activated using the activation link from the email.

    So my question changes:
    what is the algorithm to create a proper activation key?

Viewing 6 replies - 1 through 6 (of 6 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi @lustek

    Regarding your new question, BuddyPress uses wp_hash() to hash the user’s ID with the result used as the activation key. So for example:

    $activation_key = wp_hash( $user_id )


    lustek
    Participant

    @lustek

    @henrywright, thanks for your answer.

    So what is the reason to keep activation_key in wp_usermeta? in which part of the site it is used?


    Henry Wright
    Moderator

    @henrywright

    It’s only kept there until the user clicks on the link in the activation email. At that point, the user gets taken to your website, and the activation key is deleted.


    djsteveb
    Participant

    @djsteveb

    @lustek
    I have no idea if this will help you, but something similar / related I played with a while back: https://wordpress.org/plugins/unconfirmed/


    lustek
    Participant

    @lustek

    thank you all for your help. it’s getting more clear. now I have a final question. I’ve installed the plugin unconfirmed – it is almost the same as built-in bp functionality: /wp-admin/users.php?page=bp-signups. The only difference is that is shows activation keys also.

    My last question is about the number of unactivated records. Unconfirmed plugin shows exactly the same number I have in the database with status=2.

    But /wp-admin/users.php?page=bp-signups shows more users as unactivated – also those whom I changed status to 0 directly in the database. I tried to delete actiavion_key for them in wp_usermeta, but they still appear as unactivated.

    It’s not really a huge problem, as they can log in. But I want to have order in our database – so what else should I change so that they don’t show in activation section?


    Henry Wright
    Moderator

    @henrywright

    I tried to delete actiavion_key for them in wp_usermeta, but they still appear as unactivated.

    Deleting the activation key alone through the database won’t activate a user. There are more tasks that need to be done in order for a user to become activated. See the bp_core_activate_signup() function in bp-members-functions.php for details on how BuddyPress does it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘not activated users – how to create new activation key’ is closed to new replies.
Skip to toolbar