Skip to content
Snippets Groups Projects
Commit 97954849 authored by Andjelko Horvat's avatar Andjelko Horvat
Browse files

SimpleSAML_Module: add module.enable configuration option for...

SimpleSAML_Module: add module.enable configuration option for enabling/disabling modules (issue #475).

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3218 44740490-163a-0410-bde0-09ae8108e29a
parent c74c356f
No related branches found
No related tags found
No related merge requests found
......@@ -177,6 +177,26 @@ $config = array (
'enable.wsfed-sp' => false,
'enable.authmemcookie' => false,
/*
* Module enable configuration
*
* Configuration to override module enabling/disabling.
*
* Example:
*
* 'module.enable' => array(
* // Setting to TRUE enables.
* 'exampleauth' => TRUE,
* // Setting to FALSE disables.
* 'saml' => FALSE,
* // Unset or NULL uses default.
* 'core' => NULL,
* ),
*
*/
/*
* This value is the duration of the session in seconds. Make sure that the time duration of
* cookies both at the SP and the IdP exceeds this duration.
......
......@@ -42,6 +42,17 @@ class SimpleSAML_Module {
return FALSE;
}
$globalConfig = SimpleSAML_Configuration::getInstance();
$moduleEnable = $globalConfig->getArray('module.enable', array());
if(isset($moduleEnable[$module])) {
if(is_bool($moduleEnable[$module]) === TRUE) {
return $moduleEnable[$module];
}
throw new Exception("Invalid module.enable value for for the module $module");
}
if (assert_options(ASSERT_ACTIVE) && !file_exists($moduleDir . '/default-enable') && !file_exists($moduleDir . '/default-disable')) {
SimpleSAML_Logger::error("Missing default-enable or default-disable file for the module $module");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment