Changeset 4504
- Timestamp:
- 11/20/2006 04:29:06 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-admin/users.php (modified) (4 diffs)
-
wp-includes/capabilities.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/users.php
r4480 r4504 136 136 wp_die(__('You can’t edit that user.')); 137 137 // The new role of the current user must also have edit_users caps 138 if($id == $current_user-> id&& !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) {138 if($id == $current_user->ID && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { 139 139 $update = 'err_admin_role'; 140 140 continue; … … 170 170 wp_die(__('You can’t delete that user.')); 171 171 172 if($id == $current_user-> id) {172 if($id == $current_user->ID) { 173 173 $update = 'err_admin_del'; 174 174 continue; … … 218 218 foreach ( (array) $userids as $id ) { 219 219 $user = new WP_User($id); 220 if ( $id == $current_user-> id) {220 if ( $id == $current_user->ID ) { 221 221 echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n"; 222 222 } else { … … 228 228 $user_dropdown = '<select name="reassign_user">'; 229 229 foreach ( (array) $all_logins as $login ) 230 if ( $login->ID == $current_user-> id|| !in_array($login->ID, $userids) )230 if ( $login->ID == $current_user->ID || !in_array($login->ID, $userids) ) 231 231 $user_dropdown .= "<option value=\"{$login->ID}\">{$login->user_login}</option>"; 232 232 $user_dropdown .= '</select>'; -
trunk/wp-includes/capabilities.php
r4495 r4504 131 131 class WP_User { 132 132 var $data; 133 var $id = 0; 133 var $ID = 0; 134 var $id = 0; // Deprecated, use $ID instead. 134 135 var $caps = array(); 135 136 var $cap_key; … … 194 195 function add_role($role) { 195 196 $this->caps[$role] = true; 196 update_usermeta($this-> id, $this->cap_key, $this->caps);197 update_usermeta($this->ID, $this->cap_key, $this->caps); 197 198 $this->get_role_caps(); 198 199 $this->update_user_level_from_caps(); … … 203 204 return; 204 205 unset($this->caps[$role]); 205 update_usermeta($this-> id, $this->cap_key, $this->caps);206 update_usermeta($this->ID, $this->cap_key, $this->caps); 206 207 $this->get_role_caps(); 207 208 } … … 216 217 $this->roles = false; 217 218 } 218 update_usermeta($this-> id, $this->cap_key, $this->caps);219 update_usermeta($this->ID, $this->cap_key, $this->caps); 219 220 $this->get_role_caps(); 220 221 $this->update_user_level_from_caps(); … … 262 263 263 264 $args = array_slice(func_get_args(), 1); 264 $args = array_merge(array($cap, $this-> id), $args);265 $args = array_merge(array($cap, $this->ID), $args); 265 266 $caps = call_user_func_array('map_meta_cap', $args); 266 267 // Must have ALL requested caps
Note: See TracChangeset
for help on using the changeset viewer.