Proper redirect in popup when login fails.

This corrects issue https://github.com/sebsauvage/Shaarli/issues/10
This commit is contained in:
Sebastien SAUVAGE 2013-03-02 14:07:00 +01:00
parent 858c5c2b43
commit 705f8355a9

View file

@ -410,7 +410,9 @@ if (isset($_POST['login']))
else
{
ban_loginFailed();
echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login\';</script>'; // Redirect to login screen.
$redir = '';
if (isset($_GET['post'])) { $redir = '&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):''); }
echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen.
exit;
}
}