From 7e441a9b3cc4245cbae04f5019c56de879e9971c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Tue, 26 Aug 2008 07:45:11 +0000 Subject: [PATCH] Improvements to iFrame SLO: support for translation of SP names, changed time delay for demo and improved CSS git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@835 44740490-163a-0410-bde0-09ae8108e29a --- templates/default/logout-iframe.php | 13 +++++-------- www/resources/default.css | 8 ++++---- www/saml2/idp/SingleLogoutServiceiFrame.php | 8 ++++++-- www/saml2/idp/SingleLogoutServiceiFrameResponse.php | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/templates/default/logout-iframe.php b/templates/default/logout-iframe.php index 35cdda2ac..752dba3b9 100644 --- a/templates/default/logout-iframe.php +++ b/templates/default/logout-iframe.php @@ -24,21 +24,21 @@ for (j=1; j<=10; j++) { <p>You have initiated a <strong>global logout</strong> from the service <strong><?php echo $this->data['requesterName']; ?></strong>. Global logout means you will be logged out from all services connected to this identity provider. This page will show the status of the logout proccess for all of the services you are logged into.</p> - - - <?php + + foreach ($this->data['sparray'] AS $sp) { echo '<iframe class="hiddeniframe" style="border: 1px solid #888; width: 80%; height: 100px" src="' . $sp['url'] . '" ></iframe>'; } foreach ($this->data['sparray'] AS $spentityid => $sp) { + + $spname = is_array($sp['name']) ? $this->getTranslation($sp['name']) : $sp['name']; echo '<div class="inprogress" id="' . $spentityid . '"> - <img style="float: left; margin: 3px" src="/' . $this->data['baseurlpath'] . 'resources/progress.gif" />Wait... is logging out from <strong>' . $sp['name'] . '</strong></div>'; + <img style="float: left; margin: 3px" src="/' . $this->data['baseurlpath'] . 'resources/progress.gif" />Wait... is logging out from <strong>' . $spname . '</strong></div>'; } - ?> <div id="interrupt">[ <a href="<?php echo $this->data['logoutresponse']; ?>">Interrupt logging out and go back to service</a> ]</div> @@ -49,8 +49,5 @@ for (j=1; j<=10; j++) { <br />[ <a href="<?php echo $this->data['logoutresponse']; ?>">OK, continue back to <?php echo $this->data['requesterName']; ?> to complete the logout process.</a> ] </div> </div> - - - <?php $this->includeAtTemplateBase('includes/footer.php'); ?> \ No newline at end of file diff --git a/www/resources/default.css b/www/resources/default.css index 88dcf6f36..5f1cc4a6b 100644 --- a/www/resources/default.css +++ b/www/resources/default.css @@ -273,14 +273,14 @@ div#interrupt { border: 3px solid #036; background: #39F; padding: 1em; - margin: 1em; + margin: .2em; } div#iscompleted { display: none; border: 3px solid #993; background: #FF9; padding: 1em; - margin: 1em; + margin: .2em; } div.allcompleted#iscompleted { display: block ! important; @@ -289,8 +289,8 @@ div.inprogress, div.loggedout { background: #eee; color: #444; - padding: 1em; - margin: 1em; + padding: .2em 1em; + margin: .2em; } div.inprogress { border: 1px dotted #888; diff --git a/www/saml2/idp/SingleLogoutServiceiFrame.php b/www/saml2/idp/SingleLogoutServiceiFrame.php index 03a200266..06343ebef 100644 --- a/www/saml2/idp/SingleLogoutServiceiFrame.php +++ b/www/saml2/idp/SingleLogoutServiceiFrame.php @@ -100,6 +100,9 @@ function updateslostatus() { $listofsps = $session->get_sp_list(SimpleSAML_Session::STATE_LOGGEDOUT); + // Using template object to be able to translate name of service provider. + $t = new SimpleSAML_XHTML_Template($config, 'logout-iframe.php'); + // Instantiate the xajaxResponse object $objResponse = new xajaxResponse(); @@ -111,10 +114,11 @@ function updateslostatus() { $spmetadata = $metadata->getMetaData($spentityid, 'saml20-sp-remote'); $name = array_key_exists('name', $spmetadata) ? $spmetadata['name'] : $spentityid; - + + $spname = is_array($name) ? $t->getTranslation($name) : $name; $objResponse->addAssign($spentityid, "className", 'loggedout'); - $objResponse->addAssign($spentityid, "innerHTML", 'Logging out from <strong>' . $name . '</strong> successfully completed'); + $objResponse->addAssign($spentityid, "innerHTML", 'Logging out from <strong>' . $spname . '</strong> successfully completed'); } diff --git a/www/saml2/idp/SingleLogoutServiceiFrameResponse.php b/www/saml2/idp/SingleLogoutServiceiFrameResponse.php index ec9b18038..c9157aefb 100644 --- a/www/saml2/idp/SingleLogoutServiceiFrameResponse.php +++ b/www/saml2/idp/SingleLogoutServiceiFrameResponse.php @@ -13,7 +13,7 @@ require_once('../../_include.php'); -sleep(rand(1,6)); +sleep(max(0, rand(-3,5))); -- GitLab