We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 061acb45 authored by elleo's avatar elleo

Apply patch from qwp0 (Andrej T) to display errors after an unsuccessful login...

Apply patch from qwp0 (Andrej T) to display errors after an unsuccessful login and automatically fill the username box (fixes bug #26423)
parent 459ce747
......@@ -47,7 +47,9 @@ if(isset($_POST['login'])) {
$res = $mdb2->query('SELECT username FROM Users WHERE '
. ' lower(username) = ' . $mdb2->quote(strtolower($username), 'text')
. ' AND password = ' . $mdb2->quote(md5($password), 'text') . ' AND active = 1');
if(!$res->numRows()) {
if(PEAR::isError($res)) {
$errors .= 'A database error happened.';
} elseif(!$res->numRows()) {
$errors .= 'Invalid username or password.';
} else {
// Give the user a session id, like any other client
......@@ -80,7 +82,8 @@ if(isset($logged_in) && $logged_in) {
{ $smarty->assign('return', $_REQUEST['return']); }
else
{ $smarty->assign('return', ''); }
$smarty->assign('username', $username);
$smarty->assign('errors', $errors);
$smarty->display('login.tpl');
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment