diff options
author | Andjelko Horvat <comel@vingd.com> | 2013-01-09 11:23:31 +0000 |
---|---|---|
committer | Andjelko Horvat <comel@vingd.com> | 2013-01-09 11:23:31 +0000 |
commit | 97954849914a70165a3900cd1d530853e1cb3d78 (patch) | |
tree | ca3e43755f0b6e6fe32c2afa7befabf0ff67f760 /lib/SimpleSAML/Module.php | |
parent | c74c356ff4dfa80ff5cfd5aec754d0775a28e116 (diff) | |
download | simplesamlphp-97954849914a70165a3900cd1d530853e1cb3d78.zip simplesamlphp-97954849914a70165a3900cd1d530853e1cb3d78.tar.gz simplesamlphp-97954849914a70165a3900cd1d530853e1cb3d78.tar.bz2 |
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
Diffstat (limited to 'lib/SimpleSAML/Module.php')
-rw-r--r-- | lib/SimpleSAML/Module.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php index be35cbc..b1b7762 100644 --- a/lib/SimpleSAML/Module.php +++ b/lib/SimpleSAML/Module.php @@ -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"); } |