Ticket #2793: 2793.7.diff
File 2793.7.diff, 23.1 KB (added by , 18 years ago) |
---|
-
wp-includes/functions.php
1295 1295 function add_query_arg() { 1296 1296 $ret = ''; 1297 1297 if ( is_array(func_get_arg(0)) ) { 1298 if ( @func_num_args() < 2 )1298 if ( @func_num_args() < 2 || '' == @func_get_arg(1) ) 1299 1299 $uri = $_SERVER['REQUEST_URI']; 1300 1300 else 1301 1301 $uri = @func_get_arg(1); 1302 1302 } else { 1303 if ( @func_num_args() < 3 )1303 if ( @func_num_args() < 3 || '' == @func_get_arg(2) ) 1304 1304 $uri = $_SERVER['REQUEST_URI']; 1305 1305 else 1306 1306 $uri = @func_get_arg(2); 1307 1307 } 1308 1308 1309 if ( preg_match('|^https?://|i', $uri, $matches) ) { 1310 $protocol = $matches[0]; 1311 $uri = substr($uri, strlen($protocol)); 1312 } else { 1313 $protocol = ''; 1314 } 1315 1309 1316 if ( strstr($uri, '?') ) { 1310 1317 $parts = explode('?', $uri, 2); 1311 1318 if ( 1 == count($parts) ) { … … 1315 1322 $base = $parts[0] . '?'; 1316 1323 $query = $parts[1]; 1317 1324 } 1318 } 1319 else if ( strstr($uri, '/') ) { 1325 } else if ( strstr($uri, '/') ) { 1320 1326 $base = $uri . '?'; 1321 1327 $query = ''; 1322 1328 } else { … … 1339 1345 $ret .= "$k=$v"; 1340 1346 } 1341 1347 } 1342 $ret = $base . $ret; 1348 $ret = $protocol . $base . $ret; 1349 if ( get_magic_quotes_gpc() ) 1350 $ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str 1343 1351 return trim($ret, '?'); 1344 1352 } 1345 1353 1346 function remove_query_arg($key, $query) { 1354 /* 1355 remove_query_arg: Returns a modified querystring by removing 1356 a single key or an array of keys. 1357 Omitting oldquery_or_uri uses the $_SERVER value. 1358 1359 Parameters: 1360 remove_query_arg(removekey, [oldquery_or_uri]) or 1361 remove_query_arg(removekeyarray, [oldquery_or_uri]) 1362 */ 1363 1364 function remove_query_arg($key, $query='') { 1365 if ( is_array($key) ) { // removing multiple keys 1366 foreach ( (array) $key as $k ) 1367 $query = add_query_arg($k, '', $query); 1368 return $query; 1369 } 1347 1370 return add_query_arg($key, '', $query); 1348 1371 } 1349 1372 -
wp-admin/users.php
3 3 require_once( ABSPATH . WPINC . '/registration-functions.php'); 4 4 5 5 $title = __('Users'); 6 $parent_file = 'profile.php'; 6 if ( current_user_can('edit_users') ) 7 $parent_file = 'users.php'; 8 else 9 $parent_file = 'profile.php'; 7 10 8 11 $action = $_REQUEST['action']; 9 12 $update = ''; 10 13 14 if ( empty($_POST) ) { 15 $referer = '<input type="hidden" name="HTTP_REFERER" value="'. wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />'; 16 } elseif ( isset($_POST['HTTP_REFERER']) ) { 17 $redirect = remove_query_arg(array('HTTP_REFERER', 'updated', 'delete_count'), urldecode(stripslashes($_POST['HTTP_REFERER']))); 18 $referer = '<input type="hidden" name="HTTP_REFERER" value="' . wp_specialchars($redirect) . '" />'; 19 } else { 20 $redirect = 'users.php'; 21 } 22 11 23 switch ($action) { 12 24 13 25 case 'promote': 14 26 check_admin_referer('bulk-users'); 15 27 16 28 if (empty($_POST['users'])) { 17 header('Location: users.php');29 header('Location: ' . $redirect); 18 30 } 19 31 20 32 if ( !current_user_can('edit_users') ) 21 33 die(__('You can’t edit users.')); 22 34 23 35 $userids = $_POST['users']; 24 36 $update = 'promote'; 25 26 27 37 foreach($userids as $id) { 38 if ( ! current_user_can('edit_user', $id) ) 39 die(__('You can’t edit that user.')); 28 40 // The new role of the current user must also have edit_users caps 29 41 if($id == $current_user->id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { 30 42 $update = 'err_admin_role'; 31 43 continue; 32 44 } 33 45 34 35 36 46 $user = new WP_User($id); 47 $user->set_role($_POST['new_role']); 48 } 37 49 38 header('Location: users.php?update=' . $update);50 header('Location: ' . add_query_arg('update', $update, $redirect)); 39 51 40 52 break; 41 53 … … 44 56 check_admin_referer('delete-users'); 45 57 46 58 if ( empty($_POST['users']) ) { 47 header('Location: users.php');59 header('Location: ' . $redirect); 48 60 } 49 61 50 62 if ( !current_user_can('delete_users') ) 51 63 die(__('You can’t delete users.')); 52 64 53 65 $userids = $_POST['users']; 66 $update = 'del'; 67 $delete_count = 0; 54 68 55 $update = 'del'; 56 foreach ($userids as $id) { 57 if ( ! current_user_can('delete_user', $id) ) 58 die(__('You can’t delete that user.')); 59 69 foreach ( (array) $userids as $id) { 70 if ( ! current_user_can('delete_user', $id) ) 71 die(__('You can’t delete that user.')); 72 60 73 if($id == $current_user->id) { 61 74 $update = 'err_admin_del'; 62 75 continue; 63 76 } 64 77 switch($_POST['delete_option']) { 65 78 case 'delete': 66 79 wp_delete_user($id); 67 80 break; … … 69 82 wp_delete_user($id, $_POST['reassign_user']); 70 83 break; 71 84 } 85 ++$delete_count; 72 86 } 73 87 74 header('Location: users.php?update=' . $update);88 $redirect = add_query_arg('delete_count', $delete_count, $redirect); 75 89 90 header('Location: ' . add_query_arg('update', $update, $redirect)); 91 76 92 break; 77 93 78 94 case 'delete': 79 95 80 96 check_admin_referer('bulk-users'); 81 97 82 if (empty($_POST['users'])) { 83 header('Location: users.php'); 84 } 98 if ( empty($_POST['users']) ) 99 header('Location: ' . $redirect); 85 100 86 101 if ( !current_user_can('delete_users') ) 87 $error = new WP_Error('edit_users', __('You can’t delete users.'));102 $errors = new WP_Error('edit_users', __('You can’t delete users.')); 88 103 89 104 $userids = $_POST['users']; 90 105 … … 92 107 ?> 93 108 <form action="" method="post" name="updateusers" id="updateusers"> 94 109 <?php wp_nonce_field('delete-users') ?> 110 <?php echo $referer; ?> 95 111 <div class="wrap"> 96 112 <h2><?php _e('Delete Users'); ?></h2> 97 113 <p><?php _e('You have specified these users for deletion:'); ?></p> 98 114 <ul> 99 115 <?php 100 116 $go_delete = false; 101 foreach ($userids as $id) {102 103 if ( $id == $current_user->id) {117 foreach ( (array) $userids as $id ) { 118 $user = new WP_User($id); 119 if ( $id == $current_user->id ) { 104 120 echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n"; 105 121 } else { 106 122 echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "</li>\n"; 107 123 $go_delete = true; 108 124 } 109 } 110 $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); 111 $user_dropdown = '<select name="reassign_user">'; 112 foreach ($all_logins as $login) { 113 if ( $login->ID == $current_user->id || !in_array($login->ID, $userids) ) { 114 $user_dropdown .= "<option value=\"{$login->ID}\">{$login->user_login}</option>"; 115 } 116 } 117 $user_dropdown .= '</select>'; 118 ?> 119 </ul> 120 <?php if($go_delete) : ?> 121 <p><?php _e('What should be done with posts and links owned by this user?'); ?></p> 125 } 126 $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); 127 $user_dropdown = '<select name="reassign_user">'; 128 foreach ( (array) $all_logins as $login ) 129 if ( $login->ID == $current_user->id || !in_array($login->ID, $userids) ) 130 $user_dropdown .= "<option value=\"{$login->ID}\">{$login->user_login}</option>"; 131 $user_dropdown .= '</select>'; 132 ?> 133 </ul> 134 <?php if ( $go_delete ) : ?> 135 <p><?php _e('What should be done with posts and links owned by this user?'); ?></p> 122 136 <ul style="list-style:none;"> 123 137 <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" /> 124 138 <?php _e('Delete all posts and links.'); ?></label></li> … … 143 157 die(__('You can’t create users.')); 144 158 145 159 $user_id = add_user(); 160 $update = 'add'; 146 161 if ( is_wp_error( $user_id ) ) 147 162 $errors = $user_id; 148 163 else { 149 header('Location: users.php?update=add');164 header('Location: ' . add_query_arg('update', $update, $redirect)); 150 165 die(); 151 166 } 152 167 153 168 default: 154 wp_enqueue_script( 'admin-users');169 wp_enqueue_script('admin-users'); 155 170 156 include 171 include('admin-header.php'); 157 172 158 $userids = $wpdb->get_col("SELECT ID FROM $wpdb->users;");173 /* Paging and Search by Mark Jaquith, June 6th, 2006 */ 159 174 160 foreach($userids as $userid) { 175 $users_per_page = 50; 176 177 $page = (int) $_GET['userspage']; 178 if ( !$page ) 179 $page = 1; 180 181 $starton = ($page - 1) * $users_per_page; 182 183 $limit = 'LIMIT ' . $starton . ',' . $users_per_page; 184 185 $search_term = $_GET['usersearch']; 186 if ( $search_term ) { 187 $searches = array(); 188 $search_sql = 'AND ('; 189 foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col ) 190 $searches[] = $col . " LIKE '%$search_term%'"; 191 $search_sql .= implode(' OR ', $searches); 192 $search_sql .= ')'; 193 $search_term = stripslashes($search_term); // done with DB, from now on we want slashes gone 194 } 195 196 if ( !$_GET['update'] && !$search_term && !$_GET['userspage'] && $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users") > $users_per_page ) 197 $too_many_users = sprintf(__('Because this blog has more than %s users, they cannot all be shown on one page. Use the paging or search functionality in order to find the user you want to edit.'), $users_per_page); 198 199 $from_where = "FROM $wpdb->users WHERE 1=1 $search_sql"; 200 $userids = $wpdb->get_col('SELECT ID ' . $from_where . $limit); 201 202 if ( $userids ) 203 $total_users_for_this_query = $wpdb->get_var('SELECT COUNT(ID) ' . $from_where); // no limit 204 else 205 $errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 206 207 // Now for the paging 208 if ( $total_users_for_this_query > $users_per_page ) { // have to page the results 209 $prev_page = ( $page > 1) ? true : false; 210 $next_page = ( ($page * $users_per_page) < $total_users_for_this_query ) ? true : false; 211 $paging_text = ''; 212 if ( $prev_page ) 213 $paging_text .= '<p class="alignleft"><a href="' . add_query_arg(array('usersearch' => $search_term, 'userspage' => $page - 1), 'users.php?') . '">« Previous Page</a></p>'; 214 if ( $next_page ) 215 $paging_text .= '<p class="alignright"><a href="' . add_query_arg(array('usersearch' => $search_term, 'userspage' => $page + 1), 'users.php?') . '">Next Page »</a></p>'; 216 if ( $prev_page || $next_page ) 217 $paging_text .= '<br style="clear:both" />'; 218 } 219 220 // Clean up, we're done with these variables 221 unset($prev_page, $next_page, $limit, $searches, $search_sql, $col); 222 223 // Make the user objects 224 foreach ( (array) $userids as $userid ) { 161 225 $tmp_user = new WP_User($userid); 162 226 $roles = $tmp_user->roles; 163 227 $role = array_shift($roles); 164 228 $roleclasses[$role][$tmp_user->user_login] = $tmp_user; 165 229 } 166 230 167 ?> 168 169 <?php 170 if (isset($_GET['update'])) : 231 if ( isset($_GET['update']) ) : 171 232 switch($_GET['update']) { 172 233 case 'del': 234 case 'del_many': 173 235 ?> 174 <div id="message" class="updated fade"><p><?php _e('User deleted.'); ?></p></div> 236 <?php $delete_count = (int) $_GET['delete_count']; ?> 237 <div id="message" class="updated fade"><p><?php printf(__('%1$s %2$s deleted.'), $delete_count, __ngettext('user', 'users', $delete_count) ); ?></p></div> 175 238 <?php 176 239 break; 177 240 case 'add': … … 197 260 <?php 198 261 break; 199 262 } 200 endif; 201 if ( is_wp_error( $errors ) ) : ?> 263 endif; ?> 264 265 <?php if ( is_wp_error( $errors ) ) : ?> 202 266 <div class="error"> 203 267 <ul> 204 268 <?php 205 269 foreach ( $errors->get_error_messages() as $message ) 206 270 echo "<li>$message</li>"; 207 271 ?> 208 272 </ul> 209 273 </div> 210 <?php 211 endif; 212 ?> 274 <?php endif; ?> 213 275 276 <?php if ( $too_many_users ) : ?> 277 <div id="message" class="updated"> 278 <p><?php echo $too_many_users; ?></p> 279 </div> 280 <?php endif; ?> 281 282 <div class="wrap"> 283 <h2><?php _e('Search For Users'); ?></h2> 284 <form action="" method="get" name="search" id="search"> 285 <p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($search_term); ?>" /> <input type="submit" value="Search »" /></p> 286 </form> 287 <?php if ( $search_term ) : ?> 288 <p><a href="users.php"><?php _e('« Back to All Users'); ?></a></p> 289 <?php endif; ?> 290 </div> 291 292 <?php if ( $userids ) : ?> 293 214 294 <form action="" method="post" name="updateusers" id="updateusers"> 215 295 <?php wp_nonce_field('bulk-users') ?> 216 296 <div class="wrap"> 217 <h2><?php _e('User List by Role'); ?></h2> 297 <?php if ( $search_term ) : ?> 298 <h2><?php printf(__('Users Matching "%s" by Role'), $search_term); ?></h2> 299 <div class="user-paging-text"><?php echo $paging_text; ?></div> 300 <?php else : ?> 301 <h2><?php _e('User List by Role'); ?></h2> 302 <?php if ( $paging_text ) : ?> 303 <div class="user-paging-text"><?php echo $paging_text; ?></p></div> 304 <?php endif; ?> 305 <?php endif; ?> 306 <h3><?php printf(__('Results %1$s - %2$s of %3$s shown below'), $starton + 1, min($starton + $users_per_page, $total_users_for_this_query), $total_users_for_this_query); ?></h3> 218 307 <table class="widefat"> 219 308 <?php 220 309 foreach($roleclasses as $role => $roleclass) { … … 222 311 ?> 223 312 224 313 <tr> 225 <th colspan=" 8" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>314 <th colspan="7" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th> 226 315 </tr> 227 <thead> 228 <tr> 316 <tr class="thead"> 229 317 <th style="text-align: left"><?php _e('ID') ?></th> 230 318 <th style="text-align: left"><?php _e('Username') ?></th> 231 319 <th style="text-align: left"><?php _e('Name') ?></th> 232 320 <th style="text-align: left"><?php _e('E-mail') ?></th> 233 321 <th style="text-align: left"><?php _e('Website') ?></th> 234 <th><?php _e('Posts') ?></th> 235 <th> </th> 322 <th colspan="2"><?php _e('Actions') ?></th> 236 323 </tr> 237 324 </thead> 238 325 <tbody id="role-<?php echo $role; ?>"><?php 239 326 $style = ''; 240 foreach ( $roleclass as $user_object) {241 $style = ( ' class="alternate"' == $style) ? '' : ' class="alternate"';242 echo "\n\t" . user_row( $user_object, $style);327 foreach ( (array) $roleclass as $user_object ) { 328 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 329 echo "\n\t" . user_row($user_object, $style); 243 330 } 244 245 331 ?> 246 332 247 333 </tbody> 248 <?php 249 } 250 ?> 334 <?php } ?> 251 335 </table> 252 336 337 <?php if ( $paging_text ) : ?> 338 <div class="user-paging-text"><?php echo $paging_text; ?></div> 339 <?php endif; ?> 253 340 254 341 <h2><?php _e('Update Users'); ?></h2> 255 <ul style="list-style:none;"> 256 <li><input type="radio" name="action" id="action0" value="delete" /> <label for="action0"><?php _e('Delete checked users.'); ?></label></li> 257 <li> 258 <input type="radio" name="action" id="action1" value="promote" /> <label for="action1"><?php _e('Set the Role of checked users to:'); ?></label> 259 <select name="new_role"><?php wp_dropdown_roles(); ?></select> 260 </li> 261 </ul> 262 <p class="submit"><input type="submit" value="<?php _e('Update »'); ?>" /></p> 342 <ul style="list-style:none;"> 343 <li><input type="radio" name="action" id="action0" value="delete" /> <label for="action0"><?php _e('Delete checked users.'); ?></label></li> 344 <li> 345 <input type="radio" name="action" id="action1" value="promote" /> <label for="action1"><?php _e('Set the Role of checked users to:'); ?></label> 346 <select name="new_role"><?php wp_dropdown_roles(); ?></select> 347 </li> 348 </ul> 349 <p class="submit"> 350 <?php echo $referer; ?> 351 <input type="submit" value="<?php _e('Update »'); ?>" /> 352 </p> 263 353 </div> 264 354 </form> 265 355 356 <?php endif; // if users were returned ?> 357 266 358 <div class="wrap"> 267 359 <h2><?php _e('Add New User') ?></h2> 268 360 <?php echo '<p>'.sprintf(__('Users can <a href="%1$s">register themselves</a> or you can manually create users here.'), get_settings('siteurl').'/wp-register.php').'</p>'; ?> 269 361 <form action="" method="post" name="adduser" id="adduser"> 270 <?php wp_nonce_field('add-user') ?> 271 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 272 <tr> 273 <th scope="row" width="33%"><?php _e('Nickname') ?> 274 <input name="action" type="hidden" id="action" value="adduser" /></th> 275 <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" /></td> 276 </tr> 277 <tr> 278 <th scope="row"><?php _e('First Name') ?> </th> 279 <td><input name="first_name" type="text" id="first_name" value="<?php echo $new_user_firstname; ?>" /></td> 280 </tr> 281 <tr> 282 <th scope="row"><?php _e('Last Name') ?> </th> 283 <td><input name="last_name" type="text" id="last_name" value="<?php echo $new_user_lastname; ?>" /></td> 284 </tr> 285 <tr> 286 <th scope="row"><?php _e('E-mail') ?></th> 287 <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td> 288 </tr> 289 <tr> 290 <th scope="row"><?php _e('Website') ?></th> 291 <td><input name="url" type="text" id="url" value="<?php echo $new_user_uri; ?>" /></td> 292 </tr> 293 <?php 294 $show_password_fields = apply_filters('show_password_fields', true); 295 if ( $show_password_fields ) : 296 ?> 297 <tr> 298 <th scope="row"><?php _e('Password (twice)') ?> </th> 299 <td><input name="pass1" type="password" id="pass1" /> 300 <br /> 301 <input name="pass2" type="password" id="pass2" /></td> 302 </tr> 362 <?php wp_nonce_field('add-user') ?> 363 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 364 <tr> 365 <th scope="row" width="33%"><?php _e('Nickname') ?><input name="action" type="hidden" id="action" value="adduser" /></th> 366 <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" /></td> 367 </tr> 368 <tr> 369 <th scope="row"><?php _e('First Name') ?> </th> 370 <td><input name="first_name" type="text" id="first_name" value="<?php echo $new_user_firstname; ?>" /></td> 371 </tr> 372 <tr> 373 <th scope="row"><?php _e('Last Name') ?> </th> 374 <td><input name="last_name" type="text" id="last_name" value="<?php echo $new_user_lastname; ?>" /></td> 375 </tr> 376 <tr> 377 <th scope="row"><?php _e('E-mail') ?></th> 378 <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td> 379 </tr> 380 <tr> 381 <th scope="row"><?php _e('Website') ?></th> 382 <td><input name="url" type="text" id="url" value="<?php echo $new_user_uri; ?>" /></td> 383 </tr> 384 385 <?php if ( apply_filters('show_password_fields', true) ) : ?> 386 <tr> 387 <th scope="row"><?php _e('Password (twice)') ?> </th> 388 <td><input name="pass1" type="password" id="pass1" /> 389 <br /> 390 <input name="pass2" type="password" id="pass2" /></td> 391 </tr> 303 392 <?php endif; ?> 304 <tr> 305 <th scope="row"><?php _e('Role'); ?></th> 306 <td><select name="role" id="role"><?php wp_dropdown_roles( get_settings('default_role') ); ?></select></td> 307 </tr> 308 </table> 309 <p class="submit"> 310 <input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User »') ?>" /> 311 </p> 312 </form> 393 394 <tr> 395 <th scope="row"><?php _e('Role'); ?></th> 396 <td><select name="role" id="role"><?php wp_dropdown_roles( get_settings('default_role') ); ?></select></td> 397 </tr> 398 </table> 399 <p class="submit"> 400 <?php echo $referer; ?> 401 <input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User »') ?>" /> 402 </p> 403 </form> 404 313 405 <div id="ajax-response"></div> 314 406 </div> 315 <?php316 407 408 <?php 317 409 break; 318 }319 410 411 } // end of the $action switch 412 320 413 include('admin-footer.php'); 321 ?> 414 ?> 415 No newline at end of file -
wp-admin/wp-admin.css
52 52 font-size: 16px; 53 53 } 54 54 55 thead {55 thead, .thead { 56 56 background: #dfdfdf 57 57 } 58 58 -
wp-admin/admin-functions.php
729 729 if (strlen($short_url) > 35) 730 730 $short_url = substr($short_url, 0, 32).'...'; 731 731 $numposts = get_usernumposts($user_object->ID); 732 if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>";733 732 $r = "<tr id='user-$user_object->ID'$style> 734 733 <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td> 735 734 <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td> 736 735 <td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td> 737 736 <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td> 738 737 <td><a href='$url' title='website: $url'>$short_url</a></td>"; 739 $r .= "\n\t\t<td align='center'>$numposts</td>"; 740 $r .= "\n\t\t<td>"; 738 $r .= "\n\t\t<td align='center'>"; 739 if ($numposts > 0) { 740 $r .= "<a href='edit.php?author=$user_object->ID' title='" . __('View posts by this author') . "' class='edit'>"; 741 $r .= sprintf(__('View %1$s %2$s'), $numposts, __ngettext('post', 'posts', $numposts)); 742 } 743 $r .= "</td>\n\t\t<td>"; 741 744 if ( current_user_can('edit_user', $user_object->ID) ) 742 745 $r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>"; 743 746 $r .= "</td>\n\t</tr>"; -
wp-admin/menu.php
11 11 $menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php'); 12 12 $menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); 13 13 if ( current_user_can('edit_users') ) 14 $menu[35] = array(__('Users'), ' read', 'profile.php');14 $menu[35] = array(__('Users'), 'edit_users', 'users.php'); 15 15 else 16 16 $menu[35] = array(__('Profile'), 'read', 'profile.php'); 17 17 $menu[40] = array(__('Options'), 'manage_options', 'options-general.php'); … … 34 34 $submenu['link-manager.php'][10] = array(__('Add Bookmark'), 'manage_links', 'link-add.php'); 35 35 $submenu['link-manager.php'][20] = array(__('Import Bookmarks'), 'manage_links', 'link-import.php'); 36 36 37 $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); 38 $submenu['profile.php'][10] = array(__('Authors & Users'), 'edit_users', 'users.php'); 37 if ( current_user_can('edit_users') ) { 38 $submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php'); 39 $submenu['users.php'][10] = array(__('Your Profile'), 'read', 'profile.php'); 40 } else { 41 $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); 42 } 39 43 40 44 $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php'); 41 45 $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php'); -
wp-admin/profile.php
3 3 4 4 $title = __('Profile'); 5 5 6 $parent_file = 'profile.php'; 6 if ( current_user_can('edit_users') ) 7 $parent_file = 'users.php'; 8 else 9 $parent_file = 'profile.php'; 7 10 include_once('admin-header.php'); 8 11 $profileuser = new WP_User($user_ID); 9 12 -
wp-admin/user-edit.php
2 2 require_once('admin.php'); 3 3 4 4 $title = __('Edit User'); 5 $parent_file = 'profile.php'; 5 if ( current_user_can('edit_users') ) 6 $parent_file = 'users.php'; 7 else 8 $parent_file = 'profile.php'; 6 9 $submenu_file = 'users.php'; 7 10 8 11 $wpvarstoreset = array('action', 'redirect', 'profile', 'user_id');