diff options
author | Olav Morken <olav.morken@uninett.no> | 2009-08-14 11:07:44 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2009-08-14 11:07:44 +0000 |
commit | 3aea3623ee640db54a0e5383e25d352d43aa7c5c (patch) | |
tree | 1cdb44db77f65250ef43a79e3bd13636c9d7a0ca /lib/SimpleSAML | |
parent | 3556f998f68bbadba868f0c7bfc03fec956b0a4f (diff) | |
download | simplesamlphp-3aea3623ee640db54a0e5383e25d352d43aa7c5c.zip simplesamlphp-3aea3623ee640db54a0e5383e25d352d43aa7c5c.tar.gz simplesamlphp-3aea3623ee640db54a0e5383e25d352d43aa7c5c.tar.bz2 |
Give default values for all configuration options from config.php
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1665 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r-- | lib/SimpleSAML/Auth/TimeLimitedToken.php | 3 | ||||
-rw-r--r-- | lib/SimpleSAML/Bindings/Shib13/HTTPPost.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/Configuration.php | 7 | ||||
-rw-r--r-- | lib/SimpleSAML/Logger.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/Logger/LoggingHandlerFile.php | 4 | ||||
-rw-r--r-- | lib/SimpleSAML/Logger/LoggingHandlerSyslog.php | 4 | ||||
-rw-r--r-- | lib/SimpleSAML/Metadata/MetaDataStorageHandler.php | 11 | ||||
-rw-r--r-- | lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/Metadata/MetaDataStorageHandlerSAML2Meta.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/Metadata/Signer.php | 16 | ||||
-rw-r--r-- | lib/SimpleSAML/Session.php | 10 | ||||
-rw-r--r-- | lib/SimpleSAML/SessionHandlerPHP.php | 6 | ||||
-rw-r--r-- | lib/SimpleSAML/Utilities.php | 21 | ||||
-rw-r--r-- | lib/SimpleSAML/XHTML/IdPDisco.php | 4 | ||||
-rw-r--r-- | lib/SimpleSAML/XHTML/Template.php | 20 | ||||
-rw-r--r-- | lib/SimpleSAML/XML/Shib13/AuthnResponse.php | 2 | ||||
-rw-r--r-- | lib/SimpleSAML/XML/Signer.php | 2 |
18 files changed, 52 insertions, 68 deletions
diff --git a/lib/SimpleSAML/Auth/TimeLimitedToken.php b/lib/SimpleSAML/Auth/TimeLimitedToken.php index 95d4a22..3c991ce 100644 --- a/lib/SimpleSAML/Auth/TimeLimitedToken.php +++ b/lib/SimpleSAML/Auth/TimeLimitedToken.php @@ -14,8 +14,7 @@ class SimpleSAML_Auth_TimeLimitedToken { */ public function __construct( $lifetime = 900, $secretSalt = NULL, $skew = 1) { if ($secretSalt === NULL) { - $config = SimpleSAML_Configuration::getInstance(); - $secretSalt = $config->getValue('secretsalt'); + $secretSalt = SimpleSAML_Utilities::getSecretSalt(); } $this->secretSalt = $secretSalt; diff --git a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php index 68a0051..c455474 100644 --- a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php +++ b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php @@ -83,7 +83,7 @@ class SimpleSAML_Bindings_Shib13_HTTPPost { $response = $responsedom->saveXML(); - if ($this->configuration->getValue('debug')) { + if ($this->configuration->getBoolean('debug', FALSE)) { $p = new SimpleSAML_XHTML_Template($this->configuration, 'post-debug.php'); $p->data['header'] = 'SAML (Shibboleth 1.3) Response Debug-mode'; $p->data['RelayStateName'] = 'TARGET'; diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 487905e..c812e0e 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -296,10 +296,11 @@ class SimpleSAML_Configuration { public function getBaseURL() { - if (preg_match('/^\*(.*)$/', $this->getValue('baseurlpath', ''), $matches)) { + if (preg_match('/^\*(.*)$/', $this->getString('baseurlpath', 'simplesaml/'), $matches)) { return SimpleSAML_Utilities::getFirstPathElement(false) . $matches[1]; } - return $this->getValue('baseurlpath', ''); + + return $this->getString('baseurlpath', 'simplesaml/'); } @@ -375,7 +376,7 @@ class SimpleSAML_Configuration { /* Check if a directory is configured in the configuration * file. */ - $dir = $this->getValue('basedir'); + $dir = $this->getString('basedir', NULL); if($dir !== NULL) { /* Add trailing slash if it is missing. */ if(substr($dir, -1) !== '/') { diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php index 6b1ff43..4a66f47 100644 --- a/lib/SimpleSAML/Logger.php +++ b/lib/SimpleSAML/Logger.php @@ -119,7 +119,7 @@ class SimpleSAML_Logger { /* * setting minimum log_level */ - self::$logLevel = $config->getValue('logging.level',LOG_INFO); + self::$logLevel = $config->getInteger('logging.level',LOG_INFO); $handler = strtolower($handler); diff --git a/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php b/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php index 0a9bddb..7b50c48 100644 --- a/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php +++ b/lib/SimpleSAML/Logger/LoggingHandlerErrorLog.php @@ -29,7 +29,7 @@ class SimpleSAML_Logger_LoggingHandlerErrorLog implements SimpleSAML_Logger_Logg function log_internal($level, $string) {
$config = SimpleSAML_Configuration::getInstance();
assert($config instanceof SimpleSAML_Configuration);
- $processname = $config->getValue('logging.processname','simpleSAMLphp');
+ $processname = $config->getString('logging.processname','simpleSAMLphp');
if(array_key_exists($level, self::$levelNames)) { $levelName = self::$levelNames[$level]; diff --git a/lib/SimpleSAML/Logger/LoggingHandlerFile.php b/lib/SimpleSAML/Logger/LoggingHandlerFile.php index f84d628..41198a0 100644 --- a/lib/SimpleSAML/Logger/LoggingHandlerFile.php +++ b/lib/SimpleSAML/Logger/LoggingHandlerFile.php @@ -34,8 +34,8 @@ class SimpleSAML_Logger_LoggingHandlerFile implements SimpleSAML_Logger_LoggingH assert($config instanceof SimpleSAML_Configuration); /* Get the metadata handler option from the configuration. */ - $this->logFile = $config->getPathValue('loggingdir').$config->getValue('logging.logfile'); - $this->processname = $config->getValue('logging.processname','simpleSAMLphp');
+ $this->logFile = $config->getPathValue('loggingdir', 'log/').$config->getString('logging.logfile', 'simplesamlphp.log'); + $this->processname = $config->getString('logging.processname','simpleSAMLphp');
if (@file_exists($this->logFile)) { if (!@is_writeable($this->logFile)) throw new Exception("Could not write to logfile: ".$this->logFile); diff --git a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php index 2e8dcbb..562ca12 100644 --- a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php +++ b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php @@ -16,9 +16,9 @@ class SimpleSAML_Logger_LoggingHandlerSyslog implements SimpleSAML_Logger_Loggin function __construct() { $config = SimpleSAML_Configuration::getInstance(); assert($config instanceof SimpleSAML_Configuration); - $facility = $config->getValue('logging.facility'); + $facility = $config->getInteger('logging.facility', defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER); - $processname = $config->getValue('logging.processname','simpleSAMLphp'); + $processname = $config->getString('logging.processname','simpleSAMLphp'); /* * OS Check * Setting facility to LOG_USER (only valid in Windows), enable log level rewrite on windows systems. diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php index eb088b2..7d39cc8 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php @@ -49,21 +49,14 @@ class SimpleSAML_Metadata_MetaDataStorageHandler { $config = SimpleSAML_Configuration::getInstance(); - $sourcesConfig = $config->getValue('metadata.sources', NULL); + $sourcesConfig = $config->getArray('metadata.sources', NULL); /* For backwards compatibility, and to provide a default configuration. */ if($sourcesConfig === NULL) { - $type = $config->getValue('metadata.handler', 'flatfile'); + $type = $config->getString('metadata.handler', 'flatfile'); $sourcesConfig = array(array('type' => $type)); } - if(!is_array($sourcesConfig)) { - throw new Exception( - 'Invalid configuration of the \'metadata.sources\' configuration option.' . - ' This option should be an array.' - ); - } - try { $this->sources = SimpleSAML_Metadata_MetaDataStorageSource::parseSources($sourcesConfig); } catch (Exception $e) { diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php index a220043..6c33ec4 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php @@ -55,7 +55,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile extends SimpleSAML_Meta if(array_key_exists('directory', $config)) { $this->directory = $config['directory']; } else { - $this->directory = $globalConfig->getValue('metadatadir', 'metadata/'); + $this->directory = $globalConfig->getString('metadatadir', 'metadata/'); } /* Resolve this directory relative to the simpleSAMLphp directory (unless it is diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSAML2Meta.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSAML2Meta.php index 6b6f032..fe352e7 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSAML2Meta.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSAML2Meta.php @@ -58,7 +58,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerSAML2Meta extends SimpleSAML_Met // The metadata location is an URL $metadatasetfile = $metadatalocation; } else { - $metadatasetfile = $config->getPathValue('metadatadir') . $metadatalocation; + $metadatasetfile = $config->getPathValue('metadatadir', 'metadata/') . $metadatalocation; if (!file_exists($metadatasetfile)) throw new Exception('Could not find SAML 2.0 Metadata file :'. $metadatasetfile); if (preg_match('@\.php$@', $metadatalocation)) { $xml = false; diff --git a/lib/SimpleSAML/Metadata/Signer.php b/lib/SimpleSAML/Metadata/Signer.php index 8d433ae..bd81709 100644 --- a/lib/SimpleSAML/Metadata/Signer.php +++ b/lib/SimpleSAML/Metadata/Signer.php @@ -46,8 +46,8 @@ class SimpleSAML_Metadata_Signer { } /* Then we look for default values in the global configuration. */ - $privatekey = $config->getValue('metadata.sign.privatekey', NULL); - $certificate = $config->getValue('metadata.sign.certificate', NULL); + $privatekey = $config->getString('metadata.sign.privatekey', NULL); + $certificate = $config->getString('metadata.sign.certificate', NULL); if($privatekey !== NULL || $certificate !== NULL) { if($privatekey === NULL || $certificate === NULL) { throw new Exception('Missing either the "metadata.sign.privatekey" or the' . @@ -57,7 +57,7 @@ class SimpleSAML_Metadata_Signer { } $ret = array('privatekey' => $privatekey, 'certificate' => $certificate); - $privatekey_pass = $config->getValue('metadata.sign.privatekey_pass', NULL); + $privatekey_pass = $config->getString('metadata.sign.privatekey_pass', NULL); if($privatekey_pass !== NULL) { $ret['privatekey_pass'] = $privatekey_pass; } @@ -115,11 +115,7 @@ class SimpleSAML_Metadata_Signer { return $entityMetadata['metadata.sign.enable']; } - $enabled = $config->getValue('metadata.sign.enable', FALSE); - if(!is_bool($enabled)) { - throw new Exception('Invalid value for the "metadata.sign.enable" configuration option.' . - ' This option should be a boolean.'); - } + $enabled = $config->getBoolean('metadata.sign.enable', FALSE); return $enabled; } @@ -147,13 +143,13 @@ class SimpleSAML_Metadata_Signer { $keyCertFiles = self::findKeyCert($config, $entityMetadata, $type); - $keyFile = $config->getPathValue('certdir') . $keyCertFiles['privatekey']; + $keyFile = $config->getPathValue('certdir', 'cert/') . $keyCertFiles['privatekey']; if (!file_exists($keyFile)) { throw new Exception('Could not find private key file [' . $keyFile . '], which is needed to sign the metadata'); } $keyData = file_get_contents($keyFile); - $certFile = $config->getPathValue('certdir') . $keyCertFiles['certificate']; + $certFile = $config->getPathValue('certdir', 'cert/') . $keyCertFiles['certificate']; if (!file_exists($certFile)) { throw new Exception('Could not find certificate file [' . $certFile . '], which is needed to sign the metadata'); } diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index 025a9d6..5d8c19a 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -95,7 +95,7 @@ class SimpleSAML_Session { private function __construct() { $configuration = SimpleSAML_Configuration::getInstance(); - $this->sessionduration = $configuration->getValue('session.duration'); + $this->sessionduration = $configuration->getInteger('session.duration', 8*60*60); $this->trackid = SimpleSAML_Utilities::generateTrackID(); @@ -736,16 +736,16 @@ class SimpleSAML_Session { $configuration = SimpleSAML_Configuration::getInstance(); - $timeout = $configuration->getValue('session.datastore.timeout', NULL); + $timeout = $configuration->getInteger('session.datastore.timeout', NULL); if($timeout !== NULL) { - if(!is_int($timeout) || $timeout <= 0) { + if ($timeout <= 0) { throw new Exception('The value of the session.datastore.timeout' . ' configuration option should be a positive integer.'); } } else { /* For backwards compatibility. */ - $timeout = $configuration->getValue('session.requestcache', 4*(60*60)); - if(!is_int($timeout) || $timeout <= 0) { + $timeout = $configuration->getInteger('session.requestcache', 4*(60*60)); + if ($timeout <= 0) { throw new Exception('The value of the session.requestcache' . ' configuration option should be a positive integer.'); } diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php index 6c4a102..6a2eae6 100644 --- a/lib/SimpleSAML/SessionHandlerPHP.php +++ b/lib/SimpleSAML/SessionHandlerPHP.php @@ -33,13 +33,13 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler { if(session_id() === '') { $config = SimpleSAML_Configuration::getInstance(); - $cookiepath = ($config->getValue('session.phpsession.limitedpath', FALSE) ? '/' . $config->getValue('baseurlpath') : '/'); + $cookiepath = ($config->getBoolean('session.phpsession.limitedpath', FALSE) ? '/' . $config->getBaseURL() : '/'); session_set_cookie_params(0, $cookiepath, NULL, SimpleSAML_Utilities::isHTTPS()); - $cookiename = $config->getValue('session.phpsession.cookiename', NULL); + $cookiename = $config->getString('session.phpsession.cookiename', NULL); if (!empty($cookiename)) session_name($cookiename); - $savepath = $config->getValue('session.phpsession.savepath', NULL); + $savepath = $config->getString('session.phpsession.savepath', NULL); if(!empty($savepath)) { session_save_path($savepath); } diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 931faac..a38c1a2 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -556,10 +556,10 @@ class SimpleSAML_Utilities { $t->data['errorcode'] = $errorcode; $t->data['parameters'] = $parameters; - $t->data['showerrors'] = $config->getValue('showerrors', true); + $t->data['showerrors'] = $config->getBoolean('showerrors', true); /* Check if there is a valid technical contact email address. */ - if($config->getValue('technicalcontact_email', 'na@example.org') !== 'na@example.org') { + if($config->getString('technicalcontact_email', 'na@example.org') !== 'na@example.org') { /* Enable error reporting. */ $baseurl = SimpleSAML_Utilities::selfURLhost() . '/' . $config->getBaseURL(); $t->data['errorreportaddress'] = $baseurl . 'errorreport.php'; @@ -583,7 +583,7 @@ class SimpleSAML_Utilities { $t->data['trackid'] = $trackid; - $t->data['version'] = $config->getValue('version', 'na'); + $t->data['version'] = $config->getString('version', 'na'); $t->data['url'] = self::selfURLNoQuery(); $t->show(); @@ -1005,18 +1005,13 @@ class SimpleSAML_Utilities { throw new Exception('XML contained a doctype declaration.'); } - $enabled = SimpleSAML_Configuration::getInstance()->getValue('debug.validatexml', NULL); + $enabled = SimpleSAML_Configuration::getInstance()->getBoolean('debug.validatexml', NULL); if($enabled === NULL) { /* Fall back to old configuration option. */ - $enabled = SimpleSAML_Configuration::getInstance()->getValue('debug.validatesamlmessages', NULL); + $enabled = SimpleSAML_Configuration::getInstance()->getBoolean('debug.validatesamlmessages', NULL); if($enabled === NULL) { /* Fall back to even older configuration option. */ - $enabled = SimpleSAML_Configuration::getInstance()->getValue('debug.validatesaml2messages', FALSE); - if(!is_bool($enabled)) { - throw new Exception('Expected "debug.validatesaml2messages" to be set to a boolean value.'); - } - } elseif(!is_bool($enabled)) { - throw new Exception('Expected "debug.validatexml" to be set to a boolean value.'); + $enabled = SimpleSAML_Configuration::getInstance()->getBoolean('debug.validatesaml2messages', FALSE); } } @@ -1468,7 +1463,7 @@ class SimpleSAML_Utilities { } elseif (array_key_exists($prefix . 'certificate', $metadata)) { /* Reference to certificate file. */ $config = SimpleSAML_Configuration::getInstance(); - $file = $config->getPathValue('certdir') . $metadata[$prefix . 'certificate']; + $file = $config->getPathValue('certdir', 'cert/') . $metadata[$prefix . 'certificate']; $data = @file_get_contents($file); if ($data === FALSE) { throw new Exception('Unable to load certificate/public key from file "' . $file . '"'); @@ -1555,7 +1550,7 @@ class SimpleSAML_Utilities { } $config = SimpleSAML_Configuration::getInstance(); - $file = $config->getPathValue('certdir') . $metadata[$prefix . 'privatekey']; + $file = $config->getPathValue('certdir', 'cert/') . $metadata[$prefix . 'privatekey']; $data = @file_get_contents($file); if ($data === FALSE) { throw new Exception('Unable to load private key from file "' . $file . '"'); diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php index ff76dae..0bc2c38 100644 --- a/lib/SimpleSAML/XHTML/IdPDisco.php +++ b/lib/SimpleSAML/XHTML/IdPDisco.php @@ -399,8 +399,8 @@ class SimpleSAML_XHTML_IdPDisco { $idp = $this->getTargetIdp(); if($idp !== NULL) { - if ($this->config->getValue('idpdisco.extDiscoveryStorage', NULL) != NULL) { - $extDiscoveryStorage = $this->config->getValue('idpdisco.extDiscoveryStorage'); + if ($this->config->getBoolean('idpdisco.extDiscoveryStorage', NULL) != NULL) { + $extDiscoveryStorage = $this->config->getBoolean('idpdisco.extDiscoveryStorage'); $this->log('Choice made [' . $idp . '] (Forwarding to external discovery storage)'); SimpleSAML_Utilities::redirect($extDiscoveryStorage, array( // $this->returnIdParam => $idp, diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index 2a94887..58b98d4 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -123,7 +123,7 @@ class SimpleSAML_XHTML_Template { * languages in the header were available. */ private function getHTTPLanguage() { - $availableLanguages = $this->configuration->getValue('language.available'); + $availableLanguages = $this->configuration->getArray('language.available', array('en')); $languageScore = SimpleSAML_Utilities::getAcceptLanguage(); /* For now we only use the default language map. We may use a configurable language map @@ -172,14 +172,14 @@ class SimpleSAML_XHTML_Template { * Returns the language default (from configuration) */ private function getDefaultLanguage() { - return $this->configuration->getValue('language.default', 'en'); + return $this->configuration->getString('language.default', 'en'); } /** * Returns a list of all available languages. */ private function getLanguageList() { - $availableLanguages = $this->configuration->getValue('language.available'); + $availableLanguages = $this->configuration->getArray('language.available', array('en')); $thisLang = $this->getLanguage(); $lang = array(); foreach ($availableLanguages AS $nl) { @@ -221,7 +221,7 @@ class SimpleSAML_XHTML_Template { $fileName = substr($name, $sepPos + 1); $dictDir = SimpleSAML_Module::getModuleDir($module) . '/dictionaries/'; } else { - $dictDir = $this->configuration->getPathValue('dictionarydir'); + $dictDir = $this->configuration->getPathValue('dictionarydir', 'dictionaries/'); $fileName = $name; } $this->dictionaries[$name] = $this->readDictionaryFile($dictDir . $fileName . '.php'); @@ -418,9 +418,9 @@ class SimpleSAML_XHTML_Template { $filebase = null; if (!empty($otherConfig)) { - $filebase = $otherConfig->getPathValue('dictionarydir'); + $filebase = $otherConfig->getPathValue('dictionarydir', 'dictionaries/'); } else { - $filebase = $this->configuration->getPathValue('dictionarydir'); + $filebase = $this->configuration->getPathValue('dictionarydir', 'dictionaries/'); } @@ -493,7 +493,7 @@ class SimpleSAML_XHTML_Template { $templateName = $tmp[0]; } - $tmp = explode(':', $this->configuration->getValue('theme.use'), 2); + $tmp = explode(':', $this->configuration->getString('theme.use', 'default'), 2); if (count($tmp) === 2) { $themeModule = $tmp[0]; $themeName = $tmp[1]; @@ -515,7 +515,7 @@ class SimpleSAML_XHTML_Template { } else { /* .../templates/<theme>/<templateName> */ - $filename = $this->configuration->getPathValue('templatedir') . $templateName; + $filename = $this->configuration->getPathValue('templatedir', 'templates/') . $templateName; } if (file_exists($filename)) { @@ -529,14 +529,14 @@ class SimpleSAML_XHTML_Template { /* Try default theme. */ - $baseTheme = $this->configuration->getValue('theme.base'); + $baseTheme = $this->configuration->getString('theme.base', 'default'); if ($templateModule !== 'default') { /* .../module/<templateModule>/templates/<baseTheme>/<templateName> */ $filename = SimpleSAML_Module::getModuleDir($templateModule) . '/templates/' . $templateName; } else { /* .../templates/<baseTheme>/<templateName> */ - $filename = $this->configuration->getPathValue('templatedir') . '/' . $templateName; + $filename = $this->configuration->getPathValue('templatedir', 'templates/') . '/' . $templateName; } if (file_exists($filename)) { diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php index bac77ac..e1b7c56 100644 --- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php +++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php @@ -50,7 +50,7 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse { $this->validator->validateFingerprint($issuerFingerprint); } elseif(array_key_exists('caFile', $md)) { /* Validate against CA. */ - $this->validator->validateCA($this->configuration->getPathValue('certdir') . $md['caFile']); + $this->validator->validateCA($this->configuration->getPathValue('certdir', 'cert/') . $md['caFile']); } else { throw new Exception('Required field [certFingerprint] or [caFile] in Shibboleth 1.3 IdP Remote metadata was not found for identity provider [' . $issuer . ']. Please add a fingerprint and try again. You can add a dummy fingerprint first, and then an error message will be printed with the real fingerprint.'); } diff --git a/lib/SimpleSAML/XML/Signer.php b/lib/SimpleSAML/XML/Signer.php index efbf0d8..f07f48b 100644 --- a/lib/SimpleSAML/XML/Signer.php +++ b/lib/SimpleSAML/XML/Signer.php @@ -60,7 +60,7 @@ class SimpleSAML_XML_Signer { if(self::$certDir === FALSE) { $config = SimpleSAML_Configuration::getInstance(); - self::$certDir = $config->getPathValue('certdir'); + self::$certDir = $config->getPathValue('certdir', 'cert/'); } $this->idAttrName = FALSE; |