summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Cowie2017-04-20 23:09:40 +0100
committerSteve Cowie2017-04-20 23:09:40 +0100
commit585dfaeed2d610aebd26ec7adb56566118285e65 (patch)
tree0204206d93558e11c74be0a2cefac3c613212e5d
parent25ff64afb26968ac9370e9298ab129ce4407db6d (diff)
Add a requirements entry to status reportwhen there is a custom non-authorised roleHEAD7.x-1.x
-rw-r--r--README.txt3
-rw-r--r--logintoboggan.install25
2 files changed, 28 insertions, 0 deletions
diff --git a/README.txt b/README.txt
index 7d79c21..44396e1 100644
--- a/README.txt
+++ b/README.txt
@@ -37,4 +37,7 @@ but less than authenticated - thus preventing spoof accounts and spammers. The
user will only be removed from the non-authenticated role and granted
authenticated permissions when they verify their account via a special email
link, or when an administrator removes them from the non-authenticated role.
+It is important to check that this non-authenticated role does not cause
+problems when used with other contrib modules such as OG that assume all site
+users hold the authenticated user role.
diff --git a/logintoboggan.install b/logintoboggan.install
index b42123f..868ebd8 100644
--- a/logintoboggan.install
+++ b/logintoboggan.install
@@ -60,3 +60,28 @@ function logintoboggan_uninstall() {
variable_del($variable);
}
}
+
+/**
+ * Implement hook_requirements
+ */
+function logintoboggan_requirements($phase) {
+ $requirements = array();
+ $t = get_t();
+ if($phase == 'runtime') {
+ $non_auth = variable_get('logintoboggan_pre_auth_role');
+ //Check whether there is a non-authenticated role set and that it is not
+ //the standard authenticated user role. If so, add a status report entry.
+ $roles = user_roles();
+ if(is_numeric($non_auth) && $non_auth != DRUPAL_AUTHENTICATED_RID){
+ $rolename = $roles[$non_auth];
+ $requirements['Logintoboggan'] = array(
+ 'title' => $t('Logintoboggan non-authenticated user configuration'),
+ 'description' => $t('Logintoboggan has set an active role that users can have, prior to providing email authentication. Ensure this does not conflict with modules such as OG that assume that all users have the standard authenticated role.'),
+ 'value' => check_plain('Role name: ' . $rolename),
+ 'severity' => REQUIREMENT_WARNING,
+ );
+ }
+
+ }
+ return $requirements;
+} \ No newline at end of file