Home › Forums › Plugin Support › Trying to assign new role to edit users
- This topic has 17 replies, 2 voices, and was last updated 11 years, 8 months ago by Support.
-
AuthorPosts
-
February 20, 2013 at 10:54 am #3071February 20, 2013 at 10:57 am #3072kstudiofxMember
If anyone can help I’d appreciate it, thanks!
- This reply was modified 11 years, 9 months ago by kstudiofx. Reason: wrong message
February 20, 2013 at 3:20 pm #3079SupportMemberHello,
By default UMP allow only admin to update other’s profile. If you need to allow other role then admin, you have to write some code.For version 1.1.3rc2 open user-meta/models/umMethods.php
Replace Line 31-34 with following codes:
$role = $userMeta->getUserRole( $user_ID );
$allowedRoles = array( 'administrator', 'put_your_new_role_here' );if( in_array( $role, $allowedRoles ) ){
if( isset($_REQUEST['user_id']) )
$userID = $_REQUEST['user_id'];
}
Present codes for line 31-34:
if( $isAdmin ){
if( isset($_REQUEST['user_id']) )
$userID = $_REQUEST['user_id'];
}
Thanks.
February 20, 2013 at 9:16 pm #3081kstudiofxMemberstill not working for me. I refreshed and everything. also the lines that had that code were from 66-69 if that helps any. here’s the code i placed:
$role = $userMeta->getUserRole( $user_ID );
$allowedRoles = array( 'administrator', 'greg', 'ramon', 'elbin', 'bertha', 'andres', 'joaquin' );if( in_array( $role, $allowedRoles ) ){
if( isset($_REQUEST['user_id']) )
$userID = $_REQUEST['user_id'];
}February 21, 2013 at 11:08 pm #3101SupportMemberHello, what happend when those role user visit url like: http://example.com/profile/?user_id=xxx
And just for reminder: value of array: ‘greg’, ‘ramon’, ‘elbin’, ‘bertha’, ‘andres’, ‘joaquin’ suppose to be role name not username.
Thanks.
February 21, 2013 at 11:12 pm #3102kstudiofxMemberThey still just see their own information populated in the fields. usernames and all.
I have a plugin that let’s me make new roles and those are the role names not usernames.
February 22, 2013 at 1:04 am #3111SupportMemberThose code suppose to work. Please check again you have replaced user-meta/models/umMethods.php Line:31-34 for version 1.1.3rc2
If you did right but still not working please contact with our “Contact Us” section with your site url and account to check the issue in your site.
Thanks.
February 22, 2013 at 1:06 am #3112kstudiofxMemberThe code you told me to replace wasn’t on 31-34 it was on 66-69
February 22, 2013 at 1:08 am #3113kstudiofxMemberMy plugin says 1.1.3rc1
February 22, 2013 at 1:14 am #3115kstudiofxMemberupgrading now and going to use the same code… fingers crossed
February 22, 2013 at 1:17 am #3116SupportMemberHave a look on http://user-meta.com/upgrade-notice/ while update to new version.
February 22, 2013 at 1:27 am #3119kstudiofxMemberok now weird things are happening. i upgraded but now my former login page (still with the same shortcode that worked before) it shows the profile fields, not the login form.
and if i go to the profile page to see what that shows, it is now showing the login form.
when i try to login, it leads me to the proper redirect page I assigned before, but that page just says form not found.
February 22, 2013 at 1:33 am #3121kstudiofxMemberI read the upgrade notice but it’s still the same stuff showing… profile instead of login form
February 22, 2013 at 1:37 am #3122kstudiofxMemberwould you like me to send you an admin to see? i didn’t even change the code yet, just installed the new version
February 22, 2013 at 1:40 am #3123kstudiofxMemberoh yay ok i got it… had to fiddle with the code, my issue was caps and lowercase on my shortcodes. weird that it worked before though. *sigh* thanks for the code!
-
AuthorPosts
- You must be logged in to reply to this topic.