PageRenderTime 34ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-admin/network/users.php

https://github.com/coffeant/wordpress
PHP | 97 lines | 76 code | 13 blank | 8 comment | 11 complexity | 2e383a63816702eb647c733a981602f3 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * Multisite users administration panel.
  4. *
  5. * @package WordPress
  6. * @subpackage Multisite
  7. * @since 3.0.0
  8. */
  9. /** Load WordPress Administration Bootstrap */
  10. require_once( './admin.php' );
  11. if ( ! is_multisite() )
  12. wp_die( __( 'Multisite support is not enabled.' ) );
  13. if ( ! current_user_can( 'manage_network_users' ) )
  14. wp_die( __( 'You do not have permission to access this page.' ) );
  15. $wp_list_table = _get_list_table('WP_MS_Users_List_Table');
  16. $pagenum = $wp_list_table->get_pagenum();
  17. $wp_list_table->prepare_items();
  18. $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
  19. if ( $pagenum > $total_pages && $total_pages > 0 ) {
  20. wp_redirect( add_query_arg( 'paged', $total_pages ) );
  21. exit;
  22. }
  23. $title = __( 'Users' );
  24. $parent_file = 'users.php';
  25. add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
  26. add_contextual_help($current_screen,
  27. '<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
  28. '<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' .
  29. '<p>' . __('You can also go to the user&#8217;s profile page by clicking on the individual username.') . '</p>' .
  30. '<p>' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '</p>' .
  31. '<p>' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '</p>' .
  32. '<p>' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '</p>' .
  33. '<p><strong>' . __('For more information:') . '</strong></p>' .
  34. '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
  35. '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
  36. );
  37. require_once( '../admin-header.php' );
  38. if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
  39. ?>
  40. <div id="message" class="updated"><p>
  41. <?php
  42. switch ( $_REQUEST['action'] ) {
  43. case 'delete':
  44. _e( 'User deleted.' );
  45. break;
  46. case 'all_spam':
  47. _e( 'Users marked as spam.' );
  48. break;
  49. case 'all_notspam':
  50. _e( 'Users removed from spam.' );
  51. break;
  52. case 'all_delete':
  53. _e( 'Users deleted.' );
  54. break;
  55. case 'add':
  56. _e( 'User added.' );
  57. break;
  58. }
  59. ?>
  60. </p></div>
  61. <?php
  62. }
  63. ?>
  64. <div class="wrap">
  65. <?php screen_icon(); ?>
  66. <h2><?php
  67. esc_html_e( 'Users' );
  68. if ( current_user_can( 'create_users' ) ) {
  69. favorite_actions( $current_screen );
  70. }
  71. if ( !empty( $usersearch ) ) {
  72. printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
  73. }
  74. ?>
  75. </h2>
  76. <?php $wp_list_table->views(); ?>
  77. <form action="" method="get" class="search-form">
  78. <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
  79. </form>
  80. <form id="form-user-list" action='edit.php?action=allusers' method='post'>
  81. <?php $wp_list_table->display(); ?>
  82. </form>
  83. </div>
  84. <?php require_once( '../admin-footer.php' ); ?>