Commit 1c560eca authored by Michael Niewoehner's avatar Michael Niewoehner

ZP-1058 autodiscover: Print IP to log on failed authentication for usage with e.g. fail2ban

Released under the Affero GNU General Public License (AGPL) version 3.
parent fac35733
...@@ -106,7 +106,9 @@ class ZPushAutodiscover { ...@@ -106,7 +106,9 @@ class ZPushAutodiscover {
catch (AuthenticationRequiredException $ex) { catch (AuthenticationRequiredException $ex) {
if (isset($incomingXml)) { if (isset($incomingXml)) {
ZLog::Write(LOGLEVEL_ERROR, sprintf("Unable to complete autodiscover because login failed for user with email '%s'", $incomingXml->Request->EMailAddress)); // log the failed login attemt e.g. for fail2ban
if (defined('LOGAUTHFAIL') && LOGAUTHFAIL != false)
ZLog::Write(LOGLEVEL_WARN, sprintf("Unable to complete autodiscover because login failed for user with email '%s' from IP %s.", $incomingXml->Request->EMailAddress, $_SERVER["REMOTE_ADDR"]));
} }
else { else {
ZLog::Write(LOGLEVEL_ERROR, sprintf("Unable to complete autodiscover incorrect request: '%s'", $ex->getMessage())); ZLog::Write(LOGLEVEL_ERROR, sprintf("Unable to complete autodiscover incorrect request: '%s'", $ex->getMessage()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment