Insufficient permissions error when admins bulk add new users

On a multi-site install, after I enabled bp multiblog, bulk adding of new users is not working for site admins.

When they submit, they get a You do not have sufficient permissions to access this page error.

After this error, when they try to browse to any other section of the dashboard, they are also receiving error messages and have to logout and log back in.

  • Erica

    After further testing, something else I've noticed that's happening:

    - The very first user gets created
    - When the 2nd user starts to be created, that's when the error happens
    - The first user is now LOGGED IN - no wonder we're getting permission errors.. that user doesn't have the ability to create new users

    Somehow, after the first user account is created, it's logging out the admin and logging in the newly created user.

  • Erica

    Hmm, it's doing it even when I add one user at a time by going to users --> add new. It logs me out and logs me in as the new user I just created.

    This had been all working fine previously. The only change I've made recently is enabling bp multiblog.

    I tried uninstalling and reinstalling the add new users plugin. No change.

    I tried installing a different bulk add users plugin and it seems to work fine.

    Ideas?

  • Erica

    I deactivated Remove Email Verification plugin and the error where the site was logging admins out and logging them in as the most recently created user has stopped.

    Now I'm having issues because site admins can't manually activate users. I can go through them one at a time on the manage signups page, but bulk tools return the insufficient permissions error. Site admins, who click on 'pending' in their user dashboard get the insufficient permissions error.

    Managing users is becoming really frustrating. Any suggestions?

  • Michael Bissett

    Hey @Erica,

    I deactivated Remove Email Verification plugin and the error where the site was logging admins out and logging them in as the most recently created user has stopped.

    I haven't been able to reproduce this issue yet, with the following setup:

    - the BP_ENABLE_MULTIBLOG define set
    - BuddyPress, Remove Email Verification & Add New Users network activated

    I'm curious as to why disabling Remove Email Verification would cause this to start working, would you rather leave this be for now?

    Now I'm having issues because site admins can't manually activate users. I can go through them one at a time on the manage signups page, but bulk tools return the insufficient permissions error. Site admins, who click on 'pending' in their user dashboard get the insufficient permissions error.

    By default, with BuddyPress network activated, site admins wouldn't actually see the "Pending" item, it seems like the BP_ENABLE_MULTIBLOG define keeps bringing on the quirks. :disappointed:

    The attached patch should take care of that, it's a further updated copy of:

    /buddypress/bp-members/bp-members-admin.php

    Not only will it remove the "Pending" menu item for site admins (as they're not going to be able to activate users when BuddyPress is network activated anyhow), but it'll also allow super admins to bulk activate users. :slight_smile:

    Let me know if this helps please!

    Kind Regards,
    Michael

  • Erica

    Thanks Michael - apologies for my delayed response.

    Removing email verification - not 100% sure exactly why that improved things; however, the plugin is designed, upon a new registration to immediately login the newly created user. What was happening was that, even though I was a super-admin (or admin) creating the user, rather than the user creating themselves, it was logging in that new user. When bulk-creating users, this manifested as the bulk-creation not working - but what was actually happening was that the first user was created, but then immediately logged in. That user doesn't have permissions to create more users, so every other user in the bulk creation process would fail. This made it look like a problem with bulk creation but really it was working fine and it was indeed the remove email verification plugin that has issues. When admins are creating users, it shouldn't log in those users.

    Removing email verification is important to me. Most of my users are using educational email addresses. For whatever reason, WordPress notifications don't make their way to these emails. Ideally, the better solution would be ensuring these emails get delivered - but not sure that's within our control. That being said, most of my user accounts are admin-created, so it's not terribly urgent.

    I've uploaded the file you included and have not noticed an improvement - if anything, it was a bit of a step backwards.

    When I go to Network Admin, to manage signups, I cannot activate or delete any signups. (I used to be able to activate - delete hasn't been working even prior to this.)

  • Michael Bissett

    Hey @Erica,

    Hmm... oddly enough, with the help of a colleague of mine, I'm now able to reproduce this behavior over on her test Multisite (as my Multisite seems to have a hiccup presently), with the Remove Email Verification & Add New Users plugins.

    I'll report this to the respective developers, so that this can be sorted out. In the meantime though, to touch on this:

    For whatever reason, WordPress notifications don't make their way to these emails. Ideally, the better solution would be ensuring these emails get delivered - but not sure that's within our control.

    If you haven't already tried using a SMTP plugin, I'd advise giving one of these a go:

    https://wordpress.org/plugins/postman-smtp/
    https://wordpress.org/plugins/easy-wp-smtp/
    https://wordpress.org/plugins/wp-mail-bank/

    And as for this:

    I've uploaded the file you included and have not noticed an improvement - if anything, it was a bit of a step backwards.

    When I go to Network Admin, to manage signups, I cannot activate or delete any signups. (I used to be able to activate - delete hasn't been working even prior to this.)

    BuddyPress did release an update recently, which would have overwritten any changes I made before. You should be able to do this with the new attachments I've added here, please replace the following files in your Multisite:

    /buddypress/bp-members/admin/bp-members-admin-classes.php
    /buddypress/bp-members/bp-members-admin.php

    With the copies inside of the attached .zip files. :slight_smile:

    Kind Regards,
    Michael

  • Erica

    Thanks Michael - Lots of great suggestions I will look into for sure!

    I am still having no luck with either activating or deleting signups. I've enabled support access if you want to see what I mean for yourself. I am getting the "you do not have sufficient permission to access this page" error anytime I click on activate or delete. (In my current queue I want to activate the first two and delete the last two.)

    I am seeing the following error in my logs - not sure if it is connected to this or not:
    \nNotice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /wp-includes/functions.php on line 3622

  • Michael Bissett

    Hey @Erica! :slight_smile:

    I am getting the "you do not have sufficient permission to access this page" error anytime I click on activate or delete. (In my current queue I want to activate the first two and delete the last two.)

    I was able to activate the first user from the Network Dashboard, and I was able to delete the first user that you wanted to delete from there as well, is this where you were trying to do these things too?

    As I mentioned earlier, with the configuration you've got, the only place that users could be activated, re-emailed, or deleted from, would be the Network Dashboard.

    I left the 2nd user you wanted to activate, as well as the 2nd user that you wanted to delete, so you can test this on your end (just to verify that there's not something real quirky going on here).

    Please advise,
    Michael

  • Michael Bissett

    Hey @Erica,

    Given the length of this thread, and the issues covered therein, could you please clarify what's broken here?

    Is it the activation of users? Are you trying to activate them from the network Dashboard still? And if so, what's the link you're being taken to when trying to activate them?

    The more detail I have about what's going on right now, the better I'll be able to assist. :slight_smile:

    Please advise,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.