Pogledajte određenu poruku
Staro 20. 02. 2008.   #1
andrej
profesionalac
Qualified
 
Avatar andrej
 
Datum učlanjenja: 05.06.2005
Lokacija: Beograd
Poruke: 131
Hvala: 2
7 "Hvala" u 4 poruka
andrej is on a distinguished road
Pošaljite poruku preko MSN za andrej
Default Wordpress i Authenticate plugin

Pozz,

prvo, u opcijama mi stoji ovako

WordPress address (URL): http://domain.com/wordpress
Blog address (URL): http://domain.com

i kada pristupim na http://www.domain.com wp sam prebaci na http://domain.com sto je ok, valjda (?)..

stavio sam ovaj dole plugin, da bi omogucio samo za registrovane korisnike, medjutim kada idem na http://www.domain.com nakon login-a redirektuje me na http://domain.com/wordpress/wp-admin/index.php , dok je sa http://domain.com OK, pokaze mi blog odmah.

Ima li neko ideju sta ne valja, tj. kako da dobijem blog preko www.domain.com?

Kôd:
<?php
/**
 * Plugin Name: Authenticate
 * Plugin URI: http://xavisys.com/wordpress-authentication-plugin/
 * Description: Instantly requires that users be logged in to visit your site. Also serves as a good base for expansion. No interface, just activate and go!
 * Author: Aaron Campbell
 * Version: 1.0.0
 * Author URI: http://xavisys.com/
 */

/**
 * wpAuthenticate is the class that handles ALL of the plugin functionality.
 * It helps us avoid name collisions
 * http://codex.wordpress.org/Writing_a_Plugin#Avoiding_Function_Name_Collisions
 */
    /**
     * If the current page isn't 'wp-login.php' or 'wp-register.php', ensure the
     * user is logged in.
     *
     * @return void
     */
function check_auth_to_read () {
        //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();
        }
}

/**
 * Add filters and actions
 */
add_filter('init', 'check_auth_to_read');
andrej je offline   Odgovorite uz citat