Skip to content
Snippets Groups Projects
Commit 510957e4 authored by Olav Morken's avatar Olav Morken
Browse files

metarefresh: Use getOptionalConfig to avoid errors when missing configuration file.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2326 44740490-163a-0410-bde0-09ae8108e29a
parent dfe7d7be
No related branches found
No related tags found
No related merge requests found
......@@ -13,12 +13,7 @@ function metarefresh_hook_cron(&$croninfo) {
try {
$config = SimpleSAML_Configuration::getInstance();
try {
$mconfig = SimpleSAML_Configuration::getConfig('config-metarefresh.php');
} catch (Exception $e) {
SimpleSAML_Logger::info('cron [metarefresh]: Could not open configuration file for module - skipping.');
return;
}
$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');
$sets = $mconfig->getConfigList('sets', array());
......
<?php
$config = SimpleSAML_Configuration::getInstance();
$mconfig = SimpleSAML_Configuration::getConfig('config-metarefresh.php');
$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');
SimpleSAML_Utilities::requireAdmin();
SimpleSAML_Logger::setCaptureLog(TRUE);
$sets = $mconfig->getConfigList('sets');
$sets = $mconfig->getConfigList('sets', array());
foreach ($sets AS $setkey => $set) {
......
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