fixes #412, warn visitor if auth key no longer valid

This commit is contained in:
plegall 2016-01-29 12:44:38 +01:00
parent 77888174cf
commit a12425629e
4 changed files with 14 additions and 1 deletions

View file

@ -201,6 +201,16 @@ if (is_a_guest())
$user['username'] = l10n('guest');
}
// in case an auth key was provided and is no longer valid, we must wait to
// be here, with language loaded, to prepare the message
if (isset($page['auth_key_invalid']) and $page['auth_key_invalid'])
{
$page['errors'][] =
l10n('Your authentication key is no longer valid.')
.sprintf(' <a href="%s">%s</a>', get_root_url().'identification.php', l10n('Login'))
;
}
// template instance
if (defined('IN_ADMIN') and IN_ADMIN )
{// Admin template

View file

@ -1506,6 +1506,7 @@ SELECT
// is the key still valid?
if (strtotime($key['expired_on']) < strtotime($key['dbnow']))
{
$page['auth_key_invalid'] = true;
return false;
}

View file

@ -425,4 +425,5 @@ $lang['Photo description'] = 'Photo description';
$lang['Album name, A &rarr; Z'] = 'Album name, A &rarr; Z';
$lang['Album name, Z &rarr; A'] = 'Album name, Z &rarr; A';
$lang['Link: %s'] = 'Link: %s';
$lang['Your authentication key is no longer valid.'] = 'Your authentication key is no longer valid.';
?>

View file

@ -424,4 +424,5 @@ $lang['Photo title'] = 'Titre de la photo';
$lang['Photo description'] = 'Description de la photo';
$lang['Album name, A &rarr; Z'] = 'Nom de l\'album, A &rarr; Z';
$lang['Album name, Z &rarr; A'] = 'Nom de l\'album, Z &rarr; A';
$lang['Link: %s'] = 'Lien: %s';
$lang['Link: %s'] = 'Lien: %s';
$lang['Your authentication key is no longer valid.'] = 'Votre clef d\'identification n\'est plus valide.';