Skip to content
Snippets Groups Projects
Commit 74d0f7c1 authored by Hanne Moa's avatar Hanne Moa
Browse files

Avoid concatenated error messages

For #455
parent d48f2bf6
No related branches found
No related tags found
No related merge requests found
......@@ -11,8 +11,8 @@ if ($this->data['errorcode'] !== NULL) {
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" />
<h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p><b><?php echo $this->t('{errors:title_' . $this->data['errorcode'] . '}'); ?></b></p>
<p><?php echo $this->t('{errors:descr_' . $this->data['errorcode'] . '}'); ?></p>
<p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p>
<p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p>
</div>
<?php
}
......
......@@ -27,4 +27,5 @@ $t->data['target'] = SimpleSAML\Module::getModuleURL('authX509/expirywarning.php
$t->data['data'] = array('StateId' => $id);
$t->data['daysleft'] = $state['daysleft'];
$t->data['renewurl'] = $state['renewurl'];
$t->data['errorcodes'] = SimpleSAML\Error\Errorcodes::getAllErrorCodeMessages();
$t->show();
......@@ -12,8 +12,8 @@ if ($this->data['errorcode'] !== NULL) {
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" />
<h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p><b><?php echo $this->t('{errors:title_' . $this->data['errorcode'] . '}'); ?></b></p>
<p><?php echo $this->t('{errors:descr_' . $this->data['errorcode'] . '}'); ?></p>
<p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p>
<p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p>
</div>
<?php
}
......
......@@ -31,6 +31,7 @@ $globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'authYubiKey:yubikeylogin.php');
$t->data['stateparams'] = array('AuthState' => $authStateId);
$t->data['errorcode'] = $errorCode;
$t->data['errorcodes'] = SimpleSAML\Error\Errorcodes::getAllErrorCodeMessages();
$t->data['logo_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/logo.jpg');
$t->data['devicepic_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/yubikey.jpg');
$t->show();
......
......@@ -20,16 +20,10 @@ if ($this->data['errorcode'] !== null) {
<h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p><strong><?php
echo htmlspecialchars($this->t(
'{errors:title_'.$this->data['errorcode'].'}',
$this->data['errorparams']
)); ?></strong></p>
echo htmlspecialchars($this->t($this->data['errorcodes']['title'][$this->data['errorcode']], $this->data['errorparams'])); ?></strong></p>
<p><?php
echo htmlspecialchars($this->t(
'{errors:descr_'.$this->data['errorcode'].'}',
$this->data['errorparams']
)); ?></p>
echo htmlspecialchars($this->t($this->data['errorcodes']['descr'][$this->data['errorcode']], $this->data['errorparams'])); ?></p>
</div>
<?php
}
......
......@@ -93,6 +93,7 @@ if (array_key_exists('forcedUsername', $state)) {
}
$t->data['links'] = $source->getLoginLinks();
$t->data['errorcode'] = $errorCode;
$t->data['errorcodes'] = SimpleSAML\Error\Errorcodes::getAllErrorCodeMessages();
$t->data['errorparams'] = $errorParams;
if (isset($state['SPMetadata'])) {
......
......@@ -81,6 +81,7 @@ $t->data['rememberMeEnabled'] = false;
$t->data['rememberMeChecked'] = false;
if (isset($_COOKIE[$source->getAuthId() . '-username'])) $t->data['rememberUsernameChecked'] = TRUE;
$t->data['errorcode'] = $errorCode;
$t->data['errorcodes'] = SimpleSAML\Error\Errorcodes::getAllErrorCodeMessages();
$t->data['errorparams'] = $errorParams;
if ($organizations !== NULL) {
......
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