function securepages_init in Secure Pages 6
Same name and namespace in other branches
- 5 securepages.module \securepages_init()
- 6.2 securepages.module \securepages_init()
- 7 securepages.module \securepages_init()
Implementation of hook_init().
File
- ./
securepages.module, line 49 - Provide method of creating allowing certain pages to only viewable from https pages
Code
function securepages_init() {
if (!variable_get('securepages_enable', 0) || basename($_SERVER['PHP_SELF']) != 'index.php' || php_sapi_name() == 'cli') {
return;
}
/**
* If we have redirected in the hook_boot(). Then don't try to redirect
* again. This will prevent a loop
*/
if (!isset($_SESSION['securepages_redirect'])) {
securepages_redirect();
}
else {
unset($_SESSION['securepages_redirect']);
}
}