WordPress.org

Support

Support » Plugins and Hacks » [Resolved] plugin not working at inital registration

[Resolved] plugin not working at inital registration

  • 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/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Bruce Caldwell

    @bruce-caldwell

    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!

    Plugin Author Bruce Caldwell

    @bruce-caldwell

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

    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.

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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.

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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.

    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.

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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?

    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.

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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.

    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?

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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.

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

    Thanks!

    Plugin Author Bruce Caldwell

    @bruce-caldwell

    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.

    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

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Resolved] plugin not working at inital registration’ is closed to new replies.