user is approved anyways
-
hi,
i installed the plugin but i have an issue:when a new user signs up, me (the admin) and the user receive an email. i can approve or deny the user, but the user can activate his account via activation email anyway!!
this makes no sense at all,
how can i fix it?thank you!
-
Hi @capnjazz
The plugin isn’t presently designed to prevent that much.
When moderation is set as required, we mark their user, via user meta, that they are still moderated. They’re able to browse around the site as a whole, including BuddyPress/bbPress areas, but they shouldn’t be able to start interacting. If you also have “Private network” set, then in terms of the BuddyPress/bbPress areas, they’re restricted to just their profile. They can’t go read activity streams or other profiles etc. However, if you also have a blog section for the site, or an ecommerce shop, they CAN go there. It’s very focused on just the areas from those two plugins, and not a limit for the site as a whole.
Hope that clears up some confusion, but feel free to ask more questions as you need. I’m willing to continue discussion.
hi michael,
i integrated it with BP DAR, so now i receive the email for the approval, the new registered user not receives the email, but can still move in the registered areas of the site.i got this idea: to hide links and pages for the users if they’re not approved yet.
i can fix this via jquery script, like:– hide the approved user areas in the website.
– if the user is approved via code, then give css display block to the areas above.how can i do this? do the plugin give .class to something when the user is approved? would be great for an IF script.
let me know,
thank you.Not sure how best to implement your ideas. I know that I haven’t been hiding things visually only, via css and
display:noneetc.The methods I use to hid things have been on the PHP side and using WordPress hooks in BuddyPress’ code. For example, a function that is filterable, and displays a button to start a conversation. I’d add a callback to that filter, check if the user is still moderated based on their user meta, and if they are, then return an empty string to the filter. This way, if the person is feeling “savy” enough to check for css hiding the UI, it’s simply not there and they’re unable to get through at all.
If you want, you can use this function to help with your own hiding methods:
/** * Check our moderation status and return boolean values based on that. * * @since 4.2.0 * * @param int $user_id User ID to check. * @return boolean Whether or not they're in moderation status. */ function bp_registration_get_moderation_status( $user_id ) { $moderated = get_user_meta( $user_id, '_bprwg_is_moderated', true ); if ( 'true' == $moderated ) { return true; } return false; }Just pass in the user ID you want to check, and it’ll tell you if they’re still moderated.
if ( bp_registration_get_moderation_status( get_current_user_id() ) ) { // Do something here in response to them being pending still. }if ( ! bp_registration_get_moderation_status( get_current_user_id() ) ) { // User is NOT moderated, let's give them something special. }where should i put this?
sorry, i know nothing about php.
Depends on what you’re doing and where you’re making the customizations. I don’t have anything for CSS like you mentioned, so I can’t provide any ready-made solutions to help in that area. At best, I could provide a quick snippet to add a class to the body tag that you could use.
function capnjazz_bpro_body_classes( $classes ) { $classes[] = ( bp_registration_get_moderation_status( get_current_user_id() ) ) ? 'bpro-moderated' : 'bpro-not-moderated'; return $classes; } add_action( 'body_class', 'capnjazz_bpro_body_classes' );This would go in your theme’s functions.php file, and if the user is moderated, your body tag should have a “bpro-moderated” class if they are moderated, and “bpro-not-moderated” if not.
Wow Michael, you actually saved my day.
thank you!!!
Welcome.
Sorry Michael,
i found another issue.Even with this setup, that it works for me, the user is still shown in members list. they should not, since they’re not approved yet.
would you explain this to me too?
thank you for your patience!Can you provide a URL example for where you’re seeing them? Or if it’s from like a widget or similar?
We do what we can to cover all cases, but I can’t claim 100% coverage of everything.
The topic ‘user is approved anyways’ is closed to new replies.