From: Marcel Werk Date: Mon, 23 May 2016 14:19:30 +0000 (+0200) Subject: Fixed logging of user id in authentication failures X-Git-Tag: 3.0.0_Beta_1~1650 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0347c224ca4402160c92ca2f23bf72459b851e35;p=GitHub%2FWoltLab%2FWCF.git Fixed logging of user id in authentication failures --- diff --git a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php index 1dee48335c..da8418b901 100755 --- a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php @@ -150,10 +150,13 @@ class LoginForm extends AbstractCaptchaForm { // save authentication failure if (ENABLE_USER_AUTHENTICATION_FAILURE) { if ($this->errorField == 'username' || $this->errorField == 'password') { + $user = User::getUserByUsername($this->username); + if (!$user->userID) $user = User::getUserByEmail($this->username); + $action = new UserAuthenticationFailureAction([], 'create', [ 'data' => [ 'environment' => (RequestHandler::getInstance()->isACPRequest() ? 'admin' : 'user'), - 'userID' => ($this->user !== null ? $this->user->userID : null), + 'userID' => ($user->userID ?: null), 'username' => $this->username, 'time' => TIME_NOW, 'ipAddress' => UserUtil::getIpAddress(),