示例#1
0
	public static function show($path = '/simplesaml/module.php/discojuice/discojuice/') {
			
		$djconfig = SimpleSAML_Configuration::getOptionalConfig('discojuicecentral.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();
		
	}
示例#2
0
/**
 * Hook to run a cron job.
 *
 * @param array &$croninfo  Output
 */
function discojuice_hook_cron(&$croninfo) {
	assert('is_array($croninfo)');
	assert('array_key_exists("summary", $croninfo)');
	assert('array_key_exists("tag", $croninfo)');

	if ($croninfo['tag'] !== 'hourly') return;

	SimpleSAML_Logger::info('cron [discojuice metadata caching]: Running cron in tag [' . $croninfo['tag'] . '] ');

	try {
	
		$feed = new sspmod_discojuice_Feed();
		$feed->store();

	} catch (Exception $e) {
		$croninfo['summary'][] = 'Error during discojuice metadata caching: ' . $e->getMessage();
	}
}
示例#3
0
文件: central.php 项目: rhertzog/lcs
<?php

if (empty($_REQUEST['entityID'])) throw new Exception('Missing parameter [entityID]');
if (empty($_REQUEST['return'])) throw new Exception('Missing parameter [return]');



$djconfig = SimpleSAML_Configuration::getOptionalConfig('discojuice.php');
$config = SimpleSAML_Configuration::getInstance();


$feed = new sspmod_discojuice_Feed();
$metadata = json_decode($feed->read(), TRUE);	


// EntityID
$entityid = $_REQUEST['entityID'];

// Return to...
$returnidparam = !empty($_REQUEST['returnIDParam']) ? $_REQUEST['returnIDParam'] : 'entityID';
$href = SimpleSAML_Utilities::addURLparameter(
	$_REQUEST['return'],
	array($returnidparam => '')
);


$hostedConfig = array(
	// Name of service
	$djconfig->getString('name', 'Service'),

	$entityid,