Changeset 3846
- Timestamp:
- 06/05/2006 04:52:21 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r3822 r3846 739 739 $r .= "\n\t\t<td align='center'>$numposts</td>"; 740 740 $r .= "\n\t\t<td>"; 741 if ( current_user_can('edit_users'))741 if ( current_user_can('edit_user', $user_object->ID) ) 742 742 $r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>"; 743 743 $r .= "</td>\n\t</tr>"; -
trunk/wp-admin/upgrade-functions.php
r3772 r3846 174 174 upgrade_160(); 175 175 176 if ( $wp_current_db_version < 3 767)176 if ( $wp_current_db_version < 3845 ) 177 177 upgrade_210(); 178 178 … … 493 493 } 494 494 495 if ( $wp_current_db_version < 3 767) {495 if ( $wp_current_db_version < 3845 ) { 496 496 populate_roles_210(); 497 497 } -
trunk/wp-admin/upgrade-schema.php
r3810 r3846 365 365 } 366 366 367 $role = get_role('administrator'); 368 if ( ! empty($role) ) { 369 $role->add_cap('delete_users'); 370 $role->add_cap('create_users'); 371 } 372 367 373 $role = get_role('author'); 368 374 if ( ! empty($role) ) { -
trunk/wp-admin/user-edit.php
r3839 r3846 35 35 check_admin_referer('update-user_' . $user_id); 36 36 37 if ( !current_user_can('edit_users'))37 if ( !current_user_can('edit_user', $user_id) ) 38 38 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 39 39 else … … 50 50 $profileuser = new WP_User($user_id); 51 51 52 if ( !current_user_can('edit_users'))52 if ( !current_user_can('edit_user', $user_id) ) 53 53 if ( !is_wp_error( $errors ) ) 54 54 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); -
trunk/wp-admin/users.php
r3788 r3846 24 24 $update = 'promote'; 25 25 foreach($userids as $id) { 26 if ( ! current_user_can('edit_user', $id) ) 27 die(__('You can’t edit that user.')); 26 28 // The new role of the current user must also have edit_users caps 27 29 if($id == $current_user->id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { … … 46 48 } 47 49 48 if ( !current_user_can(' edit_users') )50 if ( !current_user_can('delete_users') ) 49 51 die(__('You can’t delete users.')); 50 52 … … 53 55 $update = 'del'; 54 56 foreach ($userids as $id) { 57 if ( ! current_user_can('delete_user', $id) ) 58 die(__('You can’t delete that user.')); 59 55 60 if($id == $current_user->id) { 56 61 $update = 'err_admin_del'; … … 79 84 } 80 85 81 if ( !current_user_can(' edit_users') )86 if ( !current_user_can('delete_users') ) 82 87 $error = new WP_Error('edit_users', __('You can’t delete users.')); 83 88 … … 135 140 check_admin_referer('add-user'); 136 141 142 if ( ! current_user_can('create_users') ) 143 die(__('You can’t create users.')); 144 137 145 $user_id = add_user(); 138 146 if ( is_wp_error( $user_id ) ) -
trunk/wp-includes/capabilities.php
r3772 r3846 273 273 274 274 switch ($cap) { 275 case 'delete_user': 276 $caps[] = 'delete_users'; 277 break; 278 case 'edit_user': 279 $caps[] = 'edit_users'; 280 break; 275 281 case 'delete_post': 276 282 $author_data = get_userdata($user_id); -
trunk/wp-includes/version.php
r3810 r3846 3 3 // This just holds the version number, in a separate file so we can bump it without cluttering the SVN 4 4 5 $wp_version = '2.1-alpha 1';6 $wp_db_version = 38 09;5 $wp_version = '2.1-alpha2'; 6 $wp_db_version = 3845; 7 7 8 8 ?>
Note: See TracChangeset
for help on using the changeset viewer.