summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-inst/wp-admin/menu.php')
-rw-r--r--wp-inst/wp-admin/menu.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/wp-inst/wp-admin/menu.php b/wp-inst/wp-admin/menu.php
index 120651f..526181c 100644
--- a/wp-inst/wp-admin/menu.php
+++ b/wp-inst/wp-admin/menu.php
@@ -77,6 +77,12 @@ do_action('admin_menu', '');
ksort($menu); // make it all pretty
if (! user_can_access_admin_page()) {
+ // find the blog of this user first
+ $primary_blog = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '$user_ID' AND meta_key = 'primary_blog'" );
+ if( $primary_blog ) {
+ header( "Location: " . get_blog_option( $primary_blog, "siteurl" ) . "wp-admin/" );
+ exit;
+ }
die( __('You do not have sufficient permissions to access this page.') );
}