Skip to content

Commit

Permalink
Avoid concatenated error messages
Browse files Browse the repository at this point in the history
For #455
  • Loading branch information
hmpf committed Sep 16, 2016
1 parent 15ad1d9 commit dd63390
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions modules/authX509/templates/X509error.php
Expand Up @@ -11,8 +11,8 @@
<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
}
Expand Down
1 change: 1 addition & 0 deletions modules/authX509/www/expirywarning.php
Expand Up @@ -27,4 +27,5 @@
$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();
4 changes: 2 additions & 2 deletions modules/authYubiKey/templates/yubikeylogin.php
Expand Up @@ -12,8 +12,8 @@
<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
}
Expand Down
1 change: 1 addition & 0 deletions modules/authYubiKey/www/yubikeylogin.php
Expand Up @@ -31,6 +31,7 @@
$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();
Expand Down
10 changes: 2 additions & 8 deletions modules/core/templates/loginuserpass.php
Expand Up @@ -20,16 +20,10 @@ class="float-l erroricon" style="margin: 15px" alt=""/>
<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
}
Expand Down
1 change: 1 addition & 0 deletions modules/core/www/loginuserpass.php
Expand Up @@ -93,6 +93,7 @@
}
$t->data['links'] = $source->getLoginLinks();
$t->data['errorcode'] = $errorCode;
$t->data['errorcodes'] = SimpleSAML\Error\Errorcodes::getAllErrorCodeMessages();
$t->data['errorparams'] = $errorParams;

if (isset($state['SPMetadata'])) {
Expand Down
1 change: 1 addition & 0 deletions modules/core/www/loginuserpassorg.php
Expand Up @@ -79,6 +79,7 @@
$t->data['rememberUsernameChecked'] = $source->getRememberUsernameChecked();
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) {
Expand Down

0 comments on commit dd63390

Please sign in to comment.