The MU forums have moved to WordPress.org

admin login always redirected to login (20 posts)

  1. rhood
    Member
    Posted 17 years ago #

    I have wpmu 1.2.3, apache 2.0.55, php 5.1.2 and mysql 5.0.22 running on ubuntu. VHOST is false (domain engserv01, path: /blog/, subdirectory option) Logging is enabled but no php or mysql errors are reported. The values of wp_blogs, wp_users and wp_site in wp-config.php are correct. The domain & path values are correct in wp_blogs and wp_site tables.

    Posts that discuss similar problems (712, 788, 906, 3946, 5670) have not helped me. I have installed multiple times, tried subdomains and played with various values of the host name. Cookies are enabled and many have been created by phpMyAdmin but none by wordpress.

    I put debuging statements in wpmu-settings.php, wp-login.php and wp-plugin.php. This is my first experience with php so I'm a fairly clueless. However, it looks like wp-login.php is entered twice. The first time it gets to the switch statement on line 72 $action is empty the second time it contains "auth". I chased it down a little farther but I don't feel any closer to enlightment. I'm hoping someone will be able to put their finger on the problem given what I have so far.

    This is some of the code I modified in wp-login.php.

    case 'auth' :
    error_log("------------case auth: cookie: $_COOKIE"); // DEBUG
    $_COOKIE = array(); // Prevent redirect loops caused by corrupted cookies

    case 'login' :
    default:
    error_log('------------case login'); // DEBUG
    $user_login = '';
    $user_pass = '';
    $using_cookie = FALSE;

    if ( isset( $_REQUEST['redirect_to'] )) { // DEBUG
    error_log('----------------true: isset($_REQUEST[redirect_to])'); // DEBUG
    } else { // DEBUG
    error_log('----------------false: isset($_REQUEST[redirect_to])'); // DEBUG
    } // DEBUG
    if ( is_user_logged_in() ) { // DEBUG
    error_log("----------------is logged in"); // DEBUG
    } else { // DEBUG
    error_log("----------------not logged in"); // DEBUG
    } // DEBUG

    if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() )
    $redirect_to = 'wp-admin/';
    else
    $redirect_to = $_REQUEST['redirect_to'];

    error_log("--------------------new redirect: $redirect_to"); // DEBUG

    if ( $_POST ) {
    $user_login = $_POST['log'];
    $user_login = sanitize_user( $user_login );
    $user_pass = $_POST['pwd'];
    $rememberme = $_POST['rememberme'];
    error_log('----------------POST'); // DEBUG
    error_log("--------------------user $user_login"); // DEBUG
    error_log("--------------------pw $user_pass"); // DEBUG
    } else {
    error_log('----------------NOT POST'); // DEBUG
    $cookie_login = wp_get_cookie_login();
    if ( ! empty($cookie_login) ) {
    $using_cookie = true;
    $user_login = $cookie_login['login'];
    $user_pass = $cookie_login['password'];
    error_log("--------------------user $user_login"); // DEBUG
    error_log("--------------------pw $user_pass"); // DEBUG
    }
    }

    do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass));

    Here's output from the log. In addition to the above there are similar changes that should be fairly self evident from the results below (do_action_ref_array is in plugin.php). To make it readable I have removed [Wed Aug 01 15:32:35 2007] [error] [client 10.0.1.125] from the beginning of every line and referer: http://engserv01/blog/wp-login.php?action=auth&redirect_to=%2Fblog%2Fwp-admin%2F from the end of every line.

    --------in wp-login.php,
    ------------wp-login.php::switch action is ,
    ------------case login,
    ----------------true: isset($_REQUEST[redirect_to]),
    ----------------not logged in,
    --------------------new redirect: /blog/wp-admin/,
    ----------------POST,
    --------------------user admin,
    --------------------pw d1b5dc976a62,

    ------------in do_action_ref_array with,
    ----------------tag wp_authenticate and,
    ----------------args Array,
    --------------------filter ,
    --------------------isset: ,

    --------in wp-login.php,
    ------------wp-login.php::switch action is auth,
    ------------case auth: cookie: Array,
    ------------case login,
    ----------------true: isset($_REQUEST[redirect_to]),
    ----------------not logged in,
    --------------------new redirect: /blog/wp-admin/,
    ----------------NOT POST,

    ------------in do_action_ref_array with,
    ----------------tag wp_authenticate and,
    ----------------args Array,
    --------------------filter ,
    --------------------isset: ,
    ------------in wp-login::login_header(),

    Any help would be greatly appreciated

    Rick

  2. rhood
    Member
    Posted 17 years ago #

    Oh, and FWIW, when I try the admin login with an incorrect password, it tells me so but when I use the correct password I just get the same screen back. The only difference between IE7 and Firefox2 is that Firefox fills in the user name and pw fields on the return screen and IE doesn't.

  3. drmiketemp
    Member
    Posted 17 years ago #

    OK, I'm lost. So is this a problem or are you trying to do something or are you asking something or what? I have no clue if you're aksing something here or what you;re trying to ask.

  4. rhood
    Member
    Posted 17 years ago #

    Thanks for taking a look. The basic question is how do I fix this? In brief, when I try to log in as admin I'm redirected back to the login form. No dashboard.

  5. rhood
    Member
    Posted 17 years ago #

    I seem to have gotten off on the wrong foot entirely, so let me try again, please.

    I installed wpmu and received my admin password. However, when I try to log in as the admin user, I wind up back at the login screen. (Something similar happens if I try to create a new blog: I always wind up at the screen with the red background behind my username and email address.)

    I see from a number of earlier posts that the login problem is a fairly common occurrence though, it seems, one with a variety of solutions. I tried the approaches listed in a number of posts without success. I also tried a little debugging to see if I could learn anything on my own. No luck so far. I'm hoping someone would make a suggestion or ask a question that would set me on the right path.

  6. lyons
    Member
    Posted 17 years ago #

    I get this issue too. Has anyone managed to resolve it?

  7. lyons
    Member
    Posted 17 years ago #

    The solution is to reinstall with a qualifed domain. Using engserv01 won't work engserv01.com, or similiar, will. I have since found posts about installing to localhost where MU presents an warning message saying you must use localhost.localdomain . It is a shame it doesn't give the same warning when using named servers in the same way as it causes the same issues.

  8. qoncept
    Member
    Posted 17 years ago #

    I'm using a qualified domain on my webserver and still having this problem. Very frustrating and it's time sensitive so I'm losing visitors right now. :( Any input?

    Edit: I've tried with IE 7.0.5730 and FireFox 2.0.0.6 with identical results. Tried deleting all temporary internet files and cookies in both.

  9. flocsy
    Member
    Posted 17 years ago #

    I have the same problem. I've made some further tests:

    0. Just downloaded, installed wordpress-mu 1.2.5a to an empty directory, empty db.
    1. My hostname name is: exodus, the blog in not in the root dir (http://exodus/~xyz/wordpress-mu/)
    2. The blog was created to use directories, not subdomains.
    3. The only way I'm able to log in is from Konqueror.
    4. Firefox, IE drops me back to the login screen.
    5. The same results for both "admin" and a "user" (was created by the "create a new blog link)
    6. With Firefox I tried it from Linux and XP, also deleted Firefox's cashed things, and restarted it (sometimes it has problems of this kind) But didn't help.

    So conclusions:
    1. The problem is not the hostname (it works from Konqueror)
    2. The problem is not for admin only (also for regular user)
    3. The problem is probably not a Firefox bug, 'cause it works for everything else fine.

    Any idea? How to make it useable for 99.9% of the world's polulation (non-Konqueror users) ?

  10. andrea_r
    Moderator
    Posted 17 years ago #

    check trac, see if it's a bug and if it got fixed.
    http://trac.mu.wordpress.org/

    Sometimes there are buggy versions on the official download page.

  11. pc1oad1etter
    Member
    Posted 16 years ago #

    Did anyone come up with a fix for this? When I try to switch from one blog to another (from the top left menu title/button) I get prompted for a login which goes nowhere
    here is the url, with the names changed to protect the innocent:

    http://subdomain.domain.com/blogdirectory/wp-login.php?action=auth&redirect_to=%2Fblogdirectory%2Fwp-admin%2F

  12. hieuletrung
    Member
    Posted 16 years ago #

    Hi, it is because of the WordPress only allows full qualified domain.

    For example:
    http://test-server.com/blogs/index.php
    Instead of
    http://test-server/blogs/index.php (DOES NOT WORK)

  13. llamaman
    Member
    Posted 16 years ago #

    I was having this problem, and solved it in the following manner:

    My domain was set up to add "www." before the domain name (i.e. when I typed http://mydomain.com in the browser, it showed up as http://www.mydomain.com). When I switched that off, it solved my login issue.

    I hope that helps!

  14. atarom
    Member
    Posted 16 years ago #

    After installing a second blog I ran into the same problem and ended up finding that somehow siteurl in my MySQL database for my first blog had been changed to the same URL as my second blog. changing it back fixed the problem.

  15. DragonFlyEye
    Member
    Posted 16 years ago #

    Since updating to the new 2.6 beta 1, I seem to be having a similar issue. Has anyone else found this issue cropping up since upgrading?

  16. Newtidbitz
    Member
    Posted 15 years ago #

    As llamaman has said, removing the 301 redirect works. Mine was in my .htaccess file.

    The problem is that removing that 301 redirect will cause canonical issues, that's why I put it there in the first place.

    I have tried all sorts of solutions given in the forums here, like clearing cookies, using different browsers etc., but nothing works, except removing the 301 redirect in my .htaccess file.

    My blog is installed in a sub directory, so is there anyway to get it to work and keeping the 301 redirect from domain.com to http://www.domain.com?

    Should I add another rewrite rule in my .htaccess file?

  17. VentureMaker
    Member
    Posted 15 years ago #

  18. maxbirkoff
    Member
    Posted 15 years ago #

    i fixed this problem by noting that i had the following line in php.ini:

    variables_order = "GPS"

    when in fact the line ought to have read

    variables_order = "GPCS"
    variables_order = "EGPCS"

    this is apparently because the php-style in which wordpress-mu is written depends on variables being propagated through the environment and/or cookies.

    once i changed this setting the login loop
    ended and i was able to see a different page after logging in.

  19. joedonahue.org
    Member
    Posted 15 years ago #

    I am not able to update php.ini.
    However, I did add "php_flag register_globals on" to my .htaccess file, with no success. I am using Wordpress Mu 2.7 and am having this login redirect loop error.

  20. SteveAtty
    Member
    Posted 15 years ago #

    You can't put it in your .htaccess file unless your apache configuration allows you to override things like that.

About this Topic