X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=ad46352b50903a04ff1eeb98e9a8422a90f4b490;hp=d8f81abe516d0801f8bce7f75c71036001e31969;hb=8f92b3f08df9f4eb8fd243ccec6aa9d4b563ec23;hpb=dc0cc8130d64a74df07a133bc1cc457ab12bb7a0 diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index d8f81abe..ad46352b 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -29,6 +29,7 @@ CoreAuthHandler::CoreAuthHandler(QTcpSocket* socket, QObject* parent) : AuthHandler(parent) , _peer(nullptr) + , _metricsServer(Core::instance()->metricsServer()) , _magicReceived(false) , _legacy(false) , _clientRegistered(false) @@ -247,9 +248,15 @@ void CoreAuthHandler::handle(const Protocol::Login& msg) qInfo() << qPrintable(tr("Invalid login attempt from %1 as \"%2\"").arg(socket()->peerAddress().toString(), msg.user)); _peer->dispatch(Protocol::LoginFailed(tr( "Invalid username or password!
The username/password combination you supplied could not be found in the database."))); + if (_metricsServer) { + _metricsServer->addLoginAttempt(msg.user, false); + } return; } _peer->dispatch(Protocol::LoginSuccess()); + if (_metricsServer) { + _metricsServer->addLoginAttempt(uid, true); + } qInfo() << qPrintable(tr("Client %1 initialized and authenticated successfully as \"%2\" (UserId: %3).") .arg(socket()->peerAddress().toString(), msg.user, QString::number(uid.toInt())));