summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Phillips2006-07-09 05:20:44 (GMT)
committer Chad Phillips2006-07-09 05:20:44 (GMT)
commit27c35181676f620ea4ac49133978da510832fbb1 (patch)
tree4d319c3f662b3aaae1310007d0f577cd8a8eec98
parenta5558c76c03a1f739f23d2e393bdc3781dc35542 (diff)
#72245 -- drupal_get_path not loading. moved pre-auth role code into hook_menu, and eliminated hook_init entirely. should solve this problem.
-rwxr-xr-xlogintoboggan.module32
1 files changed, 11 insertions, 21 deletions
diff --git a/logintoboggan.module b/logintoboggan.module
index 9f42e56..8be8981 100755
--- a/logintoboggan.module
+++ b/logintoboggan.module
@@ -352,27 +352,6 @@ function logintoboggan_user_register_validate($form_id, $form_values) {
}
/**
- * Implementation of hook_init()
- *
- * @ingroup logintoboggan_core
- */
-function logintoboggan_init() {
-
- global $user;
-
- // If it's not an anonymous user, and the user has the pre-auth role, and the pre-auth role
- // isn't also the auth role, then unset the auth role for this user--they haven't validated yet.
- $id = logintoboggan_validating_id();
- $in_pre_auth_role = in_array($id, array_keys($user->roles));
- if ($user->uid && $in_pre_auth_role) {
- $user->status = 1;
- if ($id != 2) {
- unset($user->roles[2]);
- }
- }
-}
-
-/**
* Implementation of hook_menu()
*
* @ingroup logintoboggan_core
@@ -403,6 +382,17 @@ function logintoboggan_menu($may_cache) {
// add custom css for the block
theme_add_style(TOBOGGAN_PATH .'/logintoboggan.css');
+ // If it's not an anonymous user, and the user has the pre-auth role, and the pre-auth role
+ // isn't also the auth role, then unset the auth role for this user--they haven't validated yet.
+ $id = logintoboggan_validating_id();
+ $in_pre_auth_role = in_array($id, array_keys($user->roles));
+ if ($user->uid && $in_pre_auth_role) {
+ $user->status = 1;
+ if ($id != 2) {
+ unset($user->roles[2]);
+ }
+ }
+
//callback for re-sending validation e-mail
$items[] = array('path' => 'toboggan/revalidate',
'title' => t('re-send validation e-mail'),