lundi 7 octobre 2013

[Drupal7] Redirect all anonymous users to login page

Without installing any module, add this three lines to your html.tpl.php :
if($GLOBALS['user']->uid==0 && current_path()!='user/login') {
    header("Location: " . $GLOBALS['base_url'] . '/user/login?destination=' . current_path());
}

Aucun commentaire :

Enregistrer un commentaire