diff --git a/dictionaries/status.php b/dictionaries/status.php new file mode 100644 index 0000000000000000000000000000000000000000..045d8d4f3396df60bb1b9224372b2767c8cf8db4 --- /dev/null +++ b/dictionaries/status.php @@ -0,0 +1,38 @@ +<?php + +$lang = array( + 'header_saml20_sp' => array ( + 'en' => 'SAML 2.0 SP Demo Example', + ), + 'header_shib' => array ( + 'en' => 'Shibboleth demo', + ), + 'header_wsfed' => array ( + 'en' => 'WS-Fed SP Demo Example', + ), + 'header_diagnostics' => array ( + 'en' => 'SimpleSAMLphp Diagnostics', + ), + 'some_error_occured' => array ( + 'en' => 'Some error occured', + ), + 'intro' => array ( + 'en' => 'Hi, this is the status page of simpleSAMLphp. Here you can see if your session is timed out, how long it lasts until it times out and all the attributes that is attached to your session.', + ), + 'validfor' => array ( + 'en' => 'Your session is valid for %SECONDS% seconds from now.', + ), + 'sessionsize' => array ( + 'en' => 'Session size: %SIZE%', + ), + 'attributes_header' => array ( + 'en' => 'Your attributes', + ), + 'logout' => array ( + 'en' => 'Logout', + ), + +); + + +?> \ No newline at end of file diff --git a/templates/default/status.php b/templates/default/status.php index 17d562a9217e8dab4bd5406b15a9c3e45d84331c..92f83a03b01cb4f229681570cc19f29d296d204c 100644 --- a/templates/default/status.php +++ b/templates/default/status.php @@ -1,16 +1,28 @@ -<?php $this->includeAtTemplateBase('includes/header.php'); ?> +<?php +if(array_key_exists('header', $this->data)) { + if($this->getTag($this->data['header']) !== NULL) { + $this->data['header'] = $this->t($this->data['header']); + } +} + +$this->includeAtTemplateBase('includes/header.php'); +?> <div id="content"> - <h2><?php if (isset($this->data['header'])) { echo $this->data['header']; } else { echo "Some error occured"; } ?></h2> + <h2><?php if (isset($this->data['header'])) { echo($this->data['header']); } else { echo($this->t('{status:some_error_occured}')); } ?></h2> - <p>Hi, this is the status page of simpleSAMLphp. Here you can see if your session is timed out, how long it lasts until it times out and all the attributes that is attached to your session.</p> + <p><?php echo($this->t('{status:intro}')); ?></p> - <p>Your session is valid for <?php echo $this->data['remaining']; ?> seconds from now.</p> + <p><?php echo($this->t('{status:validfor}', array('%SECONDS%' => $this->data['remaining']))); ?></p> - <p>Session size: <?php echo isset($this->data['sessionsize']) ? $this->data['sessionsize'] : 'na'; ?> + <?php + if(isset($this->data['sessionsize'])) { + echo('<p>' . $this->t('{status:sessionsize}', array('%SIZE%' => $this->data['sessionsize'])) . '</p>'); + } + ?> - <h2>Your attributes</h2> + <h2><?php echo($this->t('{status:attributes_header}')); ?></h2> <table width="100%" class="attributes"> <?php @@ -37,15 +49,19 @@ ?> </table> - <?php if (isset($this->data['logout'])) { ?> - <h2>Logout</h2> +<?php +if (isset($this->data['logout'])) { + echo('<h2>' . $this->t('{status:logout}') . '</h2>'); + echo('<p>' . $this->data['logout'] . '</p>'); +} - <p><?php echo $this->data['logout']; ?></p> +if (isset($this->data['logouturl'])) { + echo('<h2>' . $this->t('{status:logout}') . '</h2>'); + echo('<p>[ <a href="' . htmlspecialchars($this->data['logouturl']) . '">' . $this->t('{status:logout}') . '</a> ]</p>'); +} +?> - <?php } ?> - - <h2>About simpleSAMLphp</h2> - <p>Hey! This simpleSAMLphp thing is pretty cool, where can I read more about it? - You can find more information about simpleSAMLphp at <a href="http://rnd.feide.no">the Feide RnD blog</a> over at <a href="http://uninett.no">UNINETT</a>.</p> + <h2><?php echo $this->t('{frontpage:about_header}'); ?></h2> + <p><?php echo $this->t('{frontpage:about_text}'); ?></p> <?php $this->includeAtTemplateBase('includes/footer.php'); ?> \ No newline at end of file diff --git a/www/example-simple/hostnames.php b/www/example-simple/hostnames.php index 5c0e091fd860278f75157cf271fb02ddbd9c17bb..008d3188bb8432af3a549cd6f0f0c9de68c52dee 100644 --- a/www/example-simple/hostnames.php +++ b/www/example-simple/hostnames.php @@ -41,7 +41,7 @@ $attributes['Utilities_getRequestURI()'] = array(SimpleSAML_Utilities::getReques $et = new SimpleSAML_XHTML_Template($config, 'status.php'); -$et->data['header'] = 'SimpleSAMLphp Diagnostics'; +$et->data['header'] = '{status:header_diagnostics}'; $et->data['remaining'] = 'na'; $et->data['attributes'] = $attributes; $et->data['valid'] = 'na'; diff --git a/www/example-simple/saml2-example.php b/www/example-simple/saml2-example.php index 426be7b1fc263e814097eaff18d49725dcd05854..b656e839957bab782883e3f0ec73c828008ad8a0 100644 --- a/www/example-simple/saml2-example.php +++ b/www/example-simple/saml2-example.php @@ -50,13 +50,13 @@ $attributes = $session->getAttributes(); $t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes'); -$t->data['header'] = 'SAML 2.0 SP Demo Example'; +$t->data['header'] = '{status:header_saml20_sp}'; $t->data['remaining'] = $session->remainingTime(); $t->data['sessionsize'] = $session->getSize(); $t->data['attributes'] = $attributes; $t->data['icon'] = 'bino.png'; -$t->data['logout'] = '[ <a href="/' . $config->getBaseURL() . 'saml2/sp/initSLO.php?RelayState=/' . - $config->getBaseURL() . 'logout.html">Logout</a> ]'; +$t->data['logouturl'] = '/' . $config->getBaseURL() . 'saml2/sp/initSLO.php?RelayState=/' . + $config->getBaseURL() . 'logout.html'; $t->show(); diff --git a/www/example-simple/shib13-example.php b/www/example-simple/shib13-example.php index ecdcafad576c5ddfe93ff38f2ebe1ee178f60914..d35d36e3b5d17d8547ffa7d6fab2f1d92849a97c 100644 --- a/www/example-simple/shib13-example.php +++ b/www/example-simple/shib13-example.php @@ -38,7 +38,7 @@ if (!isset($session) || !$session->isValid('shib13') ) { $t = new SimpleSAML_XHTML_Template($config, 'status.php'); -$t->data['header'] = 'Shibboleth demo'; +$t->data['header'] = '{status:header_shib}'; $t->data['remaining'] = $session->remainingTime(); $t->data['attributes'] = $session->getAttributes(); $t->data['logout'] = null; diff --git a/www/example-simple/wsfed-example.php b/www/example-simple/wsfed-example.php index 0908962ef5ab853334700bc8d3ccb534348e86ae..883d45599b5993c4151528bbdb23043712b16f09 100644 --- a/www/example-simple/wsfed-example.php +++ b/www/example-simple/wsfed-example.php @@ -16,7 +16,7 @@ $attributes = $session->getAttributes(); $t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes'); -$t->data['header'] = 'WS-Fed SP Demo Example'; +$t->data['header'] = '{status:header_wsfed}'; $t->data['remaining'] = $session->remainingTime(); $t->data['sessionsize'] = $session->getSize(); $t->data['attributes'] = $attributes;