Created
August 6, 2012 20:40
-
-
Save aaronott/3278232 to your computer and use it in GitHub Desktop.
Make a user login prior to accessing anything on the site.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $user; | |
/* | |
* If the user is not logged in, require them to login prior to being | |
* redirected to the form | |
*/ | |
if ($user->uid === 0 && arg(0) != 'user') { | |
$dest = drupal_get_path_alias($_GET['q']); | |
drupal_goto('user', array('query' => array('destination' => $dest))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment