Skip to content

Commit f877cde

Browse files
committed
Refactor process_login_request 2: Invert if
1 parent 324ec73 commit f877cde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

interface/web/login/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ function process_login_request(app $app, &$error, $conf, $module)
7676
$loginAs = false;
7777
$time = time();
7878

79-
if ($username != '' && $password != '' && $error == '') {
79+
if ($username == '' || $password == '' || $error != '') {
80+
//* Username or password empty
81+
if ($error == '') $error = $app->lng('error_user_password_empty');
82+
$app->plugin->raiseEvent('login_empty', $username);
83+
} else {
8084
/*
8185
* Check, if there is a "login as" instead of a "normal" login
8286
*/
@@ -306,10 +310,6 @@ function process_login_request(app $app, &$error, $conf, $module)
306310
fclose($authlog_handle);
307311
}
308312
}
309-
} else {
310-
//* Username or password empty
311-
if ($error == '') $error = $app->lng('error_user_password_empty');
312-
$app->plugin->raiseEvent('login_empty', $username);
313313
}
314314
}
315315

0 commit comments

Comments
 (0)