X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=b2c6c1efdee6286aa01c4de9b6c52d1b10a6b3a6;hb=2c4cc10cfb540da2b33c2a2dba8e012b2b594395;hp=b5ca2c1c28e2f1bf509730e667ecb0c1b224b0c8;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;p=quassel.git diff --git a/src/core/core.h b/src/core/core.h index b5ca2c1c..b2c6c1ef 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -45,6 +45,7 @@ #include "deferredptr.h" #include "identserver.h" #include "message.h" +#include "metricsserver.h" #include "oidentdconfiggenerator.h" #include "sessionthread.h" #include "singleton.h" @@ -125,6 +126,26 @@ public: return instance()->_storage->getUserAuthenticator(userid) == authenticator; } + //! Gets the authenticator configured for a user. + /** + * \param userName The user's name as a QString. + * \return String value corresponding to the user's configure dauthenticator. + */ + static inline QString getUserAuthenticator(const QString& userName) + { + return instance()->_storage->getUserAuthenticator(instance()->_storage->getUserId(userName)); + } + + //! Gets the user ID mapped to a username. This is necessary so that non-database auth methods can log in users properly. + /** + * \param userName The user's name as a QString. + * \return userId The user's ID. + */ + static inline UserId getUserId(const QString& userName) + { + return instance()->_storage->getUserId(userName); + } + //! Change a user's password /** * \param userId The user's ID @@ -635,6 +656,7 @@ public: inline OidentdConfigGenerator* oidentdConfigGenerator() const { return _oidentdConfigGenerator; } inline IdentServer* identServer() const { return _identServer; } + inline MetricsServer* metricsServer() const { return _metricsServer; } static const int AddClientEventId; @@ -765,6 +787,7 @@ private: QDateTime _startTime; IdentServer* _identServer{nullptr}; + MetricsServer* _metricsServer{nullptr}; bool _initialized{false}; bool _configured{false};