mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-18 08:31:16 +02:00
2022-10-06 Fred Gleason <fredg@paravelsystems.com>
* Changed the length of the 'USERS.PASSWORD' field in the database to 191 characters. * Applied Base64 encoding to the 'USERS.PASSWORD' field in the database. * Incremented the database version to 359. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -102,8 +102,13 @@ bool RDUser::authenticated(bool webuser) const
|
||||
"`LOGIN_NAME`,"+
|
||||
"`ENABLE_WEB` "+
|
||||
"from `USERS` where "+
|
||||
"`LOGIN_NAME`='"+RDEscapeString(user_name)+"' && "+
|
||||
"`PASSWORD`='"+RDEscapeString(user_password)+"'";
|
||||
"`LOGIN_NAME`='"+RDEscapeString(user_name)+"' && ";
|
||||
if(user_password.isEmpty()) {
|
||||
sql+="`PASSWORD` is null";
|
||||
}
|
||||
else {
|
||||
sql+="`PASSWORD`='"+RDEscapeString(user_password.toUtf8().toBase64())+"'";
|
||||
}
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
bool ret=RDBool(q->value(1).toString())||
|
||||
@@ -134,14 +139,15 @@ bool RDUser::checkPassword(const QString &password,bool webuser)
|
||||
|
||||
QString RDUser::password() const
|
||||
{
|
||||
return RDGetSqlValue("USERS","LOGIN_NAME",user_name,"PASSWORD").toString();
|
||||
return QByteArray::fromBase64(RDGetSqlValue("USERS","LOGIN_NAME",user_name,
|
||||
"PASSWORD").toString().toUtf8());
|
||||
}
|
||||
|
||||
|
||||
void RDUser::setPassword(const QString &password)
|
||||
{
|
||||
user_password=password;
|
||||
SetRow("PASSWORD",password);
|
||||
SetRow("PASSWORD",QString(password.toUtf8().toBase64()));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user