The MU forums have moved to WordPress.org

Login page problem... solution: get_blog_option() BROKEN (8 posts)

  1. mrball
    Member
    Posted 17 years ago #

    For those who are experiencing infinite loop problems when logging in as users other than admin from main url (e.g. http://lah.cc/wp-login.php as opposed to http://jason.lah.cc/wp-login.php) It is due to the function get_blog_option() being broken. This would break any other functionality than depends on it as well (have not checked that out yet)

    solution:
    find:
    function get_blog_option( $id, $key, $default='na' ) {
    global $wpdb, $wpmuBaseTablePrefix, $blog_id;

    add this line just below:
    $GLOBALS['switched']=true;

    The login is still problematic though - no easy way for user to 'sign out' from main page, thus it will keep redirecting user to user's blog's login page when they click on 'login' on main page!

  2. samchng
    Member
    Posted 17 years ago #

    Thanks mrball, but what does that line actually do?
    Does it solve the "two tries" in order to login bug?

    By adding this line, how does it solve the problem? Thanks.

  3. mrball
    Member
    Posted 17 years ago #

    sam: when user logs in from main page, get_blog_option is called to find the url of the user's blog to redirect to. unfortunately, it is pulling the url of the main page as it checks its query cache. setting $GLOBALS['switched']=true stops it from doing that.

  4. samchng
    Member
    Posted 17 years ago #

    Using this, what login form you are using on your main page? I am using this.

    <form name="loginform" id="loginform" method="post">
    <div><label>Username:
    </label><input type="text" name="log" id="log" value="" size="5" tabindex="1" />

    <label>Password:
    </label><input type="password" name="pwd" id="pwd" value="" size="5" tabindex="2" />

    <input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" /><small>Remember me</small>
    <input type="hidden" name="redirect_to" value="wp-admin/" />
    <input type="submit" name="submit" id="submit" value=" Login » " onClick="return ActionURL(loginform);"/></div>

  5. MazZziKa
    Member
    Posted 17 years ago #

    i try to register in ur blog system but the activation fail :S
    http://zika.lah.ccbase/wp-activate.php?key=09f78baf66699af2 give me Server not found

    i have the same problem in my blog .. can any one help?

  6. mrball
    Member
    Posted 17 years ago #

    argh broken broken broken, silly me why did I upgrade? :)

    mazzz: edit wp-config.php, and change $base = 'BASE'; to $base = '/';

  7. MazZziKa
    Member
    Posted 17 years ago #

    mrball not fixed :s

  8. mrball
    Member
    Posted 17 years ago #

    mazz: did u try registering a new user and blog?

About this Topic