mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-07-13 18:18:16 +03:00
Fix logging in cases we don't have a username yet. Also, log more stuff. Closes #104
This commit is contained in:
parent
4b5d4b02c9
commit
b91317046b
2 changed files with 10 additions and 3 deletions
includes
|
@ -150,6 +150,7 @@ function _try_login($username, $password) {
|
|||
global $wefactapiurl, $wefactapikey;
|
||||
|
||||
if (!valid_user($username)) {
|
||||
writelog("Illegal username at login!", $username);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -158,6 +159,7 @@ function _try_login($username, $password) {
|
|||
if (isset($wefactapiurl) && isset($wefactapikey)) {
|
||||
$wefact = do_wefact_auth($username, $password);
|
||||
if (false === $wefact ) {
|
||||
writelog("Failed Wefact login!", $username);
|
||||
return false;
|
||||
}
|
||||
if (-1 !== $wefact) {
|
||||
|
@ -166,11 +168,13 @@ function _try_login($username, $password) {
|
|||
}
|
||||
|
||||
if ($do_local_auth && !do_db_auth($username, $password)) {
|
||||
writelog("Failed login!", $username);
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = get_user_info($username);
|
||||
if (!$user) {
|
||||
writelog("Failed to find user!", $username);
|
||||
return false;
|
||||
} else {
|
||||
_set_current_user($username, (bool) $user['isadmin']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue