Changeset 2995
- Timestamp:
- 11/06/2005 03:58:52 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r2979 r2995 257 257 258 258 function edit_user($user_id = 0) { 259 global $current_user, $wp_roles; 259 260 260 261 if ($user_id != 0) { … … 277 278 $pass2 = $_POST['pass2']; 278 279 280 if (isset ($_POST['role'])) { 281 if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users')) 282 $user->role = $_POST['role']; 283 } 284 285 if (isset ($_POST['role'])) { 286 $user->role = $_POST['role']; 287 } 279 288 if (isset ($_POST['email'])) 280 289 $user->user_email = wp_specialchars(trim($_POST['email'])); -
trunk/wp-admin/profile.php
r2994 r2995 31 31 <input type="text" name="user_login" value="<?php echo $profiledata->user_login; ?>" disabled="disabled" /> 32 32 </label></p> 33 34 <p><label><?php _e('Role: (no editing)') ?><br /> 35 <input type="text" name="role" value="<?php echo $wp_roles->role_names[$profileuser->roles[0]] ?>" disabled="disabled" /></label></p> 36 33 37 <p><label><?php _e('First name:') ?><br /> 34 38 <input type="text" name="first_name" value="<?php echo $profiledata->first_name ?>" /></label></p> -
trunk/wp-admin/user-edit.php
r2889 r2995 83 83 <input type="text" name="user_login" value="<?php echo $profiledata->user_login; ?>" disabled="disabled" /> 84 84 </label></p> 85 86 <p><label><?php _e('Role:') ?><br /> 87 <?php 88 // print_r($profileuser); 89 echo '<select name="role">'; 90 foreach($wp_roles->role_names as $role => $name) { 91 $selected = ($profileuser->roles[0] == $role) ? ' selected="selected"' : ''; 92 echo "<option value=\"{$role}\"{$selected}>{$name}</option>"; 93 } 94 echo '</select>'; 95 ?></label></p> 96 85 97 <p><label><?php _e('First name:') ?><br /> 86 98 <input type="text" name="first_name" value="<?php echo $profiledata->first_name ?>" /></label></p> -
trunk/wp-includes/registration-functions.php
r2994 r2995 60 60 update_usermeta( $user_id, 'aim', $aim ); 61 61 update_usermeta( $user_id, 'yim', $yim ); 62 62 63 if ($update && !empty($role)) { 64 $user = new WP_User($user_id); 65 $user->set_role($role); 66 } 67 63 68 if ( !$update ) { 64 69 $user = new WP_User($user_id);
Note: See TracChangeset
for help on using the changeset viewer.