���� JFIF �� �
"" $(4,$&1'-=-157:::#+?D?8C49:7
7%%77777777777777777777777777777777777777777777777777�� { �" �� �� 5 !1AQa"q�2��BR��#b������� �� �� ? ��D@DDD@DDD@DDkK��6 �UG�4V�1��
�����릟�@�#���RY�dqp�
����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Æ��ܯsO"B�c>;
�e�4��5�k��/CB��.
�J?��;�҈�������������������~�<�VZ�ê¼2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ
B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r�����
Ď0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�?
�0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA׾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC
PK ! s^ ^
site-info.phpnu [ add_help_tab( get_site_screen_help_tab_args() );
get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
$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 );
}
$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );
$is_main_site = is_main_site( $id );
if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
check_admin_referer( 'edit-site' );
switch_to_blog( $id );
// Rewrite rules can't be flushed during switch to blog.
delete_option( 'rewrite_rules' );
$blog_data = wp_unslash( $_POST['blog'] );
$blog_data['scheme'] = $parsed_scheme;
if ( $is_main_site ) {
// On the network's main site, don't allow the domain or path to change.
$blog_data['domain'] = $details->domain;
$blog_data['path'] = $details->path;
} else {
// For any other site, the scheme, domain, and path can all be changed. We first
// need to ensure a scheme has been provided, otherwise fallback to the existing.
$new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );
if ( ! $new_url_scheme ) {
$blog_data['url'] = esc_url( $parsed_scheme . '://' . $blog_data['url'] );
}
$update_parsed_url = parse_url( $blog_data['url'] );
// If a path is not provided, use the default of `/`.
if ( ! isset( $update_parsed_url['path'] ) ) {
$update_parsed_url['path'] = '/';
}
$blog_data['scheme'] = $update_parsed_url['scheme'];
// Make sure to not lose the port if it was provided.
$blog_data['domain'] = $update_parsed_url['host'];
if ( isset( $update_parsed_url['port'] ) ) {
$blog_data['domain'] .= ':' . $update_parsed_url['port'];
}
$blog_data['path'] = $update_parsed_url['path'];
}
$existing_details = get_site( $id );
$blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
foreach ( $blog_data_checkboxes as $c ) {
if ( ! in_array( (int) $existing_details->$c, array( 0, 1 ), true ) ) {
$blog_data[ $c ] = $existing_details->$c;
} else {
$blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
}
}
update_blog_details( $id, $blog_data );
// Maybe update home and siteurl options.
$new_details = get_site( $id );
$old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
$old_home_parsed = parse_url( $old_home_url );
$old_home_host = $old_home_parsed['host'] . ( isset( $old_home_parsed['port'] ) ? ':' . $old_home_parsed['port'] : '' );
if ( $old_home_host === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
$new_home_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'home', $new_home_url );
}
$old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );
$old_site_parsed = parse_url( $old_site_url );
$old_site_host = $old_site_parsed['host'] . ( isset( $old_site_parsed['port'] ) ? ':' . $old_site_parsed['port'] : '' );
if ( $old_site_host === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
$new_site_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'siteurl', $new_site_url );
}
restore_current_blog();
wp_redirect(
add_query_arg(
array(
'update' => 'updated',
'id' => $id,
),
'site-info.php'
)
);
exit;
}
if ( isset( $_GET['update'] ) ) {
$messages = array();
if ( 'updated' === $_GET['update'] ) {
$messages[] = __( 'Site info updated.' );
}
}
// 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';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
|
$id,
'selected' => 'site-info',
)
);
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
wp_admin_notice( $msg, $notice_args );
}
}
?>
add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'
' . __( 'Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.' ) . '
' .
'' . __( 'If a version update to core has not happened, clicking this button will not affect anything.' ) . '
' .
'' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '
',
)
);
get_current_screen()->set_help_sidebar(
'' . __( 'For more information:' ) . '
' .
'' . __( 'Documentation on Upgrade Network' ) . '
' .
'' . __( 'Support forums' ) . '
'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( ! current_user_can( 'upgrade_network' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
echo '';
echo '
' . __( 'Upgrade Network' ) . '
';
$action = isset( $_GET['action'] ) ? $_GET['action'] : 'show';
switch ( $action ) {
case 'upgrade':
$n = ( isset( $_GET['n'] ) ) ? (int) $_GET['n'] : 0;
if ( $n < 5 ) {
/**
* @global int $wp_db_version WordPress database version.
*/
global $wp_db_version;
update_site_option( 'wpmu_upgrade_site', $wp_db_version );
}
$site_ids = get_sites(
array(
'spam' => 0,
'deleted' => 0,
'archived' => 0,
'network_id' => get_current_network_id(),
'number' => 5,
'offset' => $n,
'fields' => 'ids',
'order' => 'DESC',
'orderby' => 'id',
'update_site_meta_cache' => false,
)
);
if ( empty( $site_ids ) ) {
echo '
' . __( 'All done!' ) . '
';
break;
}
echo '
';
foreach ( (array) $site_ids as $site_id ) {
switch_to_blog( $site_id );
$siteurl = site_url();
$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
restore_current_blog();
echo "- $siteurl
";
$response = wp_remote_get(
$upgrade_url,
array(
'timeout' => 120,
'httpversion' => '1.1',
'sslverify' => false,
)
);
if ( is_wp_error( $response ) ) {
wp_die(
sprintf(
/* translators: 1: Site URL, 2: Server error message. */
__( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ),
$siteurl,
'' . $response->get_error_message() . ''
)
);
}
/**
* Fires after the Multisite DB upgrade for each site is complete.
*
* @since MU (3.0.0)
*
* @param array $response The upgrade response array.
*/
do_action( 'after_mu_upgrade', $response );
/**
* Fires after each site has been upgraded.
*
* @since MU (3.0.0)
*
* @param int $site_id The Site ID.
*/
do_action( 'wpmu_upgrade_site', $site_id );
}
echo '
';
?>
PK ! .:/5 5 sites.phpnu [ get_pagenum();
// Used in the HTML title tag.
$title = __( 'Sites' );
$parent_file = 'sites.php';
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'' . __( 'Add New Site takes you to the screen for adding a new site to the network. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '
' .
'' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '
' .
'' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '
' .
'- ' . __( 'An Edit link to a separate Edit Site screen.' ) . '
' .
'- ' . __( 'Dashboard leads to the Dashboard for that site.' ) . '
' .
'- ' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '
' .
'- ' . __( 'Delete which is a permanent action after the confirmation screen.' ) . '
' .
'- ' . __( 'Visit to go to the front-end of the live site.' ) . '
',
)
);
get_current_screen()->set_help_sidebar(
'' . __( 'For more information:' ) . '
' .
'' . __( 'Documentation on Site Management' ) . '
' .
'' . __( 'Support forums' ) . '
'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_pagination' => __( 'Sites list navigation' ),
'heading_list' => __( 'Sites list' ),
)
);
$id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;
if ( isset( $_GET['action'] ) ) {
/** This action is documented in wp-admin/network/edit.php */
do_action( 'wpmuadminedit' );
// A list of valid actions and their associated messaging for confirmation output.
$manage_actions = array(
/* translators: %s: Site URL. */
'activateblog' => __( 'You are about to activate the site %s.' ),
/* translators: %s: Site URL. */
'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
/* translators: %s: Site URL. */
'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
/* translators: %s: Site URL. */
'archiveblog' => __( 'You are about to archive the site %s.' ),
/* translators: %s: Site URL. */
'unspamblog' => __( 'You are about to unspam the site %s.' ),
/* translators: %s: Site URL. */
'spamblog' => __( 'You are about to mark the site %s as spam.' ),
/* translators: %s: Site URL. */
'deleteblog' => __( 'You are about to delete the site %s.' ),
/* translators: %s: Site URL. */
'unmatureblog' => __( 'You are about to mark the site %s as mature.' ),
/* translators: %s: Site URL. */
'matureblog' => __( 'You are about to mark the site %s as not mature.' ),
);
if ( 'confirm' === $_GET['action'] ) {
// The action2 parameter contains the action being taken on the site.
$site_action = $_GET['action2'];
if ( ! array_key_exists( $site_action, $manage_actions ) ) {
wp_die( __( 'The requested action is not valid.' ) );
}
// The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility.
if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) {
check_admin_referer( 'confirm' );
} else {
check_admin_referer( $site_action . '_' . $id );
}
if ( ! headers_sent() ) {
nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' );
}
if ( is_main_site( $id ) ) {
wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
}
$site_details = get_site( $id );
$site_address = untrailingslashit( $site_details->domain . $site_details->path );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
403 ) );
}
$updated_action = 'not_deleted';
if ( 0 !== $id && ! is_main_site( $id ) && current_user_can( 'delete_site', $id ) ) {
wpmu_delete_blog( $id, true );
$updated_action = 'delete';
}
break;
case 'delete_sites':
check_admin_referer( 'ms-delete-sites' );
foreach ( (array) $_POST['site_ids'] as $site_id ) {
$site_id = (int) $site_id;
if ( is_main_site( $site_id ) ) {
continue;
}
if ( ! current_user_can( 'delete_site', $site_id ) ) {
$site = get_site( $site_id );
$site_address = untrailingslashit( $site->domain . $site->path );
wp_die(
sprintf(
/* translators: %s: Site URL. */
__( 'Sorry, you are not allowed to delete the site %s.' ),
$site_address
),
403
);
}
$updated_action = 'all_delete';
wpmu_delete_blog( $site_id, true );
}
break;
case 'allblogs':
if ( isset( $_POST['action'] ) && isset( $_POST['allblogs'] ) ) {
$doaction = $_POST['action'];
foreach ( (array) $_POST['allblogs'] as $site_id ) {
$site_id = (int) $site_id;
if ( 0 !== $site_id && ! is_main_site( $site_id ) ) {
switch ( $doaction ) {
case 'delete':
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $redirect_to );
exit;
}
} else {
// Process query defined by WP_MS_Site_List_Table::extra_table_nav().
$location = remove_query_arg(
array( '_wp_http_referer', '_wpnonce' ),
add_query_arg( $_POST, network_admin_url( 'sites.php' ) )
);
wp_redirect( $location );
exit;
}
break;
case 'archiveblog':
case 'unarchiveblog':
update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'activateblog':
update_blog_status( $id, 'deleted', '0' );
/**
* Fires after a network site is activated.
*
* @since MU (3.0.0)
*
* @param int $id The ID of the activated site.
*/
do_action( 'activate_blog', $id );
break;
case 'deactivateblog':
/**
* Fires before a network site is deactivated.
*
* @since MU (3.0.0)
*
* @param int $id The ID of the site being deactivated.
*/
do_action( 'deactivate_blog', $id );
update_blog_status( $id, 'deleted', '1' );
break;
case 'unspamblog':
case 'spamblog':
update_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'unmatureblog':
case 'matureblog':
update_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' );
break;
}
if ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) {
$updated_action = $_GET['action'];
}
if ( ! empty( $updated_action ) ) {
wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
exit;
}
}
$msg = '';
if ( isset( $_GET['updated'] ) ) {
$action = $_GET['updated'];
switch ( $action ) {
case 'all_notspam':
$msg = __( 'Sites removed from spam.' );
break;
case 'all_spam':
$msg = __( 'Sites marked as spam.' );
break;
case 'all_delete':
$msg = __( 'Sites deleted.' );
break;
case 'delete':
$msg = __( 'Site deleted.' );
break;
case 'not_deleted':
$msg = __( 'Sorry, you are not allowed to delete that site.' );
break;
case 'archiveblog':
$msg = __( 'Site archived.' );
break;
case 'unarchiveblog':
$msg = __( 'Site unarchived.' );
break;
case 'activateblog':
$msg = __( 'Site activated.' );
break;
case 'deactivateblog':
$msg = __( 'Site deactivated.' );
break;
case 'unspamblog':
$msg = __( 'Site removed from spam.' );
break;
case 'spamblog':
$msg = __( 'Site marked as spam.' );
break;
default:
/**
* Filters a specific, non-default, site-updated message in the Network admin.
*
* The dynamic portion of the hook name, `$action`, refers to the non-default
* site update action.
*
* @since 3.1.0
*
* @param string $msg The update message. Default 'Settings saved'.
*/
$msg = apply_filters( "network_sites_updated_message_{$action}", __( 'Settings saved.' ) );
break;
}
if ( ! empty( $msg ) ) {
$msg = wp_get_admin_notice(
$msg,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
}
$wp_list_table->prepare_items();
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
'
' . esc_html( $s ) . ''
);
echo '';
}
?>
views(); ?>
PK ! w,
user-edit.phpnu [ add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'' . __( 'Add User will set up a new user account on the network and send that person an email with username and password.' ) . '
' .
'' . __( 'Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.' ) . '
',
)
);
get_current_screen()->set_help_sidebar(
'' . __( 'For more information:' ) . '
' .
'' . __( 'Documentation on Network Users' ) . '
' .
'' . __( 'Support forums' ) . '
'
);
if ( isset( $_REQUEST['action'] ) && 'add-user' === $_REQUEST['action'] ) {
check_admin_referer( 'add-user', '_wpnonce_add-user' );
if ( ! current_user_can( 'manage_network_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
if ( ! is_array( $_POST['user'] ) ) {
wp_die( __( 'Cannot create an empty user.' ) );
}
$user = wp_unslash( $_POST['user'] );
$user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
$add_user_errors = $user_details['errors'];
} else {
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, sanitize_email( $user['email'] ) );
if ( ! $user_id ) {
$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
} else {
/**
* Fires after a new user has been created via the network user-new.php page.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
*/
do_action( 'network_user_new_created_user', $user_id );
wp_redirect(
add_query_arg(
array(
'update' => 'added',
'user_id' => $user_id,
),
'user-new.php'
)
);
exit;
}
}
}
$message = '';
if ( isset( $_GET['update'] ) ) {
if ( 'added' === $_GET['update'] ) {
$edit_link = '';
if ( isset( $_GET['user_id'] ) ) {
$user_id_new = absint( $_GET['user_id'] );
if ( $user_id_new ) {
$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );
}
}
$message = __( 'User added.' );
if ( $edit_link ) {
$message .= sprintf( ' %s', $edit_link, __( 'Edit user' ) );
}
}
}
// Used in the HTML title tag.
$title = __( 'Add New User' );
$parent_file = 'users.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
'success',
'dismissible' => true,
'id' => 'message',
)
);
}
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
$error_messages = '';
foreach ( $add_user_errors->get_error_messages() as $error ) {
$error_messages .= "
$error
";
}
wp_admin_notice(
$error_messages,
array(
'type' => 'error',
'dismissible' => true,
'id' => 'message',
'paragraph_wrap' => false,
)
);
}
?>
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(
'' . __( 'Something went wrong.' ) . '
' .
'' . __( 'One of the selected users is not a member of this site.' ) . '
',
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';
?>
|
$id,
'selected' => 'site-users',
)
);
if ( isset( $_GET['update'] ) ) :
$message = '';
$type = 'error';
switch ( $_GET['update'] ) {
case 'adduser':
$type = 'success';
$message = __( 'User added.' );
break;
case 'err_add_member':
$message = __( 'User is already a member of this site.' );
break;
case 'err_add_fail':
$message = __( 'User could not be added to this site.' );
break;
case 'err_add_notfound':
$message = __( 'Enter the username of an existing user.' );
break;
case 'promote':
$type = 'success';
$message = __( 'Changed roles.' );
break;
case 'err_promote':
$message = __( 'Select a user to change role.' );
break;
case 'remove':
$type = 'success';
$message = __( 'User removed from this site.' );
break;
case 'err_remove':
$message = __( 'Select a user to remove.' );
break;
case 'newuser':
$type = 'success';
$message = __( 'User created.' );
break;
case 'err_new':
$message = __( 'Enter the username and email.' );
break;
case 'err_new_dup':
$message = __( 'Duplicated username or email address.' );
break;
}
wp_admin_notice(
$message,
array(
'type' => $type,
'dismissible' => true,
'id' => 'message',
)
);
endif;
?>
views(); ?>
add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '
' .
'' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '
',
)
);
get_current_screen()->set_help_sidebar(
'' . __( 'For more information:' ) . '
' .
'' . __( 'Documentation on Site Management' ) . '
' .
'' . __( 'Support forums' ) . '
'
);
if ( isset( $_REQUEST['action'] ) && 'add-site' === $_REQUEST['action'] ) {
check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
if ( ! is_array( $_POST['blog'] ) ) {
wp_die( __( 'Cannot create an empty site.' ) );
}
$blog = $_POST['blog'];
$domain = '';
$blog['domain'] = trim( $blog['domain'] );
if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
$domain = strtolower( $blog['domain'] );
}
// If not a subdomain installation, make sure the domain isn't a reserved word.
if ( ! is_subdomain_install() ) {
$subdirectory_reserved_names = get_subdirectory_reserved_names();
if ( in_array( $domain, $subdirectory_reserved_names, true ) ) {
wp_die(
sprintf(
/* translators: %s: Reserved names list. */
__( 'The following words are reserved for use by WordPress functions and cannot be used as site names: %s' ),
'' . implode( '
, ', $subdirectory_reserved_names ) . '
'
)
);
}
}
$title = $blog['title'];
$meta = array(
'public' => 1,
);
// Handle translation installation for the new site.
if ( isset( $_POST['WPLANG'] ) ) {
if ( '' === $_POST['WPLANG'] ) {
$meta['WPLANG'] = ''; // en_US
} elseif ( in_array( $_POST['WPLANG'], get_available_languages(), true ) ) {
$meta['WPLANG'] = $_POST['WPLANG'];
} elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
if ( $language ) {
$meta['WPLANG'] = $language;
}
}
}
if ( empty( $title ) ) {
wp_die( __( 'Missing site title.' ) );
}
if ( empty( $domain ) ) {
wp_die( __( 'Missing or invalid site address.' ) );
}
if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
wp_die( __( 'Missing email address.' ) );
}
$email = sanitize_email( $blog['email'] );
if ( ! is_email( $email ) ) {
wp_die( __( 'Invalid email address.' ) );
}
if ( is_subdomain_install() ) {
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain );
$path = get_network()->path;
} else {
$newdomain = get_network()->domain;
$path = get_network()->path . $domain . '/';
}
$password = 'N/A';
$user_id = email_exists( $email );
if ( ! $user_id ) { // Create a new user with a random password.
/**
* Fires immediately before a new user is created via the network site-new.php page.
*
* @since 4.5.0
*
* @param string $email Email of the non-existent user.
*/
do_action( 'pre_network_site_new_created_user', $email );
$user_id = username_exists( $domain );
if ( $user_id ) {
wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
}
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false === $user_id ) {
wp_die( __( 'There was an error creating the user.' ) );
}
/**
* Fires after a new user has been created via the network site-new.php page.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
*/
do_action( 'network_site_new_created_user', $user_id );
}
$wpdb->hide_errors();
$id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );
$wpdb->show_errors();
if ( ! is_wp_error( $id ) ) {
if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {
update_user_option( $user_id, 'primary_blog', $id, true );
}
wpmu_new_site_admin_notification( $id, $user_id );
wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
wp_redirect(
add_query_arg(
array(
'update' => 'added',
'id' => $id,
),
'site-new.php'
)
);
exit;
} else {
wp_die( $id->get_error_message() );
}
}
if ( isset( $_GET['update'] ) ) {
$messages = array();
if ( 'added' === $_GET['update'] ) {
$messages[] = sprintf(
/* translators: 1: Dashboard URL, 2: Network admin edit URL. */
__( 'Site added. Visit Dashboard or Edit Site' ),
esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
);
}
}
// Used in the HTML title tag.
$title = __( 'Add New Site' );
$parent_file = 'sites.php';
wp_enqueue_script( 'user-suggest' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
wp_admin_notice( $msg, $notice_args );
}
}
?>
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 themes list' ),
'heading_pagination' => __( 'Site themes list navigation' ),
'heading_list' => __( 'Site themes list' ),
)
);
$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
$action = $wp_list_table->current_action();
$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$temp_args = array( 'enabled', 'disabled', 'error' );
$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
$referer = remove_query_arg( $temp_args, 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.' ) );
}
$wp_list_table->prepare_items();
$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 );
if ( $action ) {
switch_to_blog( $id );
$allowed_themes = get_option( 'allowedthemes' );
switch ( $action ) {
case 'enable':
check_admin_referer( 'enable-theme_' . $_GET['theme'] );
$theme = $_GET['theme'];
$action = 'enabled';
$n = 1;
if ( ! $allowed_themes ) {
$allowed_themes = array( $theme => true );
} else {
$allowed_themes[ $theme ] = true;
}
break;
case 'disable':
check_admin_referer( 'disable-theme_' . $_GET['theme'] );
$theme = $_GET['theme'];
$action = 'disabled';
$n = 1;
if ( ! $allowed_themes ) {
$allowed_themes = array();
} else {
unset( $allowed_themes[ $theme ] );
}
break;
case 'enable-selected':
check_admin_referer( 'bulk-themes' );
if ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
$action = 'enabled';
$n = count( $themes );
foreach ( (array) $themes as $theme ) {
$allowed_themes[ $theme ] = true;
}
} else {
$action = 'error';
$n = 'none';
}
break;
case 'disable-selected':
check_admin_referer( 'bulk-themes' );
if ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
$action = 'disabled';
$n = count( $themes );
foreach ( (array) $themes as $theme ) {
unset( $allowed_themes[ $theme ] );
}
} else {
$action = 'error';
$n = 'none';
}
break;
default:
if ( isset( $_POST['checked'] ) ) {
check_admin_referer( 'bulk-themes' );
$themes = (array) $_POST['checked'];
$n = count( $themes );
$screen = get_current_screen()->id;
/**
* Fires when a custom bulk action should be handled.
*
* The redirect link should be modified with success or failure feedback
* from the action to be used to display feedback to the user.
*
* The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
*
* @since 4.7.0
*
* @param string $redirect_url The redirect URL.
* @param string $action The action being taken.
* @param array $items The items to take the action on.
* @param int $site_id The site ID.
*/
$referer = apply_filters( "handle_network_bulk_actions-{$screen}", $referer, $action, $themes, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
} else {
$action = 'error';
$n = 'none';
}
}
update_option( 'allowedthemes', $allowed_themes );
restore_current_blog();
wp_safe_redirect(
add_query_arg(
array(
'id' => $id,
$action => $n,
),
$referer
)
);
exit;
}
if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit;
}
add_thickbox();
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';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
|
$id,
'selected' => 'site-themes',
)
);
if ( isset( $_GET['enabled'] ) ) {
$enabled = absint( $_GET['enabled'] );
if ( 1 === $enabled ) {
$message = __( 'Theme enabled.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
}
wp_admin_notice(
sprintf( $message, number_format_i18n( $enabled ) ),
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
} elseif ( isset( $_GET['disabled'] ) ) {
$disabled = absint( $_GET['disabled'] );
if ( 1 === $disabled ) {
$message = __( 'Theme disabled.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
}
wp_admin_notice(
sprintf( $message, number_format_i18n( $disabled ) ),
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
wp_admin_notice(
__( 'No theme selected.' ),
array(
'type' => 'error',
'dismissible' => true,
'id' => 'message',
)
);
}
?>
views(); ?>
PK ! about.phpnu [