Revision: 3016
Author:   andreassolberg
Date:     Fri Jan 13 03:57:04 2012
Log:      Removed a lot of unused code in discojuice module...
http://code.google.com/p/simplesamlphp/source/detail?r=3016

Deleted:
 /trunk/modules/discojuice/dictionaries
 /trunk/modules/discojuice/hooks/hook_cron.php
 /trunk/modules/discojuice/hooks/hook_frontpage.php
 /trunk/modules/discojuice/lib
Modified:
 /trunk/modules/discojuice/templates/central.tpl.php
 /trunk/modules/discojuice/www/central.php
 /trunk/modules/discojuice/www/response.html

=======================================
--- /trunk/modules/discojuice/hooks/hook_cron.php       Thu Mar 31 04:31:34 2011
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * 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();
-       }
-}
-?>
=======================================
--- /trunk/modules/discojuice/hooks/hook_frontpage.php Thu Mar 31 04:31:34 2011
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-/**
- * Hook to add links to the frontpage.
- *
- * @param array &$links  The links on the frontpage, split into sections.
- */
-function discojuice_hook_frontpage(&$links) {
-       assert('is_array($links)');
-       assert('array_key_exists("links", $links)');
-
-       $links['federation'][] = array(
-               'href' => 
SimpleSAML_Module::getModuleURL('discojuice/central.php'),
- 'text' => array('en' => 'DiscoJuice: Discovery Service (not functional without IdP Discovery parameters)'),
-       );
-
-       $links['federation'][] = array(
-               'href' => 
SimpleSAML_Module::getModuleURL('discojuice/feed.php'),
-               'text' => array('en' => 'DiscoJuice: Metadata Feed (JSON)'),
-       );
-
-}
-?>
=======================================
--- /trunk/modules/discojuice/templates/central.tpl.php Wed Nov 2 03:49:50 2011 +++ /trunk/modules/discojuice/templates/central.tpl.php Fri Jan 13 03:57:04 2012
@@ -7,18 +7,13 @@
 <head>
        <meta charset="utf-8" />
        <title>Select Your Login Provider</title>
-
-
-<link rel="shortcut icon" href="http://discojuice.bridge.uninett.no/simplesaml/module.php/discojuice/favicon.png"; />
-
-
-<!-- JQuery hosted by Google -->
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
-
-<!-- DiscoJuice hosted by UNINETT at discojuice.org -->
-<script type="text/javascript" src="https://engine.discojuice.org/discojuice-stable.min.js";></script> -<link rel="stylesheet" type="text/css" href="https://static.discojuice.org/css/discojuice.css"; />
-
+
+       <!-- JQuery hosted by Google -->
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
+
+       <!-- DiscoJuice hosted by UNINETT at discojuice.org -->
+ <script type="text/javascript" src="https://engine.discojuice.org/discojuice-stable.min.js";></script> + <link rel="stylesheet" type="text/css" href="https://static.discojuice.org/css/discojuice.css"; />

        <style type="text/css">
                body {
@@ -47,8 +42,8 @@
                                json_encode($this->data['hostedConfig'][4]) .
                        ');';

-       echo "     djc.country = false;\n";
-       echo "     djc.showLocationInfo = false;\n";
+       // echo "  djc.country = false;\n";
+       // echo "  djc.showLocationInfo = false;\n";

        if (!$this->data['enableCentralStorage']) {
                echo "     delete djc.disco;\n";
=======================================
--- /trunk/modules/discojuice/www/central.php   Wed Nov  2 03:49:50 2011
+++ /trunk/modules/discojuice/www/central.php   Fri Jan 13 03:57:04 2012
@@ -4,15 +4,9 @@
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'];

@@ -34,7 +28,7 @@
        SimpleSAML_Module::getModuleURL('discojuice/response.html'),

        // Set of feeds to subscribe to.
-       $djconfig->getArray('feeds', 'Service'),
+       $djconfig->getArray('feeds', array('edugain')),

        $href
 );
=======================================
--- /trunk/modules/discojuice/www/response.html Wed Nov  2 03:49:50 2011
+++ /trunk/modules/discojuice/www/response.html Fri Jan 13 03:57:04 2012
@@ -31,18 +31,22 @@
        if (urlParams.cid) cid = urlParams.cid;

        var sender = parseURL(document.referrer);
+
+       // Received a specific entity ID from the storage.
        if (urlParams.entityID) {
window.parent.DiscoJuice.Utils.log('ResponseLocation: Response from discovery service [' + sender + ']: ' + urlParams.entityID + ' subID: ' + urlParams.subID);
-
window.parent.DiscoJuice.Control.discoResponse(sender, urlParams.entityID, urlParams.subID, cid);

+       // Received a textual error from the storage, to show in the debug log.
        } else if (urlParams['error']) {
                window.parent.DiscoJuice.Control.discoResponseError(cid,
- "Error from IdP Discovery Service [" + sender + "]: " + urlParams.error); + "Error from IdP Discovery Service [" + sender + "]: " + urlParams.error);
+
+ // Did not receive a response parameter. This probably means that the Disco storage did not have a stored preference
+       // for the user. Consequently: no error.
        } else {
-               console.log('No valid response parameters. cid[' + cid + ']');
+ window.parent.DiscoJuice.Utils.log('No valid response parameters. cid[' + cid + ']');
                window.parent.DiscoJuice.Control.discoResponseError(cid);
- // "ResponseLocation: Response from discovery service [" + sender + "]: No valid response parameters");
        }

 }
@@ -51,6 +55,6 @@
 </head>

 <body onload="receive();">
-</body>
-
+
+</body>
 </html>

--
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.

Reply via email to