I have installed a muwp-1.0rc2 on my server, and i havn't use vhost. I just found the registed user can not login from /wp-login.php page. But they can login from from their blog username/wp-login.php page.
Anyone found the same problem?
I have installed a muwp-1.0rc2 on my server, and i havn't use vhost. I just found the registed user can not login from /wp-login.php page. But they can login from from their blog username/wp-login.php page.
Anyone found the same problem?
What error message do you get when you try to login to the main blog?
The page isn't redirecting properly.
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
I use firefox got this message.
The user is sign in actually.
That's good to visite their own blog's admin pages.
The problem is the user can not visite the other blog admin pages. If so, it will get that error.
This code is right at the end of wp-admin/menu.php:
if( $primary_blog ) {
header( "Location: " . get_blog_option( $primary_blog, "siteurl" ) . "/wp-admin/" );
exit;
}
You need to debug that by adding the following code before the header() command, but inside the if() { } condition:
print "$primary_blog: " . get_blog_option( $primary_blog, "siteurl" )."
";
die();
This should print out enough information for you to figure out where it's trying to redirect the browser.
I have tried that, the result is:
3: http://weblog.taglife.net
And is that the right blog for the user you were trying to login as?
Don't right.
I just found the problem.
To solve it, modify the get_blog_option function in wpmu-functions.php from:
function get_blog_option( $id, $key, $default='na' ) {
global $wpdb, $wpmuBaseTablePrefix, $blog_id;
$current_blog_id = $blog_id;
$current_options_table = $wpdb->options;
$wpdb->options = $wpmuBaseTablePrefix . $id . "_options";
$blog_id = $id;
$opt = get_option( $key );
$blog_id = $current_blog_id;
$wpdb->options = $current_options_table;
return $opt;
}
to:
function get_blog_option( $id, $key, $default='na' ) {
global $wpdb, $wpmuBaseTablePrefix, $blog_id, $switched;
$current_blog_id = $blog_id;
$current_options_table = $wpdb->options;
$wpdb->options = $wpmuBaseTablePrefix . $id . "_options";
$blog_id = $id;
if ($id != $current_blog_id)
$switched = true;
$opt = get_option( $key );
$blog_id = $current_blog_id;
$wpdb->options = $current_options_table;
return $opt;
}
It works now!
That change bypasses the WP cache when using get_option() (or get_settings()). As this has hit a few users I have added it to SVN. Thanks for reminding me of the mod!
So is "switched" suppose to be there?
Someone suggested it ages ago but I never saw the problem you and they were seeing and I forgot to look at it.
The only side effect of it is a slight performance hit but since get_blog_option() isn't called for normal page views it shouldn't be too bad.
I have the same problem.
I made the suggested changes but it still doesn't works.
Could anybody help me please!
Thank's