Changeset 1289
- Timestamp:
- 05/15/08 16:35:59 (5 months ago)
- Files:
-
- trunk/wp-admin/wpmu-admin.php (modified) (3 diffs)
- trunk/wp-admin/wpmu-blogs.php (modified) (18 diffs)
- trunk/wp-admin/wpmu-edit.php (modified) (26 diffs)
- trunk/wp-admin/wpmu-options.php (modified) (14 diffs)
- trunk/wp-admin/wpmu-themes.php (modified) (3 diffs)
- trunk/wp-admin/wpmu-upgrade-site.php (modified) (2 diffs)
- trunk/wp-admin/wpmu-users.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/wpmu-admin.php
r1270 r1289 28 28 <div class="wrap"> 29 29 <h2><?php _e('WordPress MU : Admin') ?></h2> 30 30 31 31 <div id="rightnow"> 32 32 <h3 class="reallynow"> 33 33 <span><?php _e('Right Now'); ?></span> 34 34 35 35 <a href="wpmu-blogs.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Blog'); ?></strong></a> 36 36 <a href="wpmu-users.php#form-add-user" class="rbutton"><?php _e('Create a New User'); ?></a> 37 37 <br class="clear" /> 38 38 </h3> 39 40 <p class="youhave"><?php echo $sentence; ?></p> 39 40 <p class="youhave"><?php echo $sentence; ?></p> 41 41 <?php do_action('wpmuadminresult', ''); ?> 42 42 43 43 <form name="searchform" action="wpmu-users.php" method="get"> 44 44 <p> … … 48 48 </p> 49 49 </form> 50 50 51 51 <form name="searchform" action="wpmu-blogs.php" method="get"> 52 52 <p> … … 56 56 </p> 57 57 </form> 58 58 59 59 <?php do_action( 'mu_rightnow_end' ); ?> 60 60 <?php do_action( 'mu_activity_box_end' ); ?> trunk/wp-admin/wpmu-blogs.php
r1264 r1289 74 74 ?> 75 75 <div class="wrap"> 76 <h2><?php _e('Edit Blog'); ?> - <a href='http://<?php echo $details['domain'].$details['path']; ?>'><?php echo $details['domain'].$details['path']; ?></a></h2> 76 <h2><?php _e('Edit Blog'); ?> - <a href='http://<?php echo $details['domain'].$details['path']; ?>'><?php echo $details['domain'].$details['path']; ?></a></h2> 77 77 <form method="post" action="wpmu-edit.php?action=updateblog"> 78 78 <?php wp_nonce_field('editblog'); ?> … … 137 137 </tr> 138 138 </table> 139 139 140 140 <h3><?php printf( __('Blog options (wp_%s_options)'), $id ); ?></h3> 141 141 <table class="form-table"> … … 190 190 $theme_key = wp_specialchars( $theme['Stylesheet'] ); 191 191 if( isset($allowed_themes[$theme_key] ) == false ) { 192 $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : ''; 193 $out .= '<tr class="form-field form-required"> 192 $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : ''; 193 $out .= '<tr class="form-field form-required"> 194 194 <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th> 195 195 <td><input name="theme['.$theme_key.']" type="checkbox" value="on" '.$checked.'/></td> … … 197 197 } 198 198 } 199 200 199 200 201 201 if( $out != '' ) { 202 202 echo "<h3>" . __('Blog Themes') . "</h3>"; 203 echo '<table class="form-table">'; 203 echo '<table class="form-table">'; 204 204 echo '<tr class=""><th>' . __('Theme') . '</th><th>' . __('Enable') . '</th></tr>'; 205 205 echo $out; 206 206 echo "</table>"; 207 207 } 208 208 209 209 // Blog users 210 210 $blogusers = get_users_of_blog( $id ); … … 245 245 echo "</table>"; 246 246 } 247 247 248 248 // New blog user 249 249 echo "<h3>" . __('Add a new user') . "</h3>"; ?> … … 270 270 </tr> 271 271 </table> 272 272 273 273 <h3><?php _e('Misc Blog Actions') ?></h3> 274 274 <table class="form-table"> 275 275 <?php do_action( 'wpmueditblogaction', $id ); ?> 276 276 </table> 277 277 278 278 <p class="submit"> 279 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /></p> 279 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /></p> 280 280 </td> 281 281 </tr> … … 285 285 <?php 286 286 break; 287 287 288 288 // List blogs 289 289 default: 290 290 $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; 291 291 $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15; 292 292 $s = wp_specialchars( trim( $_GET[ 's' ] ) ); 293 293 294 $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; 294 295 295 296 if( isset($_GET['blog_name']) ) { 296 $s = trim($_GET['s']);297 297 $query = "SELECT blog_id, {$wpdb->blogs}.domain, {$wpdb->blogs}.path, registered, last_updated 298 298 FROM {$wpdb->blogs}, {$wpdb->site} … … 310 310 WHERE site_id = '{$wpdb->siteid}' 311 311 AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id 312 AND {$wpdb->registration_log}.IP LIKE ('% ".$_GET['s']."%')";312 AND {$wpdb->registration_log}.IP LIKE ('%{$s}%')"; 313 313 } 314 314 315 315 if( isset( $_GET['sortby'] ) == false ) { 316 316 $_GET['sortby'] = 'id'; 317 317 } 318 318 319 319 if( $_GET['sortby'] == 'registered' ) { 320 320 $query .= ' ORDER BY registered '; … … 328 328 329 329 $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 330 330 331 331 if( !empty($_GET['s']) ) { 332 $blog_list = $wpdb->get_results( $query, ARRAY_A ); 333 $total = count($blog_list); 332 $blog_list = $wpdb->get_results( $query, ARRAY_A ); 333 $total = count($blog_list); 334 334 } else { 335 $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "); 335 $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "); 336 336 } 337 337 338 338 $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); 339 340 $blog_list = $wpdb->get_results( $query, ARRAY_A ); 339 340 $blog_list = $wpdb->get_results( $query, ARRAY_A ); 341 341 342 342 // Pagination 343 $url2 = "&order=" . $_GET['order'] . "&sortby=" . $_GET['sortby'] . "&s=" . $_GET['s'] . "&ip_address=" . $_GET['ip_address']; 343 $url2 = "&order=" . $_GET['order'] . "&sortby=" . $_GET['sortby'] . "&s="; 344 if( $_GET[ 'blog_ip' ] ) { 345 $url2 .= "&ip_address=" . urlencode( $s ); 346 } else { 347 $url2 .= $s . "&ip_address=" . urlencode( $s ); 348 } 344 349 $blog_navigation = paginate_links( array( 345 350 'base' => add_query_arg( 'apage', '%#%' ).$url2, … … 352 357 <div class="wrap" style="position:relative;"> 353 358 <h2><?php _e('Blogs') ?></h2> 354 359 355 360 <form id="searchform" action="wpmu-blogs.php" method="get" style="position:absolute;right:0;top:0;"> 356 <input type="hidden" name="action" value="blogs" /> 357 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( wp_specialchars($_GET['s'], 1)); ?>" size="17" />361 <input type="hidden" name="action" value="blogs" /> 362 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes($s); ?>" size="17" /> 358 363 <input type="submit" class="button" name="blog_name" value="<?php _e('Search blogs by name') ?>" /> 359 <input type="submit" class="button" name="blog_id" value="<?php _e('by blog ID') ?>" /> 360 <input type="submit" class="button" name="blog_ip" value="<?php _e('by IP address') ?>" /> 364 <input type="submit" class="button" name="blog_id" value="<?php _e('by blog ID') ?>" /> 365 <input type="submit" class="button" name="blog_ip" value="<?php _e('by IP address') ?>" /> 361 366 </form> 362 367 363 368 <form id="form-blog-list" action="wpmu-edit.php?action=allblogs" method="post"> 364 369 365 370 <div class="tablenav"> 366 <?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?> 371 <?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?> 367 372 368 373 <div class="alignleft"> … … 376 381 377 382 <br class="clear" /> 378 383 379 384 <?php if( isset($_GET['s']) && !empty($_GET['s']) ) : ?> 380 <p><a href="wpmu-users.php?action=users&s=<?php echo stripslashes(wp_specialchars($_GET['s'], 1)) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes(wp_specialchars($_GET['s'], 1)); ?></strong></a></p>381 <?php endif; ?> 385 <p><a href="wpmu-users.php?action=users&s=<?php echo urlencode( stripslashes( $s ) ) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes( $s ); ?></strong></a></p> 386 <?php endif; ?> 382 387 383 388 <?php … … 402 407 $posts_columns['control_delete'] = ''; 403 408 404 $sortby_url = "s=" . $_GET['s'] . "&ip_address=" . $_GET['ip_address']; 409 $sortby_url = "s="; 410 if( $_GET[ 'blog_ip' ] ) { 411 $sortby_url .= "&ip_address=" . urlencode( $s ); 412 } else { 413 $sortby_url .= urlencode( $s ) . "&ip_address=" . urlencode( $s ); 414 } 405 415 ?> 406 416 407 417 <table width="100%" cellpadding="3" cellspacing="3" class="widefat"> 408 418 <thead> … … 415 425 } 416 426 $column_link .= "apage={$apage}'>{$column_display_name}</a>"; 417 427 418 428 $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; 419 429 ?> … … 430 440 $class = ('alternate' == $class) ? '' : 'alternate'; 431 441 reset( $status_list ); 432 442 433 443 $bgcolour = ""; 434 444 foreach ( $status_list as $status => $col ) { … … 438 448 } 439 449 echo "<tr $bgcolour class='$class'>"; 440 450 441 451 $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; 442 452 foreach( $posts_columns as $column_name=>$column_display_name ) { … … 571 581 </tbody> 572 582 </table> 573 </form> 583 </form> 574 584 </div> 575 585 576 586 <div class="wrap"> 577 587 <h2><?php _e('Add Blog') ?></h2> … … 579 589 <?php wp_nonce_field('add-blog') ?> 580 590 <table class="form-table"> 581 <tr class="form-field form-required"> 591 <tr class="form-field form-required"> 582 592 <th style="text-align:center;" scope='row'><?php _e('Blog Address') ?></th> 583 593 <td> … … 593 603 <td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td> 594 604 </tr> 595 <tr class="form-field form-required"> 605 <tr class="form-field form-required"> 596 606 <th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th> 597 607 <td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td> trunk/wp-admin/wpmu-edit.php
r1285 r1289 25 25 26 26 update_site_option( "WPLANG", $_POST['WPLANG'] ); 27 27 28 28 if( is_email( $_POST['admin_email'] ) ) 29 29 update_site_option( "admin_email", $_POST['admin_email'] ); 30 30 31 $illegal_names = split( ' ', $_POST['illegal_names'] ); 31 $illegal_names = split( ' ', $_POST['illegal_names'] ); 32 32 foreach( (array) $illegal_names as $name ) { 33 33 $name = trim( $name ); … … 36 36 } 37 37 update_site_option( "illegal_names", $names ); 38 38 39 39 update_site_option( "registration", $_POST['registration'] ); 40 40 update_site_option( "registrationnotification", $_POST['registrationnotification'] ); … … 50 50 update_site_option( "limited_email_domains", '' ); 51 51 } 52 52 53 53 if( $_POST['banned_email_domains'] != '' ) { 54 54 $banned_email_domains = split( "\n", stripslashes( $_POST[ 'banned_email_domains' ] ) ); … … 60 60 update_site_option( "banned_email_domains", '' ); 61 61 } 62 62 63 63 update_site_option( "menu_items", $_POST['menu_items'] ); 64 64 update_site_option( "blog_upload_space", $_POST['blog_upload_space'] ); … … 68 68 update_site_option( "welcome_email", $_POST['welcome_email'] ); 69 69 update_site_option( "fileupload_maxk", $_POST['fileupload_maxk'] ); 70 70 71 71 $site_admins = explode( ' ', str_replace( ",", " ", $_POST['site_admins'] ) ); 72 72 if ( is_array( $site_admins ) ) { … … 89 89 exit(); 90 90 break; 91 91 92 92 // Blogs 93 93 case "addblog": … … 98 98 $email = wp_specialchars( $blog['email'] ); 99 99 $title = stripslashes( wp_specialchars( $blog['title'] ) ); 100 100 101 101 if ( empty($domain) || empty($email)) 102 102 wp_die( __('Missing blog address or email address.') ); 103 103 if( !is_email( $email ) ) 104 104 wp_die( __('Invalid email address') ); 105 105 106 106 if( constant('VHOST') == 'yes' ) { 107 107 $newdomain = $domain.".".$current_site->domain; … … 137 137 } 138 138 break; 139 139 140 140 case "updateblog": 141 141 check_admin_referer('editblog'); … … 149 149 $_POST['option']['allowedthemes'] = ''; 150 150 } 151 151 152 152 if( is_array( $_POST['option'] ) ) { 153 153 $c = 1; … … 165 165 if( get_blog_option( $id, 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 166 166 update_blog_option( $id, 'siteurl', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 167 167 168 168 if( get_blog_option( $id, 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 169 169 update_blog_option( $id, 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 170 170 171 171 // update blogs table 172 172 $result = $wpdb->query("UPDATE {$wpdb->blogs} SET … … 180 180 spam = '".$_POST['blog']['spam']."' 181 181 WHERE blog_id = '$id'"); 182 182 183 183 update_blog_status( $id, 'spam', $_POST['blog']['spam'] ); 184 184 185 185 // user roles 186 186 if( is_array( $_POST['role'] ) == true ) { … … 243 243 wpmu_admin_do_redirect( "wpmu-blogs.php?action=editblog&updated=true&id=".$id ); 244 244 break; 245 245 246 246 case "deleteblog": 247 247 check_admin_referer('deleteblog'); 248 248 if( $id != '0' && $id != '1' ) 249 249 wpmu_delete_blog( $id, true ); 250 250 251 251 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) ); 252 252 exit(); 253 253 break; 254 254 255 255 case "allblogs": 256 256 check_admin_referer('allblogs'); … … 275 275 exit(); 276 276 break; 277 277 278 278 case "archiveblog": 279 279 check_admin_referer('archiveblog'); … … 283 283 exit(); 284 284 break; 285 285 286 286 case "unarchiveblog": 287 287 check_admin_referer('unarchiveblog'); … … 291 291 exit(); 292 292 break; 293 293 294 294 case "activateblog": 295 295 check_admin_referer('activateblog'); … … 299 299 exit(); 300 300 break; 301 301 302 302 case "deactivateblog": 303 303 check_admin_referer('deactivateblog'); … … 307 307 exit(); 308 308 break; 309 309 310 310 case "unspamblog": 311 311 check_admin_referer('unspamblog'); … … 315 315 exit(); 316 316 break; 317 317 318 318 case "spamblog": 319 319 check_admin_referer('spamblog'); … … 323 323 exit(); 324 324 break; 325 325 326 326 case "mature": 327 327 update_blog_status( $id, 'mature', '1' ); … … 330 330 exit(); 331 331 break; 332 332 333 333 case "unmature": 334 334 update_blog_status( $id, 'mature', '0' ); 335 335 do_action( 'unmature_blog', $id ); 336 336 337 337 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'umature'), $_POST['ref'] ) ); 338 338 exit(); 339 339 break; 340 340 341 341 // Themes 342 342 case "updatethemes": … … 353 353 exit(); 354 354 break; 355 355 356 356 // Common 357 357 case "confirm": … … 380 380 <input type='hidden' name='ref' value='<?php if( isset( $_GET['ref'] ) ) {echo wp_specialchars( $_GET['ref'] ); } else { echo $_SERVER['HTTP_REFERER']; } ?>' /> 381 381 <?php wp_nonce_field( $_GET['action2'] ) ?> 382 <p> 382 <p> 383 383 <?php echo wp_specialchars( $_GET['msg'] ) ?><br /> 384 <input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p> 384 <input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p> 385 385 </form> 386 386 </body> … … 388 388 <?php 389 389 break; 390 390 391 391 // Users 392 392 case "deleteuser": … … 398 398 exit(); 399 399 break; 400 400 401 401 case "allusers": 402 402 check_admin_referer('allusers'); … … 425 425 } 426 426 } 427 } 427 } 428 428 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $userfunction), $_SERVER['HTTP_REFERER'] ) ); 429 429 exit(); 430 430 break; 431 431 432 432 case "adduser": 433 433 check_admin_referer('add-user'); … … 455 455 exit(); 456 456 break; 457 457 458 458 default: 459 459 wpmu_admin_do_redirect( "wpmu-admin.php" ); 460 break; 460 break; 461 461 } 462 462 trunk/wp-admin/wpmu-options.php
r1285 r1289 21 21 <form method="post" action="wpmu-edit.php?action=siteoptions"> 22 22 <?php wp_nonce_field( "siteoptions" ); ?> 23 23 24 24 <h3><?php _e('Operational Settings <em>(These settings cannot be modified by blog owners)</em>') ?></h3> 25 25 <table class="form-table"> … … 32 32 </td> 33 33 </tr> 34 34 35 35 <tr valign="top"> 36 36 <th scope="row"><?php _e('Site Admin Email') ?></th> … … 41 41 </td> 42 42 </tr> 43 43 44 44 <tr valign="top"> 45 45 <th scope="row"><?php _e('Allow new registrations') ?></th> … … 56 56 </td> 57 57 </tr> 58 58 59 59 <tr valign="top"> 60 60 <th scope="row"><?php _e('Registration notification') ?></th> … … 69 69 </td> 70 70 </tr> 71 71 72 72 <tr valign="top"> 73 73 <th scope="row"><?php _e('Welcome Email') ?></th> … … 78 78 </td> 79 79 </tr> 80 80 81 81 <tr valign="top"> 82 82 <th scope="row"><?php _e('First Post') ?></th> … … 87 87 </td> 88 88 </tr> 89 89 90 90 <tr valign="top"> 91 91 <th scope="row"><?php _e('Banned Names') ?></th> … … 96 96 </td> 97 97 </tr> 98 98 99 99 <tr valign="top"> 100 100 <th scope="row"><?php _e('Limited Email Registrations') ?></th> … … 107 107 </td> 108 108 </tr> 109 109 110 110 <tr valign="top"> 111 111 <th scope="row"><?php _e('Banned Email Domains') ?></th> … … 116 116 </td> 117 117 </tr> 118 118 119 119 <tr valign="top"> 120 120 <th scope="row"><?php _e('Blog upload space') ?></th> 121 121 <td><input name="blog_upload_space" type="text" id="blog_upload_space" value="<?php echo get_site_option('blog_upload_space', 10) ?>" size="3" /> MB</td> 122 122 </tr> 123 123 124 124 <tr valign="top"> 125 125 <th scope="row"><?php _e('Upload File Types') ?></th> 126 126 <td><input name="upload_filetypes" type="text" id="upload_filetypes" value="<?php echo get_site_option('upload_filetypes', 'jpg jpeg png gif') ?>" size="45" /></td> 127 127 </tr> 128 128 129 129 <tr valign="top"> 130 130 <th scope="row"><?php _e('Max upload file size') ?></th> … … 132 132 </tr> 133 133 </table> 134 135 <h3><?php _e('Administration Settings') ?></h3> 134 135 <h3><?php _e('Administration Settings') ?></h3> 136 136 <table class="form-table"> 137 137 <tr valign="top"> … … 144 144 </tr> 145 145 </table> 146 146 147 147 <h3><?php _e('Site Wide Settings <em>(These settings may be overridden by blog owners)</em>') ?></h3> 148 148 <table class="form-table"> … … 167 167 ?> 168 168 </table> 169 169 170 170 <h3><?php _e('Menus <em>(Enable or disable WP Backend Menus)</em>') ?></h3> 171 171 <table class="form-table"> … … 185 185 186 186 <?php do_action( 'wpmu_options' ); // Add more options here ?> 187 187 188 188 <p class="submit"> 189 189 <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /></p> trunk/wp-admin/wpmu-themes.php
r1278 r1289 22 22 <form action='wpmu-edit.php?action=updatethemes' method='post'> 23 23 <h2><?php _e('Site Themes') ?></h2> 24 <p><?php _e('Disable themes site-wide. You can enable themes on a blog by blog basis.') ?></p> 24 <p><?php _e('Disable themes site-wide. You can enable themes on a blog by blog basis.') ?></p> 25 25 <table class="widefat"> 26 26 <thead> … … 38 38 $class = ('alt' == $class) ? '' : 'alt'; 39 39 $class1 = $enabled = $disabled = ''; 40 40 41 41 if( isset( $allowed_themes[ $theme_key ] ) == true ) { 42 42 $enabled = 'checked="checked" '; … … 59 59 </tbody> 60 60 </table> 61 61 62 62 <p class="submit"> 63 63 <input type='submit' value='<?php _e('Update Themes »') ?>' /></p> trunk/wp-admin/wpmu-upgrade-site.php
r1261 r1289 20 20 case "upgrade": 21 21 $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0; 22 22 23 23 $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A ); 24 24 if( is_array( $blogs ) ) { … … 58 58 } 59 59 break; 60 60 61 61 default: ?> 62 62 <p><?php _e("You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade."); ?></p> trunk/wp-admin/wpmu-users.php
r1270 r1289 41 41 $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; 42 42 $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15; 43 $s = wp_specialchars( trim( $_GET[ 's' ] ) ); 43 44 44 45 $query = "SELECT * FROM {$wpdb->users}"; 45 46 if( !empty( $_GET['s']) ) {47 $search = '%' . trim( addslashes($_GET['s'])) . '%';46 47 if( !empty( $s ) ) { 48 $search = '%' . trim( $s ) . '%'; 48 49 $query .= " WHERE user_login LIKE '$search' OR user_email LIKE '$search'"; 49 50 } 50 51 51 52 if( !isset($_GET['sortby']) ) { 52 53 $_GET['sortby'] = 'id'; 53 54 } 54 55 55 56 if( $_GET['sortby'] == 'email' ) { 56 57 $query .= ' ORDER BY user_email '; … … 64 65 $query .= ' ORDER BY user_registered '; 65 66 } 66 67 67 68 $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 68 69 69 if( !empty( $_GET['s'])) {70 if( !empty( $s )) { 70 71 $user_list = $wpdb->get_results( $query, ARRAY_A ); 71 $total = count($user_list); 72 $total = count($user_list); 72 73 } else { 73 74 $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->users}"); 74 75 } 75 76 76 77 $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); 77 78 78 79 $user_list = $wpdb->get_results( $query, ARRAY_A ); 79 80 … … 88 89 <h2><?php _e("Users"); ?></h2> 89 90 <form action="wpmu-users.php" method="get" style="position:absolute;right:0;top:0;"> 90 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( wp_specialchars($_GET['s'], 1)); ?>" size="17" />91 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( $s ); ?>" size="17" /> 91 92 <input type="submit" id="post-query-submit" value="<?php _e('Search Users') ?>" class="button" /> 92 93 </form> … … 94 95 <form id="form-user-list" action='wpmu-edit.php?action=allusers' method='post'> 95 96 <div class="tablenav"> 96 <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?> 97 <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?> 97 98 98 99 <div class="alignleft">
