Revision: 1718
Author: andreassolberg
Date: Thu Aug 27 05:39:01 2009
Log: add hobbit configuration
http://code.google.com/p/simplesamlphp/source/detail?r=1718
Added:
/trunk/modules/ldapstatus/www/hobbit.php
=======================================
--- /dev/null
+++ /trunk/modules/ldapstatus/www/hobbit.php Thu Aug 27 05:39:01 2009
@@ -0,0 +1,78 @@
+<?php
+
+
+$config = SimpleSAML_Configuration::getInstance();
+$session = SimpleSAML_Session::getInstance();
+
+$authTokenContactsSP = sha1('feide:contacts-sp|' .
$config->getValue('secret'));
+
+
+if (isset($_REQUEST['getToken'])) {
+ SimpleSAML_Utilities::requireAdmin();
+ echo $authTokenContactsSP; exit;
+}
+
+
+
+
+if (!array_key_exists('token', $_REQUEST)) {
+ throw new SimpleSAML_Error_BadRequest('Missing authToken.');
+}
+
+$token = $_REQUEST['token'];
+
+if ($token !== $authTokenContactsSP) {
+ throw new SimpleSAML_Error_Exception('Invalid AuthToken');
+}
+
+
+
+
+$ldapconfig =
SimpleSAML_Configuration::getConfig('config-login-feide.php');
+$ldapStatusConfig =
SimpleSAML_Configuration::getConfig('module_ldapstatus.php');
+
+$debug = $ldapconfig->getValue('ldapDebug', FALSE);
+$orgs = $ldapconfig->getValue('organizations');
+$locationTemplate = $ldapconfig->getValue('locationTemplate');
+
+
+$isAdmin = FALSE;
+$secretURL = NULL;
+
+$ignore = '';
+if (array_key_exists('ignore', $_REQUEST)) $ignore = '&ignore=' .
$_REQUEST['ignore'];
+
+
+$secretKey = sha1('ldapstatus|' . $config->getValue('secret') . '|hobbit');
+$secretURL = SimpleSAML_Utilities::addURLparameter(
+ SimpleSAML_Utilities::selfURLNoQuery(), array(
+ 'key' => $secretKey,
+ )
+);
+
+function generateSecret($salt, $orgtest) {
+ $secretKey = sha1('ldapstatus|' . $salt . '|' . $orgtest);
+ return $secretKey;
+}
+
+
+
+echo('<pre>');
+
+
+
+foreach($orgs AS $orgkey => $org) {
+
+ $url = SimpleSAML_Utilities::addURLparameter(
+ SimpleSAML_Utilities::selfURLhost() .
SimpleSAML_Utilities::getFirstPathElement() . '/module.php/ldapstatus/',
array(
+ 'orgtest' => $orgkey,
+ 'output' => 'text',
+ 'key' => generateSecret($config->getValue('secret'),
$orgkey)
+ )
+ );
+
+ echo("0.0.0.0 " . $orgkey . " # noconn cont=sl;" . $url .
$ignore . ";OOOKKK\n");
+
+}
+
+
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simplesamlphp-commits?hl=en
-~----------~----~----~----~------~----~------~--~---