Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect if login page session expired - fixes #1107 #1111

Merged
merged 1 commit into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mailscanner/checklogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
disableBrowserCache();

if (isset($_POST['token'])) {
if (false === checkToken($_POST['token'])) {
if (!isset($_SESSION['token'])) {
//login page timed out and session for token is not valid anymore
header('Location: login.php?error=pagetimeout');
die();
} elseif (false === checkToken($_POST['token'])) {
die(__('dietoken99'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion mailscanner/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4618,7 +4618,7 @@ function validateInput($input, $type)
}
break;
case 'loginerror':
if (preg_match('/^(baduser|emptypassword|timeout)$/', $input)) {
if (preg_match('/^(baduser|emptypassword|timeout|pagetimeout)$/', $input)) {
return true;
}
break;
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Login',
'forgottenpwd01' => 'Passwort vergessen?',
'sessiontimeout01' => 'Ihre Sitzung ist abgelaufen.',
'pagetimeout01' => 'Die Anmelde-Seite ist abgelaufen <br>Bitte versuchen Sie es erneut',

// 03-funtions.php
'jumpmessage03' => 'Zu Nachricht gehen:',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Login',
'forgottenpwd01' => 'Forgotten Password?',
'sessiontimeout01' => 'Your session timed out.',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-functions.php
'jumpmessage03' => 'Go to message:',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Connexion',
'forgottenpwd01' => 'Mot de passe perdu ?',
'sessiontimeout01' => 'Votre session a expiré.',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-functions.php
'jumpmessage03' => 'Aller au message :',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/it.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Login',
'forgottenpwd01' => 'Forgotten Password?',
'sessiontimeout01' => 'Your session timed out.',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-funtions.php
'jumpmessage03' => 'Vai al messaggio:',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/ja.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'ログイン',
'forgottenpwd01' => 'パスワードを忘れました?',
'sessiontimeout01' => 'セッションはタイムアウトしました。',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-functions.php
'jumpmessage03' => 'メッセージに移動:',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Login',
'forgottenpwd01' => 'Forgotten Password?',
'sessiontimeout01' => 'Your session timed out.',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-funtions.php
'jumpmessage03' => 'Ga naar e-mail:',
Expand Down
1 change: 1 addition & 0 deletions mailscanner/languages/pt_br.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'login01' => 'Login',
'forgottenpwd01' => 'Esqueceu sua senha?',
'sessiontimeout01' => 'Sua sessão expirou.',
'pagetimeout01' => 'Login page timed out <br>Please try again',

// 03-funtions.php
'jumpmessage03' => 'Carregar a mensagem:',
Expand Down
3 changes: 3 additions & 0 deletions mailscanner/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
case 'timeout':
$error = __('sessiontimeout01');
break;
case 'pagetimeout':
$error = __('pagetimeout01');
break;
}
echo '
<p class="loginerror">' . $error . '</p>';
Expand Down