diff --git a/dictionaries/frontpage.php b/dictionaries/frontpage.php index 8640710bfce59158e71dbdd692c30dd90d833084..86cd113cdc658912e93805ba430fbc21827d0473 100644 --- a/dictionaries/frontpage.php +++ b/dictionaries/frontpage.php @@ -64,4 +64,77 @@ $lang = array( 'no' => '<strong>Du benytter ikke HTTPS</strong> - kryptert kommunikasjon med brukeren. Det vil fungere utmerket å benytte simpleSAMLphp uten HTTPS til testformål, men dersom du skal bruke simpleSAMLphp i et produksjonsmiljø, vil vi sterkt anbefale å skru på sikker kommunikasjon med HTTPS. [ <a href="http://rnd.feide.no/content/simplesamlphp-maintenance-and-configuration">les mer i dokumentet: simpleSAMLphp maintenance</a> ]', ), + + 'link_saml2example' => array( + 'en' => 'SAML 2.0 SP example - test logging in through your IdP', + 'no' => 'SAML 2.0 SP eksempel - test innlogging med SAML 2.0 via din IdP', + ), + 'link_shib13example' => array( + 'en' => 'Shibboleth 1.3 SP example - test logging in through your Shib IdP', + 'no' => 'Shibboleth 1.3 SP eksempel - test innlogging med Shibboleth 1.3 via din IdP', + ), + 'link_openidprovider' => array( + 'en' => 'OpenID Provider site - Alpha version (test code)', + 'no' => 'OpenID Provider side - Alpha versjon (testkode)', + ), + 'link_diagnostics' => array( + 'en' => 'Diagnostics on hostname, port and protocol', + 'no' => 'Diagnostiser hostnavn, port og protokoll', + ), + 'link_phpinfo' => array( + 'en' => 'PHPinfo', + 'no' => 'PHPinfo', + ), + + 'link_meta_overview' => array( + 'en' => 'Meta data overview for your installation. Diagnose your meta data files', + 'no' => 'Oversikt over metadata for din instalasjon. Diagnostiser metadatafilene her.' + ), + + 'link_meta_saml2sphosted' => array( + 'en' => 'Hosted SAML 2.0 Service Provider Metadata (automatically generated)', + 'no' => 'Hosted SAML 2.0 Service Provider Metadata (automatisk generert)', + ), + 'link_meta_saml2idphosted' => array( + 'en' => 'Hosted SAML 2.0 Identity Provider Metadata (automatically generated)', + 'no' => 'Hosted SAML 2.0 Identity Provider Metadata (automatisk generert)', + ), + 'link_meta_shib13sphosted' => array( + 'en' => 'Hosted Shibboleth 1.3 Service Provider Metadata (automatically generated)', + 'no' => 'Hosted Shibboleth 1.3 Service Provider Metadata (automatisk generert)', + ), + 'link_meta_shib13idphosted' => array( + 'en' => 'Hosted Shibboleth 1.3 Identity Provider Metadata (automatically generated)', + 'no' => 'Hosted Shibboleth 1.3 Identity Provider Metadata (automatisk generert)', + ), + 'link_xmlconvert' => array( + 'en' => 'XML to simpleSAMLphp metadata converter', + 'no' => 'XML til simpleSAMLphp metadata oversetter', + ), + + + 'link_doc_install' => array( + 'en' => 'Installing simpleSAMLphp', + ), + 'link_doc_sp' => array( + 'en' => 'Using simpleSAMLphp as a Service Provider', + ), + 'link_doc_idp' => array( + 'en' => 'Using simpleSAMLphp as an Identity Provider', + ), + 'link_doc_shibsp' => array( + 'en' => 'Configure Shibboleth 1.3 SP to work with simpleSAMLphp IdP', + ), + 'link_doc_googleapps' => array( + 'en' => 'simpleSAMLphp as an IdP for Google Apps for Education', + ), + 'link_doc_advanced' => array( + 'en' => 'simpleSAMLphp Advanced Features', + ), + 'link_doc_maintenance' => array( + 'en' => 'simpleSAMLphp Maintenance and Configuration' + ), + + + ); \ No newline at end of file diff --git a/dictionaries/login.php b/dictionaries/login.php new file mode 100644 index 0000000000000000000000000000000000000000..8696635c116cb3ede2c267ba73c3a6f895cc65e8 --- /dev/null +++ b/dictionaries/login.php @@ -0,0 +1,42 @@ +<?php + +$lang = array( + + + 'error_header' => array( + 'en' => 'What you entered was not accepted!', + 'no' => 'Feil under innlogging', + ), + 'user_pass_header' => array( + 'en' => 'Enter your username and password', + 'no' => 'Skriv inn brukernavn og passord', + ), + 'user_pass_text' => array( + 'en' => 'A service has requested you to authenticate your self. That means you need to enter your username and password in the form below.', + 'no' => 'En tjeneste har forespurt autentisering av deg. Det betyr at du må skriv inn ditt brukernavn og passord for å autentisere deg.', + ), + 'login_button' => array( + 'en' => 'Login', + 'no' => 'Logg inn', + ), + 'username' => array( + 'en' => 'Username', + 'no' => 'Brukernavn', + ), + 'password' => array( + 'en' => 'Password', + 'no' => 'Passord', + ), + + 'help_header' => array( + 'en' => 'Help! I don\'t remember my password.', + 'no' => 'Hjelp! Jeg har glemt passordet mitt', + ), + 'help_text' => array( + 'en' => 'Too bad! - Without your username and password you cannot authenticate your self and access the service. + There may be someone that can help you. Contact the help desk at your university!', + 'no' => 'Synd! - Uten riktig brukernavn og passord kan du ikke autentisere deg. Det kan være noen som kan hjelpe deg. Forsøk å kontakt help-desk hos din hjemmeorganisasjon.', + ), + + +); \ No newline at end of file diff --git a/templates/default/frontpage.php b/templates/default/frontpage.php index f02de97fc3e9568e21ece67dcb1555710d43e955..0f55210fcfb6eea5ad76a832a90e458f4d77cb02 100644 --- a/templates/default/frontpage.php +++ b/templates/default/frontpage.php @@ -37,7 +37,7 @@ $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/d <?php foreach ($this->data['links'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . htmlspecialchars($link['text']) . '</a></li>'; + echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>'; } ?> </ul> @@ -48,7 +48,7 @@ $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/d <?php foreach ($this->data['links_meta'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . htmlspecialchars($link['text']) . '</a></li>'; + echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>'; } ?> </ul> @@ -58,7 +58,7 @@ $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/d <?php foreach ($this->data['links_doc'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . htmlspecialchars($link['text']) . '</a></li>'; + echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>'; } ?> </ul> diff --git a/templates/default/includes/header.php b/templates/default/includes/header.php index c10c90d99417779e4c432d7af5d286635c1de70f..97ff89688a2a0a2cdaec18978c6eabc4a5cb568d 100644 --- a/templates/default/includes/header.php +++ b/templates/default/includes/header.php @@ -40,14 +40,16 @@ $langnames = array( ); if (empty($_POST) ) { + $textarray = array(); foreach ($languages AS $lang => $current) { if ($current) { - echo $langnames[$lang] . ' | '; + $textarray[] = $langnames[$lang]; } else { - echo '<a href="' . htmlspecialchars(SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), 'language=' . $lang)) . '">' . - $langnames[$lang] . '</a> | '; + $textarray[] = '<a href="' . htmlspecialchars(SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), 'language=' . $lang)) . '">' . + $langnames[$lang] . '</a>'; } } + echo join(' | ', $textarray); } ?> \ No newline at end of file diff --git a/templates/default/login.php b/templates/default/login.php index ff4ae8baeb5fd6dc949e1142554cbeabe76c2080..b67313bc35f1e28107872f311a226dc02ab0e924 100644 --- a/templates/default/login.php +++ b/templates/default/login.php @@ -6,37 +6,35 @@ <div id="content"> <?php if (isset($this->data['error'])) { ?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5" - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/bomb.png" style="float: left; margin: 15px " /> - <h2>What you entered was not accepted!</h2> - - <p><?php echo htmlspecialchars($this->data['error']); ?> </p> - </div> + <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5" + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/bomb.png" style="float: left; margin: 15px " /> + <h2><?php echo $this->t('error_header'); ?></h2> + + <p><?php echo htmlspecialchars($this->data['error']); ?> </p> + </div> <?php } ?> - <h2 style="break: both">Enter your username and password</h2> + <h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2> - <p> - A service has requested you to authenticate your self. That means you need to enter your username and password in the form below. - </p> + <p><?php echo $this->t('user_pass_text'); ?></p> <form action="?" method="post" name="f"> <table> <tr> <td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/pencil.png" /></td> - <td style="padding: .3em;">Username</td> + <td style="padding: .3em;"><?php echo $this->t('username'); ?></td> <td><input type="text" tabindex="1" name="username" <?php if (isset($this->data['username'])) { echo 'value="' . htmlspecialchars($this->data['username']) . '"'; } ?> /></td> <td style="padding: .4em;" rowspan="2"> - <input type="submit" tabindex="3" value="Login" /> + <input type="submit" tabindex="3" value="<?php echo $this->t('login_button'); ?>" /> <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> </td> </tr> <tr> - <td style="padding: .3em;">Password</td> + <td style="padding: .3em;"><?php echo $this->t('password'); ?></td> <td><input type="password" tabindex="2" name="password" /></td> </tr> </table> @@ -45,15 +43,10 @@ </form> - <h2>Help! I don't remember my password.</h2> - + <h2><?php echo $this->t('help_header'); ?></h2> - <p>Too bad! - Without your username and password you cannot authenticate your self and access the service. - There may be someone that can help you. Contact the help desk at your university!</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> + <p><?php echo $this->t('help_text'); ?></p> + <?php $this->includeAtTemplateBase('includes/footer.php'); ?> \ No newline at end of file diff --git a/www/auth/login-admin.php b/www/auth/login-admin.php index 9fa3dce36bd9b8b8d05f38e2e4508412614907b0..8f3203821538f4ff3a0b8666def7285f69cd67db 100644 --- a/www/auth/login-admin.php +++ b/www/auth/login-admin.php @@ -84,7 +84,7 @@ if (isset($_POST['password'])) { } -$t = new SimpleSAML_XHTML_Template($config, 'login.php'); +$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php'); $t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $relaystate; diff --git a/www/auth/login-auto.php b/www/auth/login-auto.php index 212dee6af7d331dbd5b67ef981828be945f518eb..a5dab629c5a3ecdc37eeec0e927668b0070f5f3a 100644 --- a/www/auth/login-auto.php +++ b/www/auth/login-auto.php @@ -46,7 +46,7 @@ if(!is_array($attributes)) { if($ask_login && !array_key_exists('username', $_POST)) { /* Show login page. */ - $t = new SimpleSAML_XHTML_Template($config, 'login.php'); + $t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php'); $t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $_REQUEST['RelayState']; diff --git a/www/auth/login-feide.php b/www/auth/login-feide.php index 863539ca3be5f6dba94dc7271b746f4a4d0d7a0e..ec9dd870b37722c4acc88f9f21eda36a609ebc50 100644 --- a/www/auth/login-feide.php +++ b/www/auth/login-feide.php @@ -159,7 +159,7 @@ if (isset($_REQUEST['username'])) { } -$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php'); +$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php', 'login.php'); $t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $_REQUEST['RelayState']; diff --git a/www/auth/login-ldapmulti.php b/www/auth/login-ldapmulti.php index a423c55b4cafc2833e377b20c8f5b85b733eea6a..db0661715951ae86502398b54eb28fb1cd35b928 100644 --- a/www/auth/login-ldapmulti.php +++ b/www/auth/login-ldapmulti.php @@ -123,7 +123,7 @@ if (isset($_POST['username'])) { } -$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php'); +$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php', 'login.php'); $t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $_REQUEST['RelayState']; diff --git a/www/auth/login-radius.php b/www/auth/login-radius.php index 8d179f8bb6321186637bc4417bbbbad99245d6ac..c207fde056674a7d91179088f8bea17ba319c891 100644 --- a/www/auth/login-radius.php +++ b/www/auth/login-radius.php @@ -137,7 +137,7 @@ if (isset($_POST['username'])) { } -$t = new SimpleSAML_XHTML_Template($config, 'login.php'); +$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php'); $t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $_REQUEST['RelayState']; diff --git a/www/auth/login.php b/www/auth/login.php index ecf742dba961e75a8f306184db96678a95d2534b..c3e31188a01bad6496ca738ac005638290f7834b 100644 --- a/www/auth/login.php +++ b/www/auth/login.php @@ -128,9 +128,9 @@ if (isset($_POST['username'])) { } -$t = new SimpleSAML_XHTML_Template($config, 'login.php'); +$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php'); -$t->data['header'] = 'simpleSAMLphp: Enter username and password'; +$t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['relaystate'] = $relaystate; $t->data['error'] = $error; if (isset($error)) { diff --git a/www/index.php b/www/index.php index aad1fe655d522967b0532d5e89a9b43141b4714d..2479f41cd8038cdb18a6ef422d797228f152e271 100644 --- a/www/index.php +++ b/www/index.php @@ -34,25 +34,25 @@ $links = array(); if ($config->getValue('enable.saml20-sp') === true) $links[] = array( 'href' => 'example-simple/saml2-example.php', - 'text' => 'SAML 2.0 SP example - test logging in through your IdP'); + 'text' => 'link_saml2example'); if ($config->getValue('enable.shib13-sp') === true) $links[] = array( 'href' => 'example-simple/shib13-example.php', - 'text' => 'Shibboleth 1.3 SP example - test logging in through your Shib IdP'); + 'text' => 'link_shib13example'); if ($config->getValue('enable.openid-provider') === true) $links[] = array( 'href' => 'openid/provider/server.php', - 'text' => 'OpenID Provider site - Alpha version (test code)'); + 'text' => 'link_openidprovider'); $links[] = array( 'href' => 'example-simple/hostnames.php', - 'text' => 'Diagnostics on hostname, port and protocol'); + 'text' => 'link_diagnostics'); $links[] = array( 'href' => 'admin/phpinfo.php', - 'text' => 'PHPinfo'); + 'text' => 'link_phpinfo'); @@ -60,32 +60,32 @@ $linksmeta = array(); $linksmeta[] = array( 'href' => 'admin/metadata.php', - 'text' => 'Meta data overview for your installation. Diagnose your meta data files.'); + 'text' => 'link_meta_overview'); if ($config->getValue('enable.saml20-sp') === true) $linksmeta[] = array( 'href' => 'saml2/sp/metadata.php', - 'text' => 'Hosted SAML 2.0 Service Provider Metadata (automatically generated)'); + 'text' => 'link_meta_saml2sphosted'); if ($config->getValue('enable.saml20-idp') === true) $linksmeta[] = array( 'href' => 'saml2/idp/metadata.php', - 'text' => 'Hosted SAML 2.0 Identity Provider Metadata (automatically generated)'); + 'text' => 'link_meta_saml2idphosted'); if ($config->getValue('enable.shib13-sp') === true) $linksmeta[] = array( 'href' => 'shib13/sp/metadata.php', - 'text' => 'Hosted Shibboleth 1.3 Service Provider Metadata (automatically generated)'); + 'text' => 'link_meta_shib13sphosted'); if ($config->getValue('enable.shib13-idp') === true) $linksmeta[] = array( 'href' => 'shib13/idp/metadata.php', - 'text' => 'Hosted Shibboleth 1.3 Identity Provider Metadata (automatically generated)'); + 'text' => 'link_meta_shib13idphosted'); $linksmeta[] = array( 'href' => 'admin/metadata-converter.php', - 'text' => 'XML to simpleSAMLphp metadata converter', + 'text' => 'link_xmlconvert', ); @@ -94,38 +94,38 @@ $linksdoc = array(); $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/installing-simplesamlphp', - 'text' => 'Installing simpleSAMLphp'); + 'text' => 'link_doc_install'); if ($config->getValue('enable.saml20-sp', false ) || $config->getValue('enable.shib13-sp', false)) $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/using-simplesamlphp-service-provider', - 'text' => 'Using simpleSAMLphp as a Service Provider'); + 'text' => 'link_doc_sp'); if ($config->getValue('enable.saml20-idp', false ) || $config->getValue('enable.shib13-idp', false)) $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/using-simplesamlphp-identity-provider', - 'text' => 'Using simpleSAMLphp as an Identity Provider'); + 'text' => 'link_doc_idp'); if ($config->getValue('enable.shib13-idp', false)) $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/configure-shibboleth-13-sp-work-simplesamlphp-idp', - 'text' => 'Configure Shibboleth 1.3 SP to work with simpleSAMLphp IdP'); + 'text' => 'link_doc_shibsp'); if ($config->getValue('enable.saml20-idp', false )) $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/simplesamlphp-idp-google-apps-education', - 'text' => 'simpleSAMLphp as an IdP for Google Apps for Education'); + 'text' => 'link_doc_googleapps'); $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/simplesamlphp-advanced-features', - 'text' => 'simpleSAMLphp Advanced Features -'); + 'text' => 'link_doc_advanced', +); $linksdoc[] = array( 'href' => 'http://rnd.feide.no/content/simplesamlphp-maintenance-and-configuration', - 'text' => 'simpleSAMLphp Maintenance and Configuration'); + 'text' => 'link_doc_maintenance'); $enablematrix = array( 'saml20-sp' => $config->getValue('enable.saml20-sp', false),