WordPress.org

Ready to get started?Download WordPress

Forums

Member Approval
[resolved] plugin not working at inital registration (15 posts)

  1. gfoulks
    Member
    Posted 10 months ago #

    just installed your plugin and when a new user register they are taken to the protected area as if they are logged in and they are able to browse all of the content.

    when they log out and try log back in before being approved they are blocked as would be expected.

    why are new users given access when they first register and yet blocked if they try to login again before being approved.

    http://wordpress.org/plugins/member-approval/

  2. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Hi there,

    Sorry for the delay in response!

    Sounds like the plugin or system you're using for User signup is automatically signing them in. The plugin doesn't affect logged in Users currently. I'm going to release a new release that should fix this issue shortly. I'll update this thread when that's done. Thanks!

  3. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Just updated the plugin to version 131009. This should resolve your issue. Thanks!

  4. gfoulks
    Member
    Posted 10 months ago #

    Yes that works better. Any chance to have new users be redirected to a page that explains that their login request is being reviewed? Right the registration simply takes you back to the login page.

  5. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Hey there,

    Next release I'll put a section in the Admin Menu for this. It should be possible to both silently log the User out (without redirecting them), where they will be simply logged out whenever they load the next page, or set up a custom redirect URL here. Not aware of any way to display a notice on the login page itself.

    I'll try to have this available in the next couple days.

  6. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    I updated the plugin to use the already configured options to decide if and where to redirect if the User is logged-in when the plugin deactivates the User. If you're using an error message, this logout will be silent. If you've set up a redirection URL in the admin panel, then the plugin will redirect there.

  7. gfoulks
    Member
    Posted 10 months ago #

    Sorry it appears this version of the plugin does not work. Users are again able to gain access on initial registration even though their account shows they have not been approve. I have just one role that requires approval.

    When a new user logs out then tries to login again then they are blocked. Further the redirect on registration is not working.

    Example http://obetzjobs.com register as an employer.

  8. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Hi there,

    I'm unable to reproduce this on my test installation. The restriction is working fine for me in a clean installation of WordPress.

    The problem is likely to do with the way the registration form logs in the User after they register, and sends them to the redirection URL you have set up for that form. It may be necessary for my plugin to hook into the user_register hook earlier so that plugins such as yours can't log in immediately after registration if their hook to the user_register function is given higher precedence.

    Could you tell me what plugin you're using for this login/registration form?

  9. gfoulks
    Member
    Posted 10 months ago #

    Here is the real kicker... Like I said I have a number if user roles an ice checked just the one role that I want to have approvals for. If I also select subscriber then the approval process works but then all user roles selected or not are also required to be approved.

    It would seem like your plugin is not honoring the role selection for approvals.

  10. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    If I also select subscriber then the approval process works but then all user roles selected or not are also required to be approved

    Can you reproduce this within the WordPress Admin Panel's New User page? I just tried to reproduce this and I wasn't able to do so. This functionality simply checks to see if the User's role is one of those selected in the admin panel so I don't see how this is possible.

    It's possible that the registration form you're using registers Users at the Subscriber level to start with, and then changes their Role after registration. That would cause this to happen, and there's nothing I can do about that. If that's the case then creating Users via the WordPress Dashboard should work correctly.

  11. gfoulks
    Member
    Posted 10 months ago #

    No if I add the user via the wp admin and select the appropriate role it works fine. This only happens when a user is enrolled via the theme.

    So they must be enrolled as a subscriber first before being changed to the appropriate roll.

    How much would you charge to modify your plugin to work with our theme?

  12. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Hi there,

    If your theme is using the user_register hook to change the Role, it may be possible for this to be worked around. Try editing Member Approval's /includes/hooks.php file, at line 9, changing this line:

    add_action('user_register', array('member_approval_restriction', 'maybe_disable_user')); // For adding the Meta Key (if activated)

    To this:

    add_action('user_register', array('member_approval_restriction', 'maybe_disable_user'), 100, 1); // For adding the Meta Key (if activated)

    You should be able to do this within the WordPress Admin Menu. Click the Edit link on my plugin's section of the Plugin's list, and look for the file. Then run your test again.

    If that works, let me know and I'll add this to the next release. Changing this line puts the priority of the plugin's disabling functionality (on registration) lower, so that hooks such as the one in your theme that change the Role will be fired before this plugin decides whether or not to disable the User based on Role.

    Otherwise, changes will have to be made to your theme's code, and there's no way I can work around that within the scope of my plugin, sorry.

  13. gfoulks
    Member
    Posted 10 months ago #

    that did the trick! Now only those roles I have selected are waiting for approval while the others are registering right away.

    Thanks!

  14. Bruce Caldwell
    Member
    Plugin Author

    Posted 10 months ago #

    Great! Thanks for the info. I'll add this into the next release (should be out tonight).

    Thanks for working through this with me :-). I didn't forsee this as an issue, but if it happened on your site it could happen for others.

  15. Fmarta
    Member
    Posted 5 months ago #

    Hi great plugin. I have the same problem i select any role and always is approve, only selecting subscriber it works.
    How can i fix the problem, I tried the example above and dint work.

    Thanks

    Federico

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.