+ //! Validate user
+ /**
+ * \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 validateUser(const QString &userName, const QString &password) {
+ return instance()->_storage->validateUser(userName, password);
+ }
+
+
+ //! Change a user's password
+ /**
+ * \param userId The user's ID
+ * \param password The user's unencrypted new password
+ * \return true, if the password change was successful
+ */
+ static bool changeUserPassword(UserId userId, const QString &password);
+
+ //! Store a user setting persistently
+ /**
+ * \param userId The users Id
+ * \param settingName The Name of the Setting
+ * \param data The Value
+ */
+ static inline void setUserSetting(UserId userId, const QString &settingName, const QVariant &data)
+ {
+ instance()->_storage->setUserSetting(userId, settingName, data);
+ }
+
+
+ //! Retrieve a persistent user setting
+ /**
+ * \param userId The users Id
+ * \param settingName The Name of the Setting
+ * \param defaultValue Value to return in case it's unset.
+ * \return the Value of the Setting or the default value if it is unset.
+ */
+ static inline QVariant getUserSetting(UserId userId, const QString &settingName, const QVariant &defaultValue = QVariant())
+ {
+ return instance()->_storage->getUserSetting(userId, settingName, defaultValue);
+ }
+
+
+ /* Identity handling */
+ static inline IdentityId createIdentity(UserId user, CoreIdentity &identity)
+ {
+ return instance()->_storage->createIdentity(user, identity);
+ }
+
+
+ static bool updateIdentity(UserId user, const CoreIdentity &identity)
+ {
+ return instance()->_storage->updateIdentity(user, identity);
+ }
+
+
+ static void removeIdentity(UserId user, IdentityId identityId)
+ {
+ instance()->_storage->removeIdentity(user, identityId);
+ }
+
+
+ static QList<CoreIdentity> identities(UserId user)
+ {
+ return instance()->_storage->identities(user);
+ }
+
+