Ticket #14460: 14460.patch
File 14460.patch, 1.3 KB (added by , 13 years ago) |
---|
-
wp-includes/capabilities.php
939 939 // Allow user to edit itself 940 940 if ( isset( $args[0] ) && $user_id == $args[0] ) 941 941 break; 942 // Don't allow user to edit a protected user, if the first is not protected too. 943 if ( isset( $args[0] ) && ( user_can( $args[0], 'self_protect' ) && ! user_can( $user_id, 'self_protect' ) ) ) { 944 $caps[] = 'do_not_allow'; 945 break; 946 } 942 947 // Fall through 943 948 case 'edit_users': 944 949 // If multisite these caps are allowed only for super admins. … … 1142 1147 } 1143 1148 // Fall through if not DISALLOW_UNFILTERED_HTML 1144 1149 case 'delete_user': 1150 // Don't allow user to delete itself (just in case) 1151 if ( isset( $args[0] ) && $user_id == $args[0] ) { 1152 $caps[] = 'do_not_allow'; 1153 break; 1154 } 1155 // Don't allow user to delete a protected user, if the first is not protected too. 1156 if ( isset( $args[0] ) && ( user_can( $args[0], 'self_protect' ) && ! user_can( $user_id, 'self_protect' ) ) ) { 1157 $caps[] = 'do_not_allow'; 1158 break; 1159 } 1145 1160 case 'delete_users': 1146 1161 // If multisite these caps are allowed only for super admins. 1147 1162 if ( is_multisite() && !is_super_admin( $user_id ) ) {