Explorar el Código

Add remote IP address to warning on form login (#8942)

Closes #8941
Add remote IP address to warning on form login
Jeremy Nguyen hace 4 días
padre
commit
a8a4264af2
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      app/Controllers/authController.php

+ 3 - 2
app/Controllers/authController.php

@@ -120,9 +120,10 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
 			$nonce = Minz_Session::paramString('nonce');
 			$username = Minz_Request::paramString('username');
 			$challenge = Minz_Request::paramString('challenge');
+			$ip_address = Minz_Request::connectionRemoteAddress();
 
 			if ($nonce === '') {
-				Minz_Log::warning("Invalid session during login for user={$username}, nonce={$nonce}");
+				Minz_Log::warning("Invalid session during login for user={$username}, nonce={$nonce}, ip_address={$ip_address}");
 				header('HTTP/1.1 403 Forbidden');
 				Minz_Session::_param('POST_to_GET', true);	//Prevent infinite internal redirect
 				Minz_Request::setBadNotification(_t('install.session.nok'));
@@ -181,7 +182,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
 					showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
 				);
 			} else {
-				Minz_Log::warning("Password mismatch for user={$username}, nonce={$nonce}, c={$challenge}");
+				Minz_Log::warning("Password mismatch for user={$username}, nonce={$nonce}, c={$challenge}, ip_address={$ip_address}");
 				header('HTTP/1.1 403 Forbidden');
 				Minz_Session::_param('POST_to_GET', true);	//Prevent infinite internal redirect
 				Minz_Request::setBadNotification(_t('feedback.auth.login.invalid'));