• Hey,

    I’m working with WP-Members plugin for create a website with restricted content for logged users only. I use different form (register, login, reset password and forgot username). On each new registration, the user must be activated and confirmed for receive a password by email.

    For security reasons, I tested every comportment and situations can be appear on my forms. I spotted an error on the reset password form. When a user unconfirmed or unvalidated type his username, php warnings appears :

    Undefined array key "acct_not_approved"
    Undefined array key "acct_not_validated"

    I searching how to resolve this situation by hidden theses warnings and displaying a custom error message for significated to the user that is accounti isn’t approved / confirmed but I don’t find the solution.

    However, when user type an unknow username, everything works and wp-members diplaying an error message for inform user that the username doesn’t exist.
    When the username exist, the user receive an email normally and he can change his password.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    You mentioned that you are using BOTH moderated registration and user confirmation. Can you explain the exact combination that causes the issue – is this when the user is BOTH not activated and not confirmed, but enters a valid username?

    Thread Starter valwp

    (@valwp)

    In both situations.
    WP-Members return two PHP warnings when the user is unconfirmed by an admin and when he doesn’t click on his validation link sending by mail :

    Warning: Undefined array key "acct_not_approved" in /var/www/wp-content/plugins/wp-members/includes/class-wp-members-dialogs.php on line 221
    Warning: Undefined array key "acct_not_validated" in /var/www/wp-content/plugins/wp-members/includes/class-wp-members-dialogs.php on line 221

    These warnings are returned after the submission of reset password form with an ID that existing in users list.

    When the new user is validated but still not approved by an admin, the reset password form return only one warning :

    Warning: Undefined array key "acct_not_approved" in /var/www/wp-content/plugins/wp-members/includes/class-wp-members-dialogs.php on line 221

    When the user is approved and validated, the reset password form is working normally.

    Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks for the insight. I will see if I can reproduce this in dev and if so, I should be able to resolve it in the next release. I expect to have version 3.4.7 ready for production before the end of the month.

    If it’s patchable in the meantime, I’ll post it here.

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

The topic ‘PHP warning when unvalidate user try to reset password’ is closed to new replies.