Allow only super admins to see plugins.php if the Plugins menu is not exposed. Props ocean90. fixes #13944

git-svn-id: https://develop.svn.wordpress.org/trunk@15271 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-06-17 15:57:02 +00:00
parent 509ea7fb71
commit 94efed64a0

View File

@ -8,6 +8,14 @@
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
if ( empty($menu_perms['plugins']) && ! is_super_admin() )
wp_die( __( 'Cheatin’ uh?' ) );
else if ( $menu_perms['plugins'] != 1 && is_super_admin() )
add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
}
if ( ! current_user_can( 'activate_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
@ -315,13 +323,6 @@ add_contextual_help($current_screen,
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( is_multisite() && is_super_admin() ) {
$menu_perms = get_site_option('menu_items', array());
if ( empty($menu_perms['plugins']) )
add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
unset($menu_perms);
}
$title = __('Plugins');
require_once('./admin-header.php');