Skip to content
Snippets Groups Projects
Commit 8f96cddc authored by Olav Morken's avatar Olav Morken
Browse files

Add translation support for most admin pages.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@711 44740490-163a-0410-bde0-09ae8108e29a
parent bef25756
No related branches found
No related tags found
No related merge requests found
<?php
$lang = array(
'cfg_check_header' => array (
'en' => 'Configuration check',
),
'cfg_check_select_file' => array (
'en' => 'Select configuration file to check:',
),
'cfg_check_notices' => array (
'en' => 'Notices',
),
'cfg_check_missing' => array (
'en' => 'Options missing from config file',
),
'cfg_check_superfluous' => array (
'en' => 'Superfluous options in config file',
),
'cfg_check_noerrors' => array (
'en' => 'No errors found.',
),
'cfg_check_back' => array (
'en' => 'Go back to the file list',
),
'metaover_header' => array (
'en' => 'Metadata overview',
),
'metaover_intro' => array (
'en' => 'To look at the details for an SAML entity, click on the SAML entity header.',
),
'metaover_errorentry' => array (
'en' => 'Error in this metadata entry',
),
'metaover_required_found' => array (
'en' => 'Required fields',
),
'metaover_required_not_found' => array (
'en' => 'The following required fields was not found',
),
'metaover_optional_found' => array (
'en' => 'Optional fields',
),
'metaover_optional_not_found' => array (
'en' => 'The following optional fields was not found',
),
'metaover_unknown_found' => array (
'en' => 'The following fields was not recognized',
),
'metaover_group_metadata.saml20-sp-hosted' => array (
'en' => 'SAML 2.0 Service Provider (Hosted)',
),
'metaover_group_metadata.saml20-sp-remote' => array (
'en' => 'SAML 2.0 Service Provider (Remote)',
),
'metaover_group_metadata.saml20-idp-hosted' => array (
'en' => 'SAML 2.0 Identity Provider (Hosted)',
),
'metaover_group_metadata.saml20-idp-remote' => array (
'en' => 'SAML 2.0 Identity Provider (Remote)',
),
'metaover_group_metadata.shib13-sp-hosted' => array (
'en' => 'Shib 1.3 Service Provider (Hosted)',
),
'metaover_group_metadata.shib13-sp-remote' => array (
'en' => 'Shib 1.3 Service Provider (Remote)',
),
'metaover_group_metadata.shib13-idp-hosted' => array (
'en' => 'Shib 1.3 Identity Provider (Hosted)',
),
'metaover_group_metadata.shib13-idp-remote' => array (
'en' => 'Shib 1.3 Identity Provider (Remote)',
),
'metaover_group_metadata.wsfed-sp-hosted' => array (
'en' => 'WS-Federation Service Provider (Hosted)',
),
'metaover_group_metadata.wsfed-idp-remote' => array (
'en' => 'WS-Federation Identity Provider (Remote)',
),
'metaconv_title' => array (
'en' => 'Metadata parser',
),
'metaconv_title' => array (
'en' => 'Metadata parser',
),
'metaconv_parse' => array (
'en' => 'Parse',
),
'metaconv_converted' => array (
'en' => 'Converted metadata',
),
'metadata_saml20-sp' => array (
'en' => 'SAML 2.0 SP Metadata',
),
'metadata_saml20-idp' => array (
'en' => 'SAML 2.0 IdP Metadata',
),
'metadata_shib13-sp' => array (
'en' => 'Shib 1.3 SP Metadata',
),
'metadata_shib13-idp' => array (
'en' => 'Shib 1.3 IdP Metadata',
),
'metadata_intro' => array (
'en' => 'Here is the metadata that simpleSAMLphp has generated for you. You may send this metadata document to trusted partners to setup a trusted federation.',
),
'metadata_xmlurl' => array (
'en' => 'You can <a href="%METAURL%">get the metadata xml on a dedicated URL</a>:',
),
'metadata_metadata' => array (
'en' => 'Metadata',
),
'metadata_xmlformat' => array (
'en' => 'In SAML 2.0 Metadata XML format:',
),
'metadata_simplesamlformat' => array (
'en' => 'In simpleSAMLphp flat file format - use this if you are using a simpleSAMLphp entity on the other side:',
),
'metadata_send_title' => array (
'en' => 'Send your metadata to %FEDERATION%',
),
'metadata_send_hasdetected' => array (
'en' => 'simpleSAMLphp has detected that you have configured %FEDERATION% as your default IdP.',
),
'metadata_send_desc' => array (
'en' => 'Before you can connect to %FEDERATION%, %FEDERATION% needs to add your service in its trust configuration. When you contact %FEDERATION% to add you as a new service, you will be asked to send your metadata. Here you can easily send the metadata to %FEDERATION% by clicking the button below.',
),
'metadata_send_email' => array (
'en' => '%FEDERATION% needs to know how to get in contact with you, so you need to type in <strong>your email address</strong>:',
),
'metadata_send_send' => array (
'en' => 'Send my metadata to %FEDERATION%',
),
);
?>
\ No newline at end of file
<?php
$this->data['header'] = 'Configuration check';
$this->data['header'] = $this->t('cfg_check_header');
if(array_key_exists('file', $this->data)) {
$this->data['header'] .= ' - ' . htmlspecialchars($this->data['file']);
......@@ -16,7 +16,7 @@ $this->includeAtTemplateBase('includes/header.php');
<?php
if(array_key_exists('files', $this->data)) {
/* File list. */
echo('<p>Select configuration file to check:</p>');
echo('<p>' . $this->t('cfg_check_select_file') . '</p>');
echo('<ul>');
foreach($this->data['files'] as $file) {
......@@ -39,7 +39,7 @@ if(array_key_exists('files', $this->data)) {
$superfluous = $this->data['superfluous'];
if(count($notices) > 0) {
echo('<h3>Notices</h3>');
echo('<h3>' . $this->t('notices') .' </h3>');
echo('<ul>');
foreach($notices as $i) {
$type = $i['type'];
......@@ -59,7 +59,7 @@ if(array_key_exists('files', $this->data)) {
}
if(count($missing) > 0) {
echo('<h3>Options missing from config file</h3>');
echo('<h3>' . $this->t('cfg_check_missing') . '</h3>');
echo('<ul>');
foreach($missing as $i) {
echo('<li>' . htmlspecialchars($i) . '</li>');
......@@ -68,7 +68,7 @@ if(array_key_exists('files', $this->data)) {
}
if(count($superfluous) > 0) {
echo('<h3>Superfluous options in config file</h3>');
echo('<h3>' . $this->t('cfg_check_superfluous') . '</h3>');
echo('<ul>');
foreach($superfluous as $i) {
echo('<li>' . htmlspecialchars($i) . '</li>');
......@@ -77,10 +77,10 @@ if(array_key_exists('files', $this->data)) {
}
if(count($notices) === 0 && count($missing) === 0 && count($superfluous) === 0) {
echo('<p>No errors found.</p>');
echo('<p>' . $this->t('cfg_check_noerrors') . '</p>');
}
echo('<p><a href="' . htmlspecialchars($this->data['url']) . '">Go back to the file list</a></p>');
echo('<p><a href="' . htmlspecialchars($this->data['url']) . '">' . $this->t('cfg_check_back') . '</a></p>');
}
$this->includeAtTemplateBase('includes/footer.php');
......
<?php $this->includeAtTemplateBase('includes/header.php'); ?>
<?php
$this->data['header'] = $this->t('metaover_header');
$this->data['icon'] = 'bino.png';
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<p>To look at the details for an SAML entity, click on the SAML entity header.</p>
<p><?php echo $this->t('metaover_intro'); ?></p>
<?php
function showEntry($header, $list, $baseurl) {
function showEntry($t, $id) {
if (!array_key_exists($id, $t->data)) {
/* This metadata does not exist. */
return;
}
$header = $t->t('metaover_group_' . $id);
$list = $t->data[$id];
$baseurl = $t->data['baseurlpath'];
echo '<h3>' . $header . '</h3>';
......@@ -32,7 +47,7 @@
if ($warning) {
echo '<div><img src="/' . $baseurl . 'resources/icons/caution.png" style="float: left; margin-right: 1em" />';
echo 'Error in this metadata entry.</div>';
echo $t->t('metaover_errorentry') . '</div>';
}
echo '<div id="metadatasection-' . $encodedEntityID . '" style="display: none">';
......@@ -42,7 +57,7 @@
}
echo '<div style="margin-left: 1em">';
echo '<div class="efieldlist"><h5>Required fields</h5>';
echo '<div class="efieldlist"><h5>' . $t->t('metaover_required') . '</h5>';
echo '<dl>';
foreach ($entity['required.found'] AS $key => $value) {
echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars(var_export($value, TRUE)) . '</dd>';
......@@ -53,7 +68,7 @@
if (count($entity['required.notfound']) > 0) {
echo '</div><div class="efieldlist warning">';
echo '<h5>The following required fields was not found</h5><ul>';
echo '<h5>' . $t->t('metaover_required_not_found') . '</h5><ul>';
foreach ($entity['required.notfound'] AS $key) {
echo '<li>' . htmlspecialchars($key) . '</li>';
}
......@@ -63,7 +78,7 @@
if (count($entity['optional.found']) > 0) {
echo '</div><div class="efieldlist">';
echo '<h5>Optional fields</h5>';
echo '<h5>' . $t->t('metaover_optional_found') . '</h5>';
echo '<dl>';
foreach ($entity['optional.found'] AS $key => $value) {
echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars(var_export($value, TRUE)) . '</dd>';
......@@ -75,7 +90,7 @@
if (count($entity['optional.notfound']) > 0) {
echo '</div><div class="efieldlist info">';
echo '<h5>The following optional fields was not found:</h5><ul>';
echo '<h5>' . $t->t('metaover_optional_not_found') . '</h5><ul>';
foreach ($entity['optional.notfound'] AS $key) {
echo '<li>' . htmlspecialchars($key) . '</li>';
}
......@@ -84,7 +99,7 @@
if (count($entity['leftovers']) > 0) {
echo '</div><div class="efieldlist warning">';
echo '<h5>The following fields was not reckognized</h5><ul>';
echo '<h5>' . $t->t('metaover_unknown_found') . '</h5><ul>';
foreach ($entity['leftovers'] AS $key => $value) {
echo '<li>' . htmlspecialchars($key) . '</li>';
}
......@@ -96,28 +111,18 @@
}
if (array_key_exists('metadata.saml20-sp-hosted', $this->data))
showEntry('SAML 2.0 Service Provider (Hosted)', $this->data['metadata.saml20-sp-hosted'], $this->data['baseurlpath']);
if (array_key_exists('metadata.saml20-sp-remote', $this->data))
showEntry('SAML 2.0 Service Provider (Remote)', $this->data['metadata.saml20-sp-remote'], $this->data['baseurlpath']);
if (array_key_exists('metadata.saml20-idp-hosted', $this->data))
showEntry('SAML 2.0 Identity Provider (Hosted)', $this->data['metadata.saml20-idp-hosted'], $this->data['baseurlpath']);
if (array_key_exists('metadata.saml20-idp-remote', $this->data))
showEntry('SAML 2.0 Identity Provider (Remote)', $this->data['metadata.saml20-idp-remote'], $this->data['baseurlpath']);
if (array_key_exists('metadata.shib13-sp-hosted', $this->data))
showEntry('Shib 1.3 Service Provider (Hosted)', $this->data['metadata.shib13-sp-hosted'], $this->data['baseurlpath']);
if (array_key_exists('metadata.shib13-sp-remote', $this->data))
showEntry('Shib 1.3 Service Provider (Remote)', $this->data['metadata.shib13-sp-remote'], $this->data['baseurlpath']);
if (array_key_exists('metadata.shib13-idp-hosted', $this->data))
showEntry('Shib 1.3 Identity Provider (Hosted)', $this->data['metadata.shib13-idp-hosted'], $this->data['baseurlpath']);
if (array_key_exists('metadata.shib13-idp-remote', $this->data))
showEntry('Shib 1.3 Identity Provider (Remote)', $this->data['metadata.shib13-idp-remote'], $this->data['baseurlpath']);
if (array_key_exists('metadata.wsfed-sp-hosted', $this->data))
showEntry('WS-Federation Service Provider (Hosted)', $this->data['metadata.wsfed-sp-hosted'], $this->data['baseurlpath']);
if (array_key_exists('metadata.wsfed-idp-remote', $this->data))
showEntry('WS-Federation Identity Provider (Remote)', $this->data['metadata.wsfed-idp-remote'], $this->data['baseurlpath']);
showEntry($this, 'metadata.saml20-sp-hosted');
showEntry($this, 'metadata.saml20-sp-remote');
showEntry($this, 'metadata.saml20-idp-hosted');
showEntry($this, 'metadata.saml20-idp-remote');
showEntry($this, 'metadata.shib13-sp-hosted');
showEntry($this, 'metadata.shib13-sp-remote');
showEntry($this, 'metadata.shib13-idp-hosted');
showEntry($this, 'metadata.shib13-idp-remote');
showEntry($this, 'metadata.wsfed-sp-hosted');
showEntry($this, 'metadata.wsfed-idp-remote');
?>
......
<?php
$this->data['header'] = 'Metadata parser';
$this->data['header'] = $this->t('metaconv_title');
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<h2>Metadata parser</h2>
<h2><?php echo $this->t('metaconv_title'); ?></h2>
<form action="?" method="post">
......@@ -14,7 +14,7 @@ $this->includeAtTemplateBase('includes/header.php');
<textarea rows="20" cols="75" name="xmldata"><?php echo htmlspecialchars($this->data['xmldata']); ?></textarea>
</p>
<p>
<input type="submit" value="Parse" />
<input type="submit" value="<?php echo $this->t('metaconv_parse'); ?>" />
</p>
</form>
......@@ -24,7 +24,7 @@ $output = $this->data['output'];
if($output !== NULL) {
echo('<h2>Converted metadata</h2>' . "\n");
echo('<h2>' . $this->t('metaconv_converted') . '</h2>' . "\n");
foreach($output as $type => $text) {
if($text === '') {
......
<?php $this->includeAtTemplateBase('includes/header.php'); ?>
<?php
$this->data['header'] = $this->t('metadata_' . $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 echo $this->data['header']; ?></h2>
<p>Here is SAML 2.0 metadata that simpleSAMLphp has generated for you. You may send this SAML 2.0 Metadata document to trusted partners to setup a trusted federation.</p>
<p><?php echo $this->t('metadata_intro'); ?></p>
<?php if (isset($this->data['metaurl'])) { ?>
<p>You can <a href="<?php echo htmlspecialchars($this->data['metaurl']); ?>">get the metadata xml on a dedicated URL</a>:<br />
<p><?php echo($this->t('metadata_xmlurl', TRUE, TRUE, array('%METAURL%' => htmlspecialchars($this->data['metaurl'])))); ?><br />
<input type="text" style="width: 90%" value="<?php echo htmlspecialchars($this->data['metaurl']); ?>" /></p>
<?php } ?>
<h2>Metadata</h2>
<h2><?php echo($this->t('metadata_metadata')); ?></h2>
<p>In SAML 2.0 Meta data XML format:</p>
<p><?php echo($this->t('metadata_xmlformat')); ?></p>
<pre class="metadatabox"><?php echo $this->data['metadata']; ?></pre>
<p>In simpleSAMLphp flat file format - use this if you are using a simpleSAMLphp entity on the other side:</p>
<p><?php echo($this->t('metadata_simplesamlformat')); ?></p>
<pre class="metadatabox"><?php echo $this->data['metadataflat']; ?></pre>
<?php if(array_key_exists('sendmetadatato', $this->data)) { ?>
<?php if(array_key_exists('sendmetadatato', $this->data)) {
$param = array('%FEDERATION%' => $this->data['federationname']);
?>
<div style="border: 1px solid #444; margin: 2em; padding: 1em; background: #eee">
<h2>Send your metadata to <?php echo $this->data['federationname']; ?></h2>
<h2><?php echo $this->t('metadata_send_title', TRUE, TRUE, $param); ?></h2>
<p>simpleSAMLphp has detected that you have configured <?php echo $this->data['federationname']; ?> as your default IdP.</p>
<p><?php echo $this->t('metadata_send_hasdetected', TRUE, TRUE, $param); ?></p>
<p>Before you can connect to <?php echo $this->data['federationname']; ?>, <?php echo $this->data['federationname']; ?> needs to add your service in its trust configuration. When you
contact <?php echo $this->data['federationname']; ?> to add you as a new service, you will be asked to send your metadata. Here you can easily send
the metadata to <?php echo $this->data['federationname']; ?> by clicking the button below.</p>
<p><?php echo $this->t('metadata_send_desc', TRUE, TRUE, $param); ?></p>
<form action="<?php echo $this->data['sendmetadatato']; ?>" method="post">
<p><?php echo $this->data['federationname']; ?> needs to know how to get in contact with you, so you need to type in <strong>your email address</strong>:
<p><?php echo $this->t('metadata_send_email', TRUE, TRUE, $param); ?>
<input type="text" size="25" name="email" value="" />
</p>
......@@ -48,7 +51,7 @@
<input type="hidden" name="techemail" value="<?php echo $this->data['techemail']; ?>" />
<input type="hidden" name="version" value="<?php echo $this->data['version']; ?>" />
<input type="hidden" name="defaultidp" value="<?php echo htmlspecialchars($this->data['defaultidp']); ?>" />
<input type="submit" name="send" value="Send my metadata to <?php echo $this->data['federationname']; ?>" />
<input type="submit" name="send" value="<?php echo $this->t('metadata_send_send', TRUE, TRUE, $param); ?>" />
</form>
......
......@@ -196,7 +196,7 @@ if(array_key_exists('file', $_GET)) {
/* Initialize template page. */
$et = new SimpleSAML_XHTML_Template($config, 'admin-config.php');
$et = new SimpleSAML_XHTML_Template($config, 'admin-config.php', 'admin.php');
$et->data['url'] = SimpleSAML_Utilities::selfURLNoQuery();
if($file === NULL) {
......
......@@ -52,7 +52,7 @@ try {
}
$template = new SimpleSAML_XHTML_Template($config, 'metadata-converter.php');
$template = new SimpleSAML_XHTML_Template($config, 'metadata-converter.php', 'admin.php');
$template->data['xmldata'] = $xmldata;
$template->data['output'] = $output;
......
......@@ -19,7 +19,7 @@ try {
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$et = new SimpleSAML_XHTML_Template($config, 'admin-metadatalist.php');
$et = new SimpleSAML_XHTML_Template($config, 'admin-metadatalist.php', 'admin.php');
if ($config->getValue('enable.saml20-sp') === true) {
......@@ -142,9 +142,6 @@ try {
}
$et->data['header'] = 'Metadata overview';
$et->data['icon'] = 'bino.png';
$et->show();
......
......@@ -87,10 +87,10 @@ try {
if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
$defaultidp = $config->getValue('default-saml20-idp');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
$t->data['header'] = 'SAML 2.0 IdP Metadata';
$t->data['header'] = 'saml20-idp';
$t->data['metaurl'] = SimpleSAML_Utilities::selfURLNoQuery();
$t->data['metadata'] = htmlentities($metaxml);
$t->data['metadataflat'] = htmlentities($metaflat);
......
......@@ -84,9 +84,9 @@ try {
if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
$defaultidp = $config->getValue('default-saml20-idp');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
$t->data['header'] = 'SAML 2.0 SP Metadata';
$t->data['header'] = 'saml20-sp';
$t->data['metadata'] = htmlentities($metaxml);
$t->data['metadataflat'] = htmlentities($metaflat);
$t->data['metaurl'] = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLNoQuery(), 'output=xml');
......
......@@ -77,9 +77,9 @@ try {
if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
$defaultidp = $config->getValue('default-shib13-idp');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
$t->data['header'] = 'Shib 1.3 IdP Metadata';
$t->data['header'] = 'shib13-idp';
$t->data['metaurl'] = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLNoQuery(), 'output=xml');
$t->data['metadata'] = htmlspecialchars($metaxml);
......
......@@ -56,10 +56,10 @@ try {
if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
$defaultidp = $config->getValue('default-shib13-idp');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php');
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
$t->data['header'] = 'Shib 1.3 SP Metadata';
$t->data['header'] = 'shib13-sp';
$t->data['metadata'] = htmlspecialchars($metaxml);
$t->data['metadataflat'] = htmlspecialchars($metaflat);
$t->data['metaurl'] = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLNoQuery(), 'output=xml');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment