Info
- 7 posts
- 3 voices
- Started 3 years ago by cyclune
- Latest reply from cyclune
- This topic is resolved
lock profile editing from non administrators
-
- Posted 3 years ago #
Hi!
Is there a way to lock the user profiles for non administrators?
thank you for help!
cyclune
-
- Posted 3 years ago #
Only admin can change profiles in the first place, except for the profile owner.
Are you saying you don't want the member themselves to be able to change their own profile?
-
- Posted 3 years ago #
I have thought about this as well. I would like to prevent members from editing their own profile, or at least their email. What happens is people register with a real email address, get their password, then change the email so you don't know their real email address. I would like to prevent that, and I think cyclune was talking about something similar, prevent a member from editing their own profile.
-
- Posted 3 years ago #
untested, in theory:
function bb_tweaks_no_profile_edit($retvalue, $capability, $args) { if ($capability=="edit_user") {return bb_current_user_can( 'administrate');} return $retvalue; } add_filter('bb_current_user_can', 'bb_tweaks_no_profile_edit',10,3); -
- Posted 3 years ago #
Chrishajer is right. I have bbpress linked with WordPress. I don't want the users to change their own profile with wrong email adresses or new user names.
_ck_ - where do I have to insert this piece of code???
cyclune -
- Posted 3 years ago #
make it into a mini-plugin, ie.
<?php /* Plugin Name: No Profit Edit */ function bb_tweaks_no_profile_edit($retvalue, $capability, $args) { if ($capability=="edit_user") {return bb_current_user_can( 'administrate');} return $retvalue; } add_filter('bb_current_user_can', 'bb_tweaks_no_profile_edit',10,3); ?>Save it as
no-profile-edit.phpput into\my-pluginsand activate.Make sure you don't put any spaces at the beginning or end of the file.
-
- Posted 3 years ago #
Greeeeeeat!
Thank you, it works!Cyclune
-
You must log in to post.