Skip to content
Snippets Groups Projects
Commit a5c00042 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Adding support for generating Shibboleth ARP files.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1504 44740490-163a-0410-bde0-09ae8108e29a
parent 17b12bd9
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,11 @@ function metarefresh_hook_cron(&$croninfo) {
break;
}
if (array_key_exists('arp', $set)) {
$arpconfig = SimpleSAML_Configuration::loadFromArray($set['arp']);
$metaloader->writeARPfile($arpconfig);
}
}
} catch (Exception $e) {
......
......@@ -136,7 +136,36 @@ class sspmod_metarefresh_MetaLoader {
}
/**
* This function writes the metadata to an ARP file
*/
function writeARPfile($config) {
assert('is_a($config, \'SimpleSAML_Configuration\')');
$arpfile = $config->getValue('arpfile');
$types = array('saml20-sp-remote');
$md = array();
foreach($this->metadata as $category => $elements) {
if (!in_array($category, $types)) continue;
$md = array_merge($md, $elements);
}
#$metadata, $attributemap, $prefix, $suffix
$arp = new sspmod_metarefresh_ARP($md,
$config->getValue('attributemap', ''),
$config->getValue('prefix', ''),
$config->getValue('suffix', '')
);
$arpxml = $arp->getXML();
SimpleSAML_Logger::info('Writing ARP file: ' . $arpfile . "\n");
file_put_contents($arpfile, $arpxml);
}
/**
......
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