Forum Replies Created
-
Hey, i have a costum role plugin running on my wordpress. Nevermind, its an extended usermanagement for userpro.
MainLeader –> Can edit view Leader1 and Leader2 …etc.–>Leader1—–>Can Edit view —>Group1, but not Group2
–>Leader2—–>Can Edit view —>Group2, but not Group1
I have a functional working plugin for userpro!!! Please add actionfilter/hooks to your user permission functions!
You know now what i mean?
in reply to: UserpermissionClose, it should be possible, that i can select one or more roles which can view and/or delete and/or edit another role. :
Role A |->can| VIEW: Role Y, Role T | Edit: Role Y, Role Z | DELETE: Role I
Role B |->can| VIEW: Role Y, Role K | Edit: Role Y, Role Z | DELETE: Role I
…(All roles listed)
Thats exactly what my plugin does. It creates a list in the adminmenu where you can select each role and which userpro permissions they have. If you now click on a profile, my function will be called and if the current loggedin user has the permission to edit/view/delete the profile. The problem is, i have to reimplement my function everytime you update your plugin.
in reply to: UserpermissionGreat Plugin removed from Codecanyon
in reply to: Where is the CodeCanyon Page??????Hey good News,
but now i can export Users, but i cant import them? I already send you my modificated version how to import Users with Userprofields. Its based on an CsV User Import tool. greetzin reply to: V1.0.89 will include Export Users to CSV Feature!You think you can add this to your Plugin? It would be the first Plugin with UserRole Leader support. (GroupLeaders who can manage their groups).
f.example -> you have different groups(roles) like munich and berlin. Each group has one or more leaders who can manage the profiles of the user (actually you cant register on my site but leaders can add members of their managed group) The leaders of Munich don’t have rights to view and edit users of Berlin. The leader of Germany can view and edit all of the groups selected.
But still a question, how can i overwrite your functions? Cause actually i always have to change the functions everytime you update your plugin.
I also coded an CSV User Import Plugin for Userpro based on an extern wp plugin. Just a few lines added to the plugin but it works perfectly.
greetzin reply to: User Management rolesThats just a small example how i will Manage this
At function userpro_get_edit_user() addPHP12$userbla = userpro_can_edit_user( $user->ID );if (($user->ID && current_user_can('manage_options')) || $user->ID == get_current_user_id() || $userbla)And thats how my userpro_can_edit_user( $user_id ) function looks like:
PHP12345678910111213141516171819202122232425262728293031323334/* Can edit user profile */function userpro_can_edit_user( $user_id ){if ( current_user_can('edit_users') || $user_id == get_current_user_id() ) {return true;} else {//Get role of current profile$primuser_id = $user_id;$userx = new WP_User( $primuser_id );$temproleprofile = "";if ( !empty( $userx->roles ) && is_array( $userx->roles ) ) {foreach ( $userx->roles as $role )$temproleprofile = $role;}//Get role of current user$primuser_id = get_current_user_id();$userx = new WP_User( $primuser_id );$temprolecur = "";if ( !empty( $userx->roles ) && is_array( $userx->roles ) ) {foreach ( $userx->roles as $role )$temprolecur = $role;}if ( $temprolecur == "ROLEOFGROUPLEADER" && $temproleprofile == "ROLEOFUSER") {return true;}//...-> Add more if statement for other Groupsreturn false;}}Thats all, but every update you do the functions will be overwritten and i have to copy that again into the functions. An adminmenu suggested above would be very easy to code and would replace the “ROLEOFGROUPLEADER” and “ROLEOFUSER” .
Short description: Add roleleaders which can manage one or more specific roles (Edit and Delete Userpro profiles)
with restriction to other roles.
Adminmenu: Select which role is the leader of one or more roles
Changed functions: userpro_can_edit_user( $user_id )
userpro_get_edit_user()in reply to: User Management rolesI found a solution changeing the userpro_can_edit_user( $user_id ) function in user-functions.php. Is it possible to overwrite this function and define it somewhere else (So i don’t have to change it -everytime you update your plugin)? but Plugin Feature request still exits 🙂
Thank youin reply to: User Management roles