diff --git a/config/config-template.php b/config/config-template.php index cc7e31b563cc86dbd56c07e321a9fa3483114c24..5de071cf1218ece008604972978c25bcd9f17b3f 100644 --- a/config/config-template.php +++ b/config/config-template.php @@ -34,6 +34,8 @@ $config = array ( */ 'debug' => false, + 'version' => '0.9', + /* * Logging. * @@ -107,7 +109,6 @@ $config = array ( * Options: [links,dropdown] * */ - #'idpdisco.layout' => 'dropdown', 'idpdisco.layout' => 'links', diff --git a/templates/default/en/admin-metadatalist.php b/templates/default/en/admin-metadatalist.php index 3c2043deaa115ae535bf16f3255a49f715cbcd88..8c0f087f7c0b7409ef2cf23ef0dc6d01ab8fda0f 100644 --- a/templates/default/en/admin-metadatalist.php +++ b/templates/default/en/admin-metadatalist.php @@ -1,18 +1,9 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>Metadata overview</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> - <h2><?php if (isset($data['header'])) { echo $data['header']; } else { echo "Metadata overview"; } ?></h2> - - <p>Here is a list of metadata that is configured for your installation.</p> - - <p>[ <a href="../">Go back to installation main page</a> ]</p> - + <?php @@ -31,32 +22,41 @@ echo '<p>' . htmlspecialchars($entity['optional.found']['description']) . '</p>'; } - echo '<p>Required fields</p>'; - echo '<table style="width: 100%; border: 1px solid #eee"><tr><th>Key</th><th>Value</th></tr>'; + echo '<div style="margin-left: 1em">'; + echo '<div class="efieldlist"><h5>Required fields<h5>'; + echo '<dl>'; foreach ($entity['required.found'] AS $key => $value) { - echo '<tr><td>' . htmlspecialchars($key) . '</td><td>' . htmlspecialchars($value) . '</td></tr>'; + echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars($value) . '</dd>'; } - echo '</table>'; + echo '</dl>'; + + if (count($entity['required.notfound']) > 0) { - echo '<p>The following required fields was not found:<ul>'; + echo '</div><div class="efieldlist warning">'; + echo '<h5>The following required fields was not found</h5><ul>'; foreach ($entity['required.notfound'] AS $key) { echo '<li>' . htmlspecialchars($key) . '</li>'; } echo '</ul>'; } + if (count($entity['optional.found']) > 0) { - echo '<p>Optional fields</p>'; - echo '<table><tr><th>Key</th><th>Value</th></tr>'; + echo '</div><div class="efieldlist">'; + echo '<h5>Optional fields</h5>'; + echo '<dl>'; foreach ($entity['optional.found'] AS $key => $value) { - echo '<tr><td>' . htmlspecialchars($key) . '</td><td>' . htmlspecialchars($value) . '</td></tr>'; + echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars($value) . '</dd>'; } - echo '</table>'; + echo '</dl>'; } + + if (count($entity['optional.notfound']) > 0) { - echo '<p>The following optional fields was not found:<ul>'; + echo '</div><div class="efieldlist info">'; + echo '<h5>The following optional fields was not found:</h5><ul>'; foreach ($entity['optional.notfound'] AS $key) { echo '<li>' . htmlspecialchars($key) . '</li>'; } @@ -64,13 +64,14 @@ } if (count($entity['leftovers']) > 0) { - echo '<p>The following fields was not reckognized:<ul>'; + echo '</div><div class="efieldlist warning">'; + echo '<h5>The following fields was not reckognized</h5><ul>'; foreach ($entity['leftovers'] AS $key => $value) { echo '<li>' . htmlspecialchars($key) . '</li>'; } echo '</ul>'; } - + echo '</div></div>'; } } diff --git a/templates/default/en/consent.php b/templates/default/en/consent.php index ec71aaa567e0cf0a54cf21902671d5ce43e5c691..532063669f30a39629d8672db32a1f33d3894d8d 100644 --- a/templates/default/en/consent.php +++ b/templates/default/en/consent.php @@ -1,10 +1,6 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>User consent on attribute release</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> - + <div id="content"> <p>You are about to login to the service <strong><?php echo htmlspecialchars($data['spentityid']); ?></strong>. In the login proccess, the identity provider will send attributes containing information about your identity to this service. Do you accept this?</p> diff --git a/templates/default/en/error.php b/templates/default/en/error.php index 20dacc659705bdc1bb188520860154a1278237b1..4e32e0a64466c736fc3c3578b544ff4c17b39d51 100644 --- a/templates/default/en/error.php +++ b/templates/default/en/error.php @@ -1,10 +1,6 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp error page</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bomb_l.png" alt="Login screen" /></div> - </div> - + <div id="content"> diff --git a/templates/default/en/frontpage.php b/templates/default/en/frontpage.php index ae757d2ea2b9b4c4e9cc4eebdcff4756c431f032..f3a424d69a7c814bb5c0218010b258ba127cc2e8 100644 --- a/templates/default/en/frontpage.php +++ b/templates/default/en/frontpage.php @@ -1,17 +1,10 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp is installed</h1> - <div id="poweredby"><img src="resources/icons/compass_l.png" alt="Bino" /></div> - </div> - <div id="content"> <h2>Welcome to simpleSAMlphp</h2> - <p>You have installed simpleSAMLphp on this web host.</p> - - <p>Relevant links for your installation: + <p>You have installed simpleSAMLphp on this web host. Here are some relevant links for your installation: <ul> <?php @@ -19,27 +12,13 @@ echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . htmlspecialchars($link['text']) . '</a></li>'; } ?> - <!-- li><a href="saml2/sp/metadata.php">Look at your SAML 2.0 SP metadata</a> - you can send this metadata document to your IdP.</a></li> - <li><a href="saml2/idp/metadata.php">Look at your SAML 2.0 IdP metadata</a></a></li> - <li><a href="example-simple/saml2-example.php">SAML 2.0 SP example</a></li> - <li><a href="example-simple/shib13-example.php">Shibboleth 1.3 SP example</a></li> - <li><a href="openid/provider/server.php">OpenID Provider site</a></li --> - </ul> - </p> - - <h2>Diagnostics</h2> - <p>Here are some help tools to diagnose what is wrong if things do not work as expected.</p> - - <p>Misconfiguration of NameVirtualHosts and similar things are pretty common in Apache. simpleSAMLphp relies on getting correct information from Apache what relates to port number information about ssl and so on. Here is a diagnostics page that shows what simpleSAMLphp is getting from Apache: - <ul> - <li><a href="example-simple/hostnames.php">Diagnostics on hostname, port and protocol</a></li> </ul> </p> - + <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> + You can find more information about <a href="http://rnd.feide.no/simplesamlphp">simpleSAMLphp at the Feide RnD blog</a> over at <a href="http://uninett.no">UNINETT</a>.</p> <?php $this->includeAtTemplateBase('includes/footer.php'); ?> \ No newline at end of file diff --git a/templates/default/en/httpredirect-debug.php b/templates/default/en/httpredirect-debug.php index 508ad13e1de56ef9bd09bc2330dfccc79e5e68b1..fdff69ac31d2fde0d21cba0b1b1748103c46300f 100644 --- a/templates/default/en/httpredirect-debug.php +++ b/templates/default/en/httpredirect-debug.php @@ -1,10 +1,6 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp HTTP-REDIRECT debug</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/debug.png" alt="Debug" /></div> - </div> - + <div id="content"> diff --git a/templates/default/en/login-ldapmulti.php b/templates/default/en/login-ldapmulti.php index 9f3d4cdfcca3b353a1f93be594971b62dfe669bc..6f811f27cd339ea919e0fc8988d2421b7cb1aa9b 100644 --- a/templates/default/en/login-ldapmulti.php +++ b/templates/default/en/login-ldapmulti.php @@ -1,9 +1,8 @@ -<?php $this->includeAtTemplateBase('includes/header.php'); ?> +<?php + if (!array_key_exists('icon', $this->data)) $this->data['icon'] = 'lock.png'; + $this->includeAtTemplateBase('includes/header.php'); +?> - <div id="header"> - <h1>simpleSAMLphp authentication</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/lock.png" alt="Login screen" /></div> - </div> <div id="content"> diff --git a/templates/default/en/login.php b/templates/default/en/login.php index a4389e772a5e523a649db6f8c44243fecfe7a435..ef538a875f27c555f228c2ac96e0200eba49947a 100644 --- a/templates/default/en/login.php +++ b/templates/default/en/login.php @@ -1,10 +1,8 @@ -<?php $this->includeAtTemplateBase('includes/header.php'); ?> +<?php + if (!array_key_exists('icon', $this->data)) $this->data['icon'] = 'lock.png'; + $this->includeAtTemplateBase('includes/header.php'); +?> - <div id="header"> - <h1>simpleSAMLphp authentication</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/lock.png" alt="Login screen" /></div> - </div> - <div id="content"> <?php if (isset($data['error'])) { ?> diff --git a/templates/default/en/metadata.php b/templates/default/en/metadata.php index e237f27f3b9297a26eacc76c616d232bbbcd0c0a..7559cd6468ac86fab586632392951d789483c280 100644 --- a/templates/default/en/metadata.php +++ b/templates/default/en/metadata.php @@ -1,10 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp Metadata</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> - <div id="content"> <h2><?php if (isset($data['header'])) { echo $data['header']; } else { echo "Some error occured"; } ?></h2> diff --git a/templates/default/en/openid-about.php b/templates/default/en/openid-about.php index 52e97dfc9ea65ab4f193083749519e8d3d78a747..7fc99432bb4e83242b01044dc8f1eecd2dcf6d66 100644 --- a/templates/default/en/openid-about.php +++ b/templates/default/en/openid-about.php @@ -1,9 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp OpenID</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> diff --git a/templates/default/en/openid-sites.php b/templates/default/en/openid-sites.php index 1040218b4f93b1f80e98a21d637abe8b6797ae81..7a09d5f5e396e1e10ede9d2e663aef9123a68097 100644 --- a/templates/default/en/openid-sites.php +++ b/templates/default/en/openid-sites.php @@ -1,9 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp OpenID</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> diff --git a/templates/default/en/openid-trust.php b/templates/default/en/openid-trust.php index 3b05e3a1028ea10bbeea66e06538fb5e7df0a688..92662c7b7897f99f123726909d9c4f4c5a44cd95 100644 --- a/templates/default/en/openid-trust.php +++ b/templates/default/en/openid-trust.php @@ -1,9 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp OpenID</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> diff --git a/templates/default/en/post-debug.php b/templates/default/en/post-debug.php index 2228f63d01d9631a4c72a025d5ff92727e418237..ed4e269ac1f99b7b8d9170ab3ac03ed0599a1ccb 100644 --- a/templates/default/en/post-debug.php +++ b/templates/default/en/post-debug.php @@ -1,9 +1,6 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp authentication</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/debug.png" alt="Debug" /></div> - </div> + <div id="content"> diff --git a/templates/default/en/selectidp-dropdown.php b/templates/default/en/selectidp-dropdown.php index c34af28f7cb538de5145c7117e3390b51317fc43..51964b36e5ccd93d29068450a7ca2694e9ac3076 100644 --- a/templates/default/en/selectidp-dropdown.php +++ b/templates/default/en/selectidp-dropdown.php @@ -1,9 +1,6 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>SAML 2.0 IdP Discovery Service</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> + <div id="content"> diff --git a/templates/default/en/selectidp-links.php b/templates/default/en/selectidp-links.php index a8e2b5bcd4354ae44143995d619792c956ee4161..7d5cf1ec5cfd7c04019bf9de1796f9ed4a0715ae 100644 --- a/templates/default/en/selectidp-links.php +++ b/templates/default/en/selectidp-links.php @@ -1,9 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>SAML 2.0 IdP Discovery Service</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> diff --git a/templates/default/en/status.php b/templates/default/en/status.php index 0929302f1b1eb00d45dbd7d814273b9b250fc21e..da93738c16bbcff7539f11bbe5f94b76c78daabc 100644 --- a/templates/default/en/status.php +++ b/templates/default/en/status.php @@ -1,9 +1,5 @@ <?php $this->includeAtTemplateBase('includes/header.php'); ?> - <div id="header"> - <h1>simpleSAMLphp status page</h1> - <div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/bino.png" alt="Bino" /></div> - </div> <div id="content"> diff --git a/templates/default/includes/header.php b/templates/default/includes/header.php index 7a537121ef32530bc7e03f005abf2997fffb4039..a6347b6bab4d4a81ad7b948ffee08b6b037348a1 100644 --- a/templates/default/includes/header.php +++ b/templates/default/includes/header.php @@ -10,52 +10,24 @@ if(array_key_exists('header', $data)) { } ?></title> -<style type="text/css"> - -/* these styles are in the head of this page because this is a unique page */ - -/* THE BIG GUYS */ -* {margin:0;padding:0} -body {text-align:center;padding: 20px 0;background: #222;color:#333;font:83%/1.5 arial,tahoma,verdana,sans-serif} -img {border:none;display:block} -hr {margin: 1em 0;background:#eee;height:1px;color:#eee;border:none;clear:both} - -/* LINKS */ -a,a:link,a:link,a:link,a:hover {font-weight:bold;background:transparent;text-decoration:underline;cursor:pointer} -a:link {color:#c00} -a:visited {color:#999} -a:hover,a:active {color:#069} - -/* LISTS */ -ul {margin: .3em 0 1.5em 2em} - ul.related {margin-top:-1em} -li {margin-left:2em} -dt {font-weight:bold} -#wrap {border: 1px solid #fff;position:relative;background:#fff;width:600px;margin: 0 auto;text-align:left} -#header {background: #666 url("/<?php echo $data['baseurlpath']; ?>resources/sprites.gif") repeat-x 0 100%;margin: 0 0 25px;padding: 0 0 8px} -#header h1 {color:#fff;font-size: 145%;padding:20px 20px 12px} -#poweredby {width:96px;height:63px;position:absolute;top:0;right:0} -#content {padding: 0 20px} - -/* TYPOGRAPHY */ -p, ul, ol {margin: 0 0 1.5em} -h1, h2, h3, h4, h5, h6 {letter-spacing: -1px;font-family: arial,verdana,sans-serif;margin: 1.2em 0 .3em;color:#000;border-bottom: 1px solid #eee;padding-bottom: .1em} -h1 {font-size: 196%;margin-top:0;border:none} -h2 {font-size: 136%} -h3 {font-size: 126%} -h4 {font-size: 116%} -h5 {font-size: 106%} -h6 {font-size: 96%} - -.old {text-decoration:line-through} -</style> + <link rel="stylesheet" type="text/css" href="/<?php echo $data['baseurlpath']; ?>resources/default.css"> <link rel="icon" type="image/icon" href="/<?php echo $data['baseurlpath']; ?>resources/icons/favicon.ico" /> </head> <body> <div id="wrap"> - + <div id="header"> + <h1><a style="text-decoration: none; color: white" href="/<?php echo $data['baseurlpath']; ?>"><?php + echo (isset($data['header']) ? $data['header'] : 'simpleSAMLphp'); + ?></a></h1> + <div id="poweredby"> + <a href="/<?php echo $data['baseurlpath']; ?>"> + <img src="/<?php echo $data['baseurlpath']; ?>resources/icons/<?php + echo (isset($data['icon']) ? $data['icon'] : 'compass_l.png'); + ?>" alt="Header icon" /></a></div> + </div> + <?php $languages = $this->getLanguageList(); diff --git a/www/admin/metadata.php b/www/admin/metadata.php index 2580ac876be107c3d56624653fddd077d509d7ac..bcbb3e734b6a7483b34e4952427b865283ee2aef 100644 --- a/www/admin/metadata.php +++ b/www/admin/metadata.php @@ -124,12 +124,8 @@ try { } - - - - - $et->data['header'] = 'Metadata overview'; + $et->data['icon'] = 'bino.png'; $et->show(); diff --git a/www/example-simple/saml2-example.php b/www/example-simple/saml2-example.php index 0373563aa57f575993ad77550f9339c45aeabcd6..e801e80686ed3fa804e0903b9df4904c87343739 100644 --- a/www/example-simple/saml2-example.php +++ b/www/example-simple/saml2-example.php @@ -41,7 +41,7 @@ $et->data['remaining'] = $session->remainingTime(); $et->data['sessionsize'] = $session->getSize(); $et->data['attributes'] = $attributes; $et->data['valid'] = $session->isValid() ? 'Session is valid' : 'Session is invalid'; - + $et->data['icon'] = 'bino.png'; $et->data['logout'] = '<p>[ <a href="/' . $config->getValue('baseurlpath') . 'saml2/sp/initSLO.php?RelayState=/' . $config->getValue('baseurlpath') . 'logout.html">Logout</a> ]'; diff --git a/www/example-simple/shib13-example.php b/www/example-simple/shib13-example.php index 54010fc45e56da53d0c2eee64c9f1542f6278d59..74d197a8075fd9476d90c04c8f089073e631207e 100644 --- a/www/example-simple/shib13-example.php +++ b/www/example-simple/shib13-example.php @@ -32,7 +32,7 @@ $et->data['remaining'] = $session->remainingTime(); $et->data['attributes'] = $session->getAttributes(); $et->data['valid'] = $session->isValid() ? 'Session is valid' : 'Session is invalid'; $et->data['logout'] = 'Shibboleth logout not implemented yet.'; - + $et->data['icon'] = 'bino.png'; $et->show(); diff --git a/www/index.php b/www/index.php index 7395a6eb03933aa4ce153fcdf132abc9aec864b9..449e72ec23d40bd9ea1d2c124f9fbf4f95045f85 100644 --- a/www/index.php +++ b/www/index.php @@ -15,10 +15,6 @@ $config = SimpleSAML_Configuration::getInstance(); $session = SimpleSAML_Session::getInstance(true); /* Check if valid local session exists.. */ - - - - if ($config->getValue('admin.protectindexpage', false)) { if (!isset($session) || !$session->isValid('login-admin') ) { SimpleSAML_Utilities::redirect('/' . $config->getValue('baseurlpath') . 'auth/login-admin.php', @@ -49,10 +45,13 @@ if ($config->getValue('enable.shib13-sp') === true) if ($config->getValue('enable.openid-provider') === true) $links[] = array('href' => 'openid/provider/server.php', 'text' => 'OpenID Provider site - Alpha version (test code)'); +$links[] = array('href' => 'example-simple/hostnames.php', 'text' => 'Diagnostics on hostname, port and protocol'); $t = new SimpleSAML_XHTML_Template($config, 'frontpage.php'); $t->data['header'] = 'simpleSAMLphp installation page'; +$t->data['icon'] = 'compass_l.png'; $t->data['links'] = $links; + $t->show(); diff --git a/www/saml2/idp/metadata.php b/www/saml2/idp/metadata.php index 54176230ba320b328458b1c584a0993b52f9d47f..d77de77293e4299a52969dac6f92b5a10a5d51f0 100644 --- a/www/saml2/idp/metadata.php +++ b/www/saml2/idp/metadata.php @@ -7,6 +7,8 @@ require_once('SimpleSAML/Session.php'); require_once('SimpleSAML/Metadata/MetaDataStorageHandler.php'); require_once('SimpleSAML/XHTML/Template.php'); +require_once('xmlseclibs.php'); + /* Load simpleSAMLphp, configuration and metadata */ $config = SimpleSAML_Configuration::getInstance(); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();