benötige dringend eure hilfe!
ich verwende bei einer seite die aktuelle wordpress version 2.5.1 de edtion und das oben stehende plugin version 1.0
leider verträgt sich das plugin nicht mit der wordpress version.
der code des plugins ist nicht besonders groß, aber da ich kein php genie bin komme ich mit dem was dort steht nicht wirklich gut klar und bräucht hilfe.
PHP
<?php
/*
Plugin Name: Angsuman's Authenticated WordPress Plugin
Plugin URI: http://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: http://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
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();
}
}
if('wp-login.php' != $pagenow && 'wp-register.php' != $pagenow) add_action('template_redirect', 'ac_auth_redirect');
?>
Alles anzeigen