diff --git a/modules/consentAdmin/hooks/hook_frontpage.php b/modules/consentAdmin/hooks/hook_frontpage.php index 61c4bd6b1f3b119a47b89efe6321b844d3f41888..9659a869f565e1f11b8cacd1743423c593255601 100644 --- a/modules/consentAdmin/hooks/hook_frontpage.php +++ b/modules/consentAdmin/hooks/hook_frontpage.php @@ -10,6 +10,6 @@ function consentAdmin_hook_frontpage(&$links) { $links['config'][] = array( 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), - 'text' => '{consentAdmin:consentadmin:consentadmin_header}', + 'text' => '{core:frontpage:link_consentAdmin}', ); } diff --git a/modules/core/locales/en/LC_MESSAGES/core.po b/modules/core/locales/en/LC_MESSAGES/core.po index bf9ee93f84563aa26e9c3d3fc638d1737b66bdb9..0c2a4fc64276e21d24eea064c476f38b90043501 100644 --- a/modules/core/locales/en/LC_MESSAGES/core.po +++ b/modules/core/locales/en/LC_MESSAGES/core.po @@ -54,6 +54,30 @@ msgstr "OpenID Provider site - Alpha version (test code)" msgid "{core:frontpage:link_doc_install}" msgstr "Installing SimpleSAMLphp" +msgid "{core:frontpage:link_consentAdmin}" +msgstr "Consent Administration" + +msgid "{core:frontpage:link_memcacheMonitor}" +msgstr "MemCache Statistics" + +msgid "{core:frontpage:link_oauth}" +msgstr "OAuth Consumer Registry" + +msgid "{core:frontpage:link_cron}" +msgstr "Cron module information page" + +msgid "{core:frontpage:link_statistics}" +msgstr "Show statistics" + +msgid "{core:frontpage:link_statistics_metadata}" +msgstr "Show statistics metadata" + +msgid "{core:frontpage:link_metarefresh}" +msgstr "Metarefresh: fetch metadata" + +msgid "{core:frontpage:link_santitycheck}" +msgstr "Sanity check of your SimpleSAMLphp setup" + msgid "{core:frontpage:link_diagnostics}" msgstr "Diagnostics on hostname, port and protocol" diff --git a/modules/core/templates/authsource_list.twig b/modules/core/templates/authsource_list.twig new file mode 100644 index 0000000000000000000000000000000000000000..acf0d57fa51de28382b6bd9c6760723772cf1121 --- /dev/null +++ b/modules/core/templates/authsource_list.twig @@ -0,0 +1,11 @@ +{% set pagetitle = 'Test Authentication Sources'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h1>{{ header }}</h1> + <ul> + {% for key, name in sources %} + <li><a href="?as={{ name|escape('url') }}">{{ name|escape('html') }}</a></li> + {% endfor %} + </ul> +{% endblock %} diff --git a/modules/core/templates/frontpage_auth.twig b/modules/core/templates/frontpage_auth.twig new file mode 100644 index 0000000000000000000000000000000000000000..5767915bb5f7672431cbd92a529efdb863f79954 --- /dev/null +++ b/modules/core/templates/frontpage_auth.twig @@ -0,0 +1,23 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% extends "base.twig" %} + +{% block content %} + {% if isadmin %} + <p class="float-r youareadmin">{{ '{core:frontpage:loggedin_as_admin}'|trans }}</p> + {% else %} + <p class="float-r youareadmin"> + <a href="{{ loginurl|escape('url') }}">{{ '{core:frontpage:login_as_admin}'|trans }}</a> + </p> + {% endif %} + + <ul> + {% for key, link in links_auth %} + <li> + <a href="{{ link.href|escape('url') }}">{{ link.text|trans|escape('html') }}</a> + {% if link.deprecated is defined and link.deprecated is not empty %} + <span style="font-weight: bold;">{{ '{core:frontpage:deprecated}'|trans }}</b> + {% endif %} + </li> + {% endfor %} + </ul> +{% endblock %} diff --git a/modules/core/templates/frontpage_config.tpl.php b/modules/core/templates/frontpage_config.tpl.php index 4bf19eff9390aa5086561ed410b0f33ca5f7035b..aeaa64af1d337a26f992286681715319f2da1c97 100644 --- a/modules/core/templates/frontpage_config.tpl.php +++ b/modules/core/templates/frontpage_config.tpl.php @@ -40,11 +40,11 @@ if ($this->data['isadmin']) { $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="disabled" />'; ?> - <tr class="<?php echo $this->data['enablematrix']['saml20-idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td> - <td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> + <tr class="<?php echo $this->data['enablematrix']['saml20idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td> + <td><?php echo $this->data['enablematrix']['saml20idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> - <tr class="<?php echo $this->data['enablematrix']['shib13-idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td> - <td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> + <tr class="<?php echo $this->data['enablematrix']['shib13idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td> + <td><?php echo $this->data['enablematrix']['shib13idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> </table> </div> diff --git a/modules/core/templates/frontpage_config.twig b/modules/core/templates/frontpage_config.twig new file mode 100644 index 0000000000000000000000000000000000000000..fc702d90843e3564de9d3564479de5d49332f5ee --- /dev/null +++ b/modules/core/templates/frontpage_config.twig @@ -0,0 +1,65 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% extends "base.twig" %} + +{% block content %} + {% if isadmin %} + <p class="float-r youareadmin">{{ '{core:frontpage:loggedin_as_admin}'|trans }}</p> + {% else %} + <p class="float-r youareadmin"> + <a href="{{ loginurl|escape('url') }}">{{ '{core:frontpage:login_as_admin}'|trans }}</a> + </p> + {% endif %} + + <div style="margin-top: 1em;"> + <code style="background: white; background: #f5f5f5; border: 1px dotted #bbb; padding: 1em; color: #555" >{{ directory }} ({{ version }})</code> + </div> + + {% set icon_enabled = '<img src="/' ~ baseurlpath ~ 'resources/icons/silk/accept.png" alt="enabled" />' %} + {% set icon_disabled = '<img src="/' ~ baseurlpath ~ 'resources/icons/silk/delete.png" alt="disabled" />' %} + + <div style="clear: both" class="enablebox mini"> + <table> + <tr class="{%- if enablematrix.saml20idp %}enabled{% else %}disabled{% endif -%}"> + <td>SAML 2.0 IdP</td> + <td>{%- if enablematrix.saml20idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + </tr> + <tr class="{%- if enablematrix.shib13idp %}enabled{% else %}disabled{% endif -%}"> + <td>Shib 1.3 IdP</td> + <td>{%- if enablematrix.shib13idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + </tr> + </table> + </div> + + <h2>{{ '{core:frontpage:configuration}'|trans }}</h2> + <ul> + {% for key, link in links_config %} + <li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li> + {% endfor %} + </ul> + + {% if warnings is defined and warnings is not empty %} + <h2>{{ '{core:frontpage:warnings}'|trans|escape('html') }}</h2> + {% for key, warning in warnings %} + {% if warning is iterable %} + <div class="caution">{{ warning[0]|trans(warning[1], "app")|raw }}</div> + {% else %} + <div class="caution">{{ warning|trans|raw }}</div> + {% endif %} + {% endfor %} + {% endif %} + + {% if isadmin %} + <h2>{{ '{core:frontpage:checkphp}'|trans }}</h2> + <div class="enablebox"> + <table> + {% for key, func in funcmatrix %} + <tr class="{%- if func.enabled %}enabled{% else %}disabled{% endif -%}"> + <td>{%- if func.enabled %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + <td>{{ requiredmap[func.required]|trans }}</td> + <td>{{ func.descr }}</td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} +{% endblock %} diff --git a/modules/core/www/authenticate.php b/modules/core/www/authenticate.php index 8e04e4a6cfa45f14af92bcbad1e984a7361ad548..d09947b364d0c88853c6dd981d6626be1abde339 100644 --- a/modules/core/www/authenticate.php +++ b/modules/core/www/authenticate.php @@ -5,6 +5,7 @@ $config = SimpleSAML_Configuration::getInstance(); if (!array_key_exists('as', $_REQUEST)) { $t = new SimpleSAML_XHTML_Template($config, 'core:authsource_list.tpl.php'); + $t->data['header'] = 'Test authentication sources'; $t->data['sources'] = SimpleSAML_Auth_Source::getSources(); $t->show(); exit(); diff --git a/modules/core/www/frontpage_auth.php b/modules/core/www/frontpage_auth.php index 59e0ee8a5daa181b6ef9d154010ed805ce52807c..01bd36852b669c6c964239c14e0c28ce5cd1a34c 100644 --- a/modules/core/www/frontpage_auth.php +++ b/modules/core/www/frontpage_auth.php @@ -44,14 +44,13 @@ $t->data['pageid'] = 'frontpage_auth'; $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; +$t->data['header'] = $t->t('{core:frontpage:page_title}'); $t->data['links'] = $links; $t->data['links_welcome'] = $links_welcome; $t->data['links_config'] = $links_config; $t->data['links_auth'] = $links_auth; $t->data['links_federation'] = $links_federation; - - $t->show(); diff --git a/modules/core/www/frontpage_config.php b/modules/core/www/frontpage_config.php index 776b9e074c117a3bb446f9524303a77817660163..e12a6704a729c294caeb312f0872158e10b0090d 100644 --- a/modules/core/www/frontpage_config.php +++ b/modules/core/www/frontpage_config.php @@ -74,6 +74,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp'); curl_setopt($ch, CURLOPT_TIMEOUT, 2); + curl_setopt($ch, CURLOPT_PROXY, $config->getString('proxy', null)); + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config->getstring('proxy.auth', null)); $response = curl_exec($ch); if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) { @@ -93,8 +95,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') } $enablematrix = array( - 'saml20-idp' => $config->getBoolean('enable.saml20-idp', false), - 'shib13-idp' => $config->getBoolean('enable.shib13-idp', false), + 'saml20idp' => $config->getBoolean('enable.saml20-idp', false), + 'shib13idp' => $config->getBoolean('enable.shib13-idp', false), ); @@ -172,6 +174,7 @@ $funcmatrix[] = array( $t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_config.tpl.php'); $t->data['pageid'] = 'frontpage_config'; +$t->data['header'] = $t->t('{core:frontpage:page_title}'); $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; $t->data['warnings'] = $warnings; diff --git a/modules/cron/hooks/hook_frontpage.php b/modules/cron/hooks/hook_frontpage.php index d4d11edd09aae31994ff2563db64c595df60323b..340b01636df85feda476c725bd003b04f56d48a0 100644 --- a/modules/cron/hooks/hook_frontpage.php +++ b/modules/cron/hooks/hook_frontpage.php @@ -10,7 +10,7 @@ function cron_hook_frontpage(&$links) { $links['config'][] = array( 'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), - 'text' => array('en' => 'Cron module information page'), + 'text' => '{core:frontpage:link_cron}', ); } diff --git a/modules/memcacheMonitor/hooks/hook_frontpage.php b/modules/memcacheMonitor/hooks/hook_frontpage.php index fa0d4503809806c67683ae1418fc5c7a511d1194..526359b05bfcde960ea89f88832c5a38ad2e5508 100644 --- a/modules/memcacheMonitor/hooks/hook_frontpage.php +++ b/modules/memcacheMonitor/hooks/hook_frontpage.php @@ -10,7 +10,7 @@ function memcacheMonitor_hook_frontpage(&$links) { $links['config'][] = array( 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), - 'text' => array('en' => 'MemCache Statistics'), + 'text' => '{core:frontpage:link_memcacheMonitor}', ); } diff --git a/modules/metarefresh/hooks/hook_frontpage.php b/modules/metarefresh/hooks/hook_frontpage.php index 60e7aef5e002c1b218ec9c5c5c336d57e7ed1d2f..ee378dec9ddf34280f7b1fda282310e4c9f177a4 100644 --- a/modules/metarefresh/hooks/hook_frontpage.php +++ b/modules/metarefresh/hooks/hook_frontpage.php @@ -10,7 +10,7 @@ function metarefresh_hook_frontpage(&$links) { $links['federation'][] = array( 'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'), - 'text' => array('en' => 'Metarefresh: fetch metadata'), + 'text' => '{core:frontpage:link_metarefresh}', ); } diff --git a/modules/oauth/hooks/hook_frontpage.php b/modules/oauth/hooks/hook_frontpage.php index 2339b3b0c26833852838cbd58bb7f9e2c746f74d..23ebb76d541025c90d8ea91b8c7c9fa18abbcbb9 100644 --- a/modules/oauth/hooks/hook_frontpage.php +++ b/modules/oauth/hooks/hook_frontpage.php @@ -11,7 +11,6 @@ function oauth_hook_frontpage(&$links) $links['federation']['oauthregistry'] = array( 'href' => SimpleSAML\Module::getModuleURL('oauth/registry.php'), - 'text' => array('en' => 'OAuth Consumer Registry'), - 'shorttext' => array('en' => 'OAuth Registry'), + 'text' => '{core:frontpage:link_oauth}', ); } diff --git a/modules/sanitycheck/hooks/hook_frontpage.php b/modules/sanitycheck/hooks/hook_frontpage.php index b713601180f28a22036c800eb7bfa0e57d5e50c8..bec44d74c66445dbeb41fc9d9575d772a6e11109 100644 --- a/modules/sanitycheck/hooks/hook_frontpage.php +++ b/modules/sanitycheck/hooks/hook_frontpage.php @@ -11,7 +11,6 @@ function sanitycheck_hook_frontpage(&$links) $links['config']['santitycheck'] = array( 'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'), - 'text' => array('en' => 'Sanity check of your SimpleSAMLphp setup'), - 'shorttext' => array('en' => 'SanityCheck'), + 'text' => '{core:frontpage:link_santitycheck}', ); } diff --git a/modules/statistics/hooks/hook_frontpage.php b/modules/statistics/hooks/hook_frontpage.php index 03a97aa52bdb5013f3fb2f2faa785940c355d010..a97da1f2c5f31ee8b900b6b3eb0aba82c1a3e2f0 100644 --- a/modules/statistics/hooks/hook_frontpage.php +++ b/modules/statistics/hooks/hook_frontpage.php @@ -11,12 +11,11 @@ function statistics_hook_frontpage(&$links) $links['config']['statistics'] = array( 'href' => SimpleSAML\Module::getModuleURL('statistics/showstats.php'), - 'text' => array('en' => 'Show statistics', 'no' => 'Vis statistikk'), - 'shorttext' => array('en' => 'Statistics', 'no' => 'Statistikk'), + 'text' => '{core:frontpage:link_statistics}', ); $links['config']['statisticsmeta'] = array( 'href' => SimpleSAML\Module::getModuleURL('statistics/statmeta.php'), - 'text' => array('en' => 'Show statistics metadata', 'no' => 'Vis statistikk metadata'), + 'text' => '{core:frontpage:link_statistics_metadata}', 'shorttext' => array('en' => 'Statistics metadata', 'no' => 'Statistikk metadata'), ); }