wp/wp-admin/network/users.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Multisite users administration panel.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @subpackage Multisite
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
/** Load WordPress Administration Bootstrap */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
require_once( dirname( __FILE__ ) . '/admin.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
if ( ! is_multisite() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
	wp_die( __( 'Multisite support is not enabled.' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
if ( ! current_user_can( 'manage_network_users' ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
	wp_die( __( 'You do not have permission to access this page.' ), 403 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
function confirm_delete_users( $users ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
	$current_user = wp_get_current_user();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    21
	if ( ! is_array( $users ) || empty( $users ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
		return false;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    23
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
	<h2><?php esc_html_e( 'Users' ); ?></h2>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    26
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    27
	<?php if ( 1 == count( $users ) ) : ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    28
		<p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    29
	<?php else : ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    30
		<p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    31
	<?php endif; ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    32
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
	<form action="users.php?action=dodelete" method="post">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
	<input type="hidden" name="dodelete" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
	wp_nonce_field( 'ms-users-delete' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	$site_admins = get_super_admins();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    38
	$admin_out = '<option value="' . esc_attr( $current_user->ID ) . '">' . $current_user->user_login . '</option>'; ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    39
	<table class="form-table">
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    40
	<?php foreach ( ( $allusers = (array) $_POST['allusers'] ) as $user_id ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    41
		if ( $user_id != '' && $user_id != '0' ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    42
			$delete_user = get_userdata( $user_id );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    44
			if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
				wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    46
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
			if ( in_array( $delete_user->user_login, $site_admins ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    49
				wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ), '<em>' . $delete_user->user_login . '</em>' ) );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    50
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    51
			?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    52
			<tr>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    53
				<th scope="row"><?php echo $delete_user->user_login; ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    54
					<?php echo '<input type="hidden" name="user[]" value="' . esc_attr( $user_id ) . '" />' . "\n"; ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    55
				</th>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
			<?php $blogs = get_blogs_of_user( $user_id, true );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    58
			if ( ! empty( $blogs ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
				?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    60
				<td><fieldset><p><legend><?php printf(
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    61
					/* translators: user login */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    62
					__( 'What should be done with content owned by %s?' ),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    63
					'<em>' . $delete_user->user_login . '</em>'
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    64
				); ?></legend></p>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
				<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
				foreach ( (array) $blogs as $key => $details ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    67
					$blog_users = get_users( array( 'blog_id' => $details->userblog_id, 'fields' => array( 'ID', 'user_login' ) ) );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
					if ( is_array( $blog_users ) && !empty( $blog_users ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
						$user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    70
						$user_dropdown = '<label for="reassign_user" class="screen-reader-text">' . __( 'Select a user' ) . '</label>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    71
						$user_dropdown .= "<select name='blog[$user_id][$key]' id='reassign_user'>";
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
						$user_list = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
						foreach ( $blog_users as $user ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    74
							if ( ! in_array( $user->ID, $allusers ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
								$user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>";
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    76
							}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
						}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    78
						if ( '' == $user_list ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
							$user_list = $admin_out;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    80
						}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
						$user_dropdown .= $user_list;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
						$user_dropdown .= "</select>\n";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
						?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
						<ul style="list-style:none;">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
							<li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
							<li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="delete" checked="checked" />
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    87
							<?php _e( 'Delete all content.' ); ?></label></li>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
							<li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="reassign" />
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
							<?php echo __( 'Attribute all content to:' ) . "</label>\n" . $user_dropdown; ?></li>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
						</ul>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
						<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
				}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    94
				echo "</fieldset></td></tr>";
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    95
			} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    96
				?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    97
				<td><fieldset><p><legend><?php _e( 'User has no sites or content and will be deleted.' ); ?></legend></p>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    98
			<?php } ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    99
			</tr>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   100
		<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   104
	?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   105
	</table>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   106
	<?php
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   107
	/** This action is documented in wp-admin/users.php */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   108
	do_action( 'delete_user_form', $current_user );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   109
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   110
	if ( 1 == count( $users ) ) : ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   111
		<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   112
	<?php else : ?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   113
		<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   114
	<?php endif;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   115
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
	submit_button( __('Confirm Deletion'), 'delete' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
	</form>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   119
	<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
	return true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
if ( isset( $_GET['action'] ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   124
	/** This action is documented in wp-admin/network/edit.php */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   125
	do_action( 'wpmuadminedit' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
	switch ( $_GET['action'] ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
		case 'deleteuser':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
			if ( ! current_user_can( 'manage_network_users' ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   130
				wp_die( __( 'You do not have permission to access this page.' ), 403 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
			check_admin_referer( 'deleteuser' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
			$id = intval( $_GET['id'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
			if ( $id != '0' && $id != '1' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
				$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
				$title = __( 'Users' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
				$parent_file = 'users.php';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
				require_once( ABSPATH . 'wp-admin/admin-header.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
				echo '<div class="wrap">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
				confirm_delete_users( $_POST['allusers'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
				echo '</div>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   143
				require_once( ABSPATH . 'wp-admin/admin-footer.php' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   144
			} else {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
				wp_redirect( network_admin_url( 'users.php' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
			exit();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
		case 'allusers':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
			if ( !current_user_can( 'manage_network_users' ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   151
				wp_die( __( 'You do not have permission to access this page.' ), 403 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
			if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
				check_admin_referer( 'bulk-users-network' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
				$doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
				$userfunction = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   159
				foreach ( (array) $_POST['allusers'] as $user_id ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   160
					if ( !empty( $user_id ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
						switch ( $doaction ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
							case 'delete':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
								if ( ! current_user_can( 'delete_users' ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   164
									wp_die( __( 'You do not have permission to access this page.' ), 403 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
								$title = __( 'Users' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
								$parent_file = 'users.php';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
								require_once( ABSPATH . 'wp-admin/admin-header.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
								echo '<div class="wrap">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
								confirm_delete_users( $_POST['allusers'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
								echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
								require_once( ABSPATH . 'wp-admin/admin-footer.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
								exit();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
							case 'spam':
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   175
								$user = get_userdata( $user_id );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
								if ( is_super_admin( $user->ID ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
									wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
								$userfunction = 'all_spam';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   180
								$blogs = get_blogs_of_user( $user_id, true );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   181
								foreach ( (array) $blogs as $details ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
									if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
										update_blog_status( $details->userblog_id, 'spam', '1' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
								}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   185
								update_user_status( $user_id, 'spam', '1' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
							break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
							case 'notspam':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
								$userfunction = 'all_notspam';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   190
								$blogs = get_blogs_of_user( $user_id, true );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   191
								foreach ( (array) $blogs as $details )
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
									update_blog_status( $details->userblog_id, 'spam', '0' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   194
								update_user_status( $user_id, 'spam', '0' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
							break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
						}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
				wp_safe_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
			} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
				$location = network_admin_url( 'users.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
				if ( ! empty( $_REQUEST['paged'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
					$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
				wp_redirect( $location );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   208
			exit();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
		case 'dodelete':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
			check_admin_referer( 'ms-users-delete' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
			if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   213
				wp_die( __( 'You do not have permission to access this page.' ), 403 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
			if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
				foreach ( $_POST['blog'] as $id => $users ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
					foreach ( $users as $blogid => $user_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
						if ( ! current_user_can( 'delete_user', $id ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
							continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
						if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][$blogid][$id] )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
							remove_user_from_blog( $id, $blogid, $user_id );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
						else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   224
							remove_user_from_blog( $id, $blogid );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   225
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   226
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   227
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
			$i = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   229
			if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
				foreach( $_POST['user'] as $id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
					if ( ! current_user_can( 'delete_user', $id ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
						continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
					wpmu_delete_user( $id );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
					$i++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
			if ( $i == 1 )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
				$deletefunction = 'delete';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
			else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
				$deletefunction = 'all_delete';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
			wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
			exit();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   247
$wp_list_table = _get_list_table('WP_MS_Users_List_Table');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
$pagenum = $wp_list_table->get_pagenum();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   249
$wp_list_table->prepare_items();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   251
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
if ( $pagenum > $total_pages && $total_pages > 0 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   253
	wp_redirect( add_query_arg( 'paged', $total_pages ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
	exit;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
$title = __( 'Users' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
$parent_file = 'users.php';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   259
add_screen_option( 'per_page' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
	'id'      => 'overview',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   263
	'title'   => __('Overview'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
	'content' =>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
		'<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   266
		'<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to their Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' .
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
		'<p>' . __('You can also go to the user&#8217;s profile page by clicking on the individual username.') . '</p>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
		'<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>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
		'<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>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
		'<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>'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   272
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   273
get_current_screen()->set_help_sidebar(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   274
	'<p><strong>' . __('For more information:') . '</strong></p>' .
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   275
	'<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   276
	'<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   277
);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   278
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   279
require_once( ABSPATH . 'wp-admin/admin-header.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   280
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
	?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   283
	<div id="message" class="updated notice is-dismissible"><p>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   284
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   285
		switch ( $_REQUEST['action'] ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
			case 'delete':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
				_e( 'User deleted.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   288
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   289
			case 'all_spam':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   290
				_e( 'Users marked as spam.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   291
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   292
			case 'all_notspam':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   293
				_e( 'Users removed from spam.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   294
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   295
			case 'all_delete':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   296
				_e( 'Users deleted.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   297
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   298
			case 'add':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   299
				_e( 'User added.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   300
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   301
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   302
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   303
	</p></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
<div class="wrap">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
	<h2><?php esc_html_e( 'Users' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
	if ( current_user_can( 'create_users') ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
		<a href="<?php echo network_admin_url('user-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
	endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   312
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
	if ( !empty( $usersearch ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
	printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
	</h2>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   317
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
	<?php $wp_list_table->views(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   320
	<form method="get" class="search-form">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
		<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
	</form>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   324
	<form id="form-user-list" action="users.php?action=allusers" method="post">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
		<?php $wp_list_table->display(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
	</form>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
<?php require_once( ABSPATH . 'wp-admin/admin-footer.php' ); ?>