if username or password are blank, exit early (saves logging the failed attempt)

This commit is contained in:
Shish 2012-03-08 04:35:52 +00:00
parent c260f707fd
commit c7e2ef74f8

View File

@ -287,6 +287,11 @@ class UserPage extends Extension {
$pass = $_POST['pass']; $pass = $_POST['pass'];
$hash = md5(strtolower($name) . $pass); $hash = md5(strtolower($name) . $pass);
if(empty($name) || empty($pass)) {
$this->theme->display_error(400, "Error", "Username or password left blank");
return;
}
$duser = User::by_name_and_hash($name, $hash); $duser = User::by_name_and_hash($name, $hash);
if(!is_null($duser)) { if(!is_null($duser)) {
$user = $duser; $user = $duser;