function disclaimer_show in Disclaimer 7
Function to control disclaimer display depending user and accesses.
Return value
bool True if must be shown.
1 call to disclaimer_show()
- disclaimer_page_build in ./
disclaimer.module - Implements hook_page_build().
File
- ./
disclaimer.module, line 89 - Create and show disclaimer for your site.
Code
function disclaimer_show() {
global $user;
// Cookie override.
if (isset($_COOKIE[variable_get('disclaimer_cookie_name', 'disclaimerShow')])) {
return FALSE;
}
// Visibility by roles override.
if (user_access('bypass disclaimer')) {
return FALSE;
}
// Configuration and user access.
if (($user->uid == 0 || variable_get('disclaimer_logged', 1) == 1 && $user->uid >= 0) && _disclaimer_visibility() == 1) {
return TRUE;
}
return FALSE;
}