diff --git a/simplesamlphp_auth.admin.inc b/simplesamlphp_auth.admin.inc index 3694716..80622a9 100644 --- a/simplesamlphp_auth.admin.inc +++ b/simplesamlphp_auth.admin.inc @@ -129,6 +129,12 @@ function simplesamlphp_auth_settings_local() { '#default_value' => variable_get('simplesamlphp_auth_logoutgotourl', ''), '#description' => t('Example: @base_url', array('@base_url' => $GLOBALS['base_url'])), ); + $form['simplesamlphp_auth_grp_auth']['simplesamlphp_auth_locallogout'] = array( + '#type' => 'checkbox', + '#title' => t('Log out only from the Drupal system but no SAML'), + '#default_value' => variable_get('simplesamlphp_auth_locallogout', FALSE), + '#description' => t('Use only in cases where the logout from the SSO is handled somewhere else and you want users to be logged out from the Drupal system only.'), + ); return system_settings_form($form); } diff --git a/simplesamlphp_auth.install b/simplesamlphp_auth.install index 19c8832..199858e 100644 --- a/simplesamlphp_auth.install +++ b/simplesamlphp_auth.install @@ -46,6 +46,7 @@ function simplesamlphp_auth_uninstall() { variable_del('simplesamlphp_auth_allowdefaultloginusers'); variable_del('simplesamlphp_auth_login_link_display_name'); variable_del('simplesamlphp_auth_logoutgotourl'); + variable_del('simplesamlphp_auth_locallogout'); variable_del('simplesamlphp_auth_autoenablesaml'); } diff --git a/simplesamlphp_auth.module b/simplesamlphp_auth.module index 6f73335..54ed666 100644 --- a/simplesamlphp_auth.module +++ b/simplesamlphp_auth.module @@ -233,6 +233,11 @@ function simplesamlphp_auth_user_insert(&$edit, $account, $category = NULL) { * Implements hook_user_logout(). */ function simplesamlphp_auth_user_logout($account) { + // If logout is only local, skip the SAML part. + if (variable_get('simplesamlphp_auth_locallogout', FALSE)) { + return; + } + global $user; global $_simplesamlphp_auth_as; global $_simplesamlphp_auth_saml_attributes;