Angsuman’s Authenticated – fix for 2.6.2
-
Like many others I had difficulty getting Angsuman’s Authenticated plugin working with WP 2.6. The following fix is working for me:
1. Replace the ALL OF THE CODE in ‘ac-authenticated.php’ with the following:
<?php
/*
Plugin Name: Angsuman’s Authenticated WordPress Plugin
Plugin URI: https://blog.taragana.com/index.php/archive/angsumans-authenticated-wordpress-plugin-password-protection-for-your-wordpress-blog/
Description: This plugin allows you to make your WordPress site accessible to logged in users only. In other words to view your site they have to create / have an account in your site and be logged in. No configuration necessary. Simply activating the plugin is all that is required from you.
Author: Angsuman Chakraborty, Taragana
Version: 1.0
Author URI: https://blog.taragana.com/
License: Free to use non-commercially.
Warranties: None.
*/
function ac_auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
global $user_ID;
if (!$user_ID)
{
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();
}
}if(‘wp-login.php’ != $pagenow && ‘wp-register.php’ != $pagenow) add_action(‘template_redirect’, ‘ac_auth_redirect’);
?>2. Make sure that your ‘login.php’ is the original from WP and not a hacked version.
- The topic ‘Angsuman’s Authenticated – fix for 2.6.2’ is closed to new replies.