mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Push progress
TODO: rework RESET, probably to main.cpp again
This commit is contained in:
@@ -75,6 +75,36 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief update password of given user. The user should be tested (isUserAuthorized) to verify this change
|
||||
/// @param user The user name
|
||||
/// @param newPw The new password to set
|
||||
/// @return True on success else false
|
||||
///
|
||||
inline bool updateUserPassword(const QString& user, const QString& newPw)
|
||||
{
|
||||
QVariantMap map;
|
||||
map["password"] = calcPasswordHashOfUser(user, newPw);
|
||||
|
||||
VectorPair cond;
|
||||
cond.append(CPair("user", user));
|
||||
return updateRecord(cond, map);
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief Reset password of Hyperion user !DANGER! Used in Hyperion main.cpp
|
||||
/// @return True on success else false
|
||||
///
|
||||
inline bool resetHyperionUser()
|
||||
{
|
||||
QVariantMap map;
|
||||
map["password"] = calcPasswordHashOfUser("Hyperion", "hyperion");
|
||||
|
||||
VectorPair cond;
|
||||
cond.append(CPair("user", "Hyperion"));
|
||||
return updateRecord(cond, map);
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief Update 'last_use' column entry for the corresponding user
|
||||
/// @param[in] user The user to search for
|
||||
|
Reference in New Issue
Block a user