return instance()->_authenticator->validateUser(userName, password);
}
+ //! Add a new user, exposed so auth providers can call this without being the storage.
+ /**
+ * \param userName The user's login name
+ * \param password The user's uncrypted password
+ * \return The user's ID if valid; 0 otherwise
+ */
+ static inline UserId addUser(const QString &userName, const QString &password) {
+ return instance()->_storage->addUser(userName, password);
+ }
+
//! Change a user's password
/**
* \param userId The user's ID
bool initStorage(const QString &backend, const QVariantMap &settings, bool setup = false);
bool initAuthenticator(const QString &backend, const QVariantMap &settings, bool setup = false);
-
+
void socketError(QAbstractSocket::SocketError err, const QString &errorString);
void setupClientSession(RemotePeer *, UserId);
bool registerStorageBackend(Storage *);
void unregisterStorageBackends();
void unregisterStorageBackend(Storage *);
-
+
void registerAuthenticatorBackends();
bool registerAuthenticatorBackend(Authenticator *);
void unregisterAuthenticatorBackends();
void unregisterAuthenticatorBackend(Authenticator *);
-
+
bool selectBackend(const QString &backend);
bool createUser();
bool saveBackendSettings(const QString &backend, const QVariantMap &settings);