Changeset 3859
- Timestamp:
- 06/10/2006 08:26:26 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r3857 r3859 104 104 // print_r($profileuser); 105 105 echo '<select name="role">'; 106 $role_list = ''; 107 $user_has_role = false; 106 108 foreach($wp_roles->role_names as $role => $name) { 107 $selected = ($profileuser->has_cap($role)) ? ' selected="selected"' : ''; 108 echo "<option value=\"{$role}\"{$selected}>{$name}</option>"; 109 } 110 echo '</select>'; 109 if ( $profileuser->has_cap($role) ) { 110 $selected = ' selected="selected"'; 111 $user_has_role = true; 112 } else { 113 $selected = ''; 114 } 115 $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>"; 116 } 117 if ( $user_has_role ) 118 $role_list .= '<option value="">' . __('— No role for this blog —') . '</option>'; 119 else 120 $role_list .= '<option value="" selected="selected">' . __('— No role for this blog —') . '</option>'; 121 echo $role_list . '</select>'; 111 122 ?></label></p> 112 123 -
trunk/wp-admin/users.php
r3857 r3859 314 314 315 315 <tr> 316 <?php if ( !empty($role) ) : ?> 316 317 <th colspan="7" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th> 318 <?php else : ?> 319 <th colspan="7" align="left"><h3><em><?php _e('No role for this blog'); ?></h3></th> 320 <?php endif; ?> 317 321 </tr> 318 322 <tr class="thead"> -
trunk/wp-includes/capabilities.php
r3846 r3859 175 175 //Build $allcaps from role caps, overlay user's $caps 176 176 $this->allcaps = array(); 177 foreach( $this->roles as $role) {177 foreach( (array) $this->roles as $role) { 178 178 $role = $wp_roles->get_role($role); 179 179 $this->allcaps = array_merge($this->allcaps, $role->capabilities); … … 200 200 foreach($this->roles as $oldrole) 201 201 unset($this->caps[$oldrole]); 202 $this->caps[$role] = true; 203 $this->roles = array($role => true); 202 if ( !empty($role) ) { 203 $this->caps[$role] = true; 204 $this->roles = array($role => true); 205 } else { 206 $this->roles = false; 207 } 204 208 update_usermeta($this->id, $this->cap_key, $this->caps); 205 209 $this->get_role_caps(); -
trunk/wp-includes/registration-functions.php
r3800 r3859 103 103 update_usermeta( $user_id, 'yim', $yim ); 104 104 105 if ( $update && !empty($role)) {105 if ( $update ) { 106 106 $user = new WP_User($user_id); 107 107 $user->set_role($role);
Note: See TracChangeset
for help on using the changeset viewer.