Follow-up:
I believe this to be related to a plugin called Angsuman’s Authenticated WordPress Plugin, which should ensure that only logged in users are allowed in. Even though the code looks simple, I have no way of knowing exactly what in it is causing this on the new version.
The whole code is basically this
function ac_auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
if ( (!empty($_COOKIE[USER_COOKIE]) &&
!wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true)) ||
(empty($_COOKIE[USER_COOKIE])) ) {
nocache_headers();
header("HTTP/1.1 302 Moved Temporarily");
header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
header("Status: 302 Moved Temporarily");
exit();
}
}
Follow-up 2:
I just tested with another plugin called “Authenticate” and this one also has the same effect. Both plugins are not specified to support versions over 2.5, but since I can’t seem to find any 2.7 compatible plugin for this, I would really like to find out what the cause of this is.
“Authenticate” has a slightly different code than the previous one
//If the current page isn't 'wp-login.php' or 'wp-register.php' redirect
if ((strpos($_SERVER['PHP_SELF'], 'wp-login.php') === false) && (strpos($_SERVER['PHP_SELF'], 'wp-register.php') === false)) {
auth_redirect();
}
Please, help!
WordPress 2.7 uses new Login cookies, So any plugins written for previous versions will not work (Which rely on the old login methods)
What exactly does the plugin do? Only logged in users are allowed to view the administration console, I guess the plugins attempt to prevent any non-logged in users from viewing the entire site?
@dd32: plugin is supposed to ensure that only registered and logged in users can view the content on the site. It has nothing to do with the admin console. If there are any other ways/plugins that can do this on 2.7 I would gladly try that, otherwise can you please tell me what any of the code snippets above should do differently to make this work with the new cookies?
Thanks
Ah.
This code sniplet in my themes functions.php file seems to do the trick:
if ( !is_user_logged_in() && (strpos($_SERVER['PHP_SELF'], 'wp-login.php') === false) && (strpos($_SERVER['PHP_SELF'], 'wp-register.php') ===
false)) {
auth_redirect();
}
Thanks, dd32! Problem solved.