X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=ef24592f7ef6b0104d71c38c22253c7004120e5d;hp=d8f81abe516d0801f8bce7f75c71036001e31969;hb=8961f348947fc55cc4bc769563684af3f2ea7ccc;hpb=8efbb2ef22f5f007b5dc6d5b15ecf070ccef08ca diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index d8f81abe..ef24592f 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -20,6 +20,8 @@ #include "coreauthhandler.h" +#include + #ifdef HAVE_SSL # include #endif @@ -29,6 +31,7 @@ CoreAuthHandler::CoreAuthHandler(QTcpSocket* socket, QObject* parent) : AuthHandler(parent) , _peer(nullptr) + , _metricsServer(Core::instance()->metricsServer()) , _magicReceived(false) , _legacy(false) , _clientRegistered(false) @@ -247,9 +250,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())));