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

Adding central disco helper

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2790 44740490-163a-0410-bde0-09ae8108e29a
parent 602cf972
No related branches found
No related tags found
No related merge requests found
<?php
/**
* ...
*/
class sspmod_discojuice_CentralHelper {
public static function show($path = '/simplesaml/module.php/discojuice/discojuice/') {
$djconfig = SimpleSAML_Configuration::getOptionalConfig('disojuicecentral.php');
$config = SimpleSAML_Configuration::getInstance();
$feed = new sspmod_discojuice_Feed();
$metadata = json_decode($feed->read(), TRUE);
$t = new SimpleSAML_XHTML_Template($config, 'discojuice:central.tpl.php');
$t->data['metadata'] = $metadata;
$t->data['discojuice.options'] = $djconfig->getValue('discojuice.options');
$t->data['discojuice.options']['discoPath'] = $path;
$t->data['acl'] = $djconfig->getValue('acl');
$t->show();
}
}
......@@ -69,7 +69,10 @@ if (empty($options['metadata'])) {
}
echo 'options.disco = { url: "' . SimpleSAML_Module::getModuleURL('discojuice/discojuiceDiscoveryResponse.html?'). '" }; ' . "\n";
echo 'options.discoPath = "discojuice/"; ' . "\n";
if (empty($options['discoPath'])) {
echo 'options.discoPath = "discojuice/"; ' . "\n";
}
echo 'var acl = ' . json_encode($this->data['acl']) . ';' . "\n";
echo 'acl.push("' . SimpleSAML_Utilities::getSelfHost() . '");' . "\n\n";
......
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