From 9fadbc45ee6a58e3b91a015eb328a3dbd6681ff1 Mon Sep 17 00:00:00 2001 From: hart0554 Date: Tue, 12 Dec 2017 22:05:47 +0000 Subject: [PATCH] Issue #2797253 by hart0554: Login while site in Maintenance Mode? --- simplesamlphp_auth.module | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simplesamlphp_auth.module b/simplesamlphp_auth.module index 6f73335..b888814 100644 --- a/simplesamlphp_auth.module +++ b/simplesamlphp_auth.module @@ -83,6 +83,17 @@ function simplesamlphp_auth_menu() { return $items; } +/** + * Implements hook_menu_site_status_alter(). + */ +function simplesamlphp_auth_menu_site_status_alter(&$menu_site_status, $path) { + // Allow access to authenticate even if site is in offline mode. + $login_path = variable_get('simplesamlphp_auth_login_path', 'saml_login'); + if ($menu_site_status == MENU_SITE_OFFLINE && user_is_anonymous() && $path == $login_path) { + $menu_site_status = MENU_SITE_ONLINE; + } +} + /** * Implements hook_help(). */