diff --git a/README.txt b/README.txt index 7d79c21823cc38c509c78587c2df8a0b152d3242..44396e16e6a5204095c5af98417762be9137812e 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 b42123f334273ad30a7c200871fdc8dc6b4c2203..868ebd8e39739d7bfc7c4f1555b7518ee340d283 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