X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=ef04b77df6c998bd6ab538d4776b0c2ad398a343;hb=d46e1e86c9869996285ac3f88970cf0e9e23e128;hp=b5ca2c1c28e2f1bf509730e667ecb0c1b224b0c8;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;p=quassel.git diff --git a/src/core/core.h b/src/core/core.h index b5ca2c1c..ef04b77d 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 * @@ -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