mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Define default user and password as constants
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
#include <QDateTime>
|
||||
#include <QUuid>
|
||||
|
||||
namespace hyperion {
|
||||
const char DEFAULT_USER[] = "Hyperion";
|
||||
const char DEFAULT_PASSWORD[] = "hyperion";
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief Authentication table interface
|
||||
///
|
||||
@@ -149,10 +154,10 @@ public:
|
||||
inline bool resetHyperionUser()
|
||||
{
|
||||
QVariantMap map;
|
||||
map["password"] = calcPasswordHashOfUser("Hyperion", "hyperion");
|
||||
map["password"] = calcPasswordHashOfUser(hyperion::DEFAULT_USER, hyperion::DEFAULT_PASSWORD);
|
||||
|
||||
VectorPair cond;
|
||||
cond.append(CPair("user", "Hyperion"));
|
||||
cond.append(CPair("user", hyperion::DEFAULT_USER));
|
||||
return updateRecord(cond, map);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <utils/Logger.h>
|
||||
#include <utils/settings.h>
|
||||
|
||||
#include <db/AuthTable.h>
|
||||
|
||||
//qt
|
||||
#include <QMap>
|
||||
#include <QVector>
|
||||
@@ -172,7 +174,7 @@ public slots:
|
||||
/// @param usr the defined user
|
||||
/// @return The token
|
||||
///
|
||||
QString getUserToken(const QString &usr = "Hyperion") const;
|
||||
QString getUserToken(const QString &usr = hyperion::DEFAULT_USER) const;
|
||||
|
||||
///
|
||||
/// @brief Get all available token entries
|
||||
|
||||
Reference in New Issue
Block a user