X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=ef04b77df6c998bd6ab538d4776b0c2ad398a343;hb=45645a28bdc5b6c1052b3e4cebf8cc80832d205a;hp=0b455aef1cb504cfbdb5408d608bb92281f3f3e6;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003;p=quassel.git diff --git a/src/core/core.h b/src/core/core.h index 0b455aef..ef04b77d 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -125,6 +125,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