WordPress.org

Make WordPress Core

Changeset 12764


Ignore:
Timestamp:
01/19/2010 06:11:33 PM (12 years ago)
Author:
ryan
Message:

Remove disable_some_pages(). Rely on cap checks. fixes #11770

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r12752 r12764  
    10871087}
    10881088
    1089 function disable_some_pages() {
    1090     global $messages;
    1091 
    1092     if ( strpos( $_SERVER['PHP_SELF'], 'user-new.php' ) && !get_site_option( 'add_new_users' ) ) {
    1093         if ( is_super_admin() ) {
    1094             $messages[] = '<div id="message" class="updated fade"><p>' . __( 'Warning! Only site administrators may see this page. Everyone else will see a <em>page disabled</em> message. Enable it again on <a href="ms-options.php#addnewusers">the options page</a>.' ) . '</p></div>';
    1095         } else {
    1096             wp_die( __('Page disabled by the administrator') );
    1097         }
    1098     }
    1099 
    1100     $pages = array( 'theme-editor.php', 'plugin-editor.php' );
    1101     foreach( $pages as $page ) {
    1102         if ( strpos( $_SERVER['PHP_SELF'], $page ) ) {
    1103             wp_die( __('Page disabled by the administrator') );
    1104         }
    1105     }
    1106 
    1107     $pages = array( 'theme-install.php', 'plugin-install.php' );
    1108     foreach( $pages as $page ) {
    1109         if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_super_admin() ) {
    1110             wp_die( __( "Sorry, you're not allowed here." ) );
    1111         }
    1112     }
    1113 
    1114 }
    1115 add_action( 'admin_init', 'disable_some_pages' );
    1116 
    11171089function blogs_listing_post() {
    11181090    if ( !isset( $_POST[ 'action' ] ) ) {
  • trunk/wp-admin/user-new.php

    r12752 r12764  
    1212if ( !current_user_can('create_users') )
    1313    wp_die(__('Cheatin&#8217; uh?'));
     14
     15if ( is_multisite() && !get_site_option( 'add_new_users' ) )
     16    wp_die( __('Page disabled by the administrator') );
    1417
    1518/** WordPress Registration API */
Note: See TracChangeset for help on using the changeset viewer.