2022-11-05 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in rdadmin(1) that incorrectly handled changing
	a password to an empty value.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-11-05 13:21:41 -04:00
parent 4122764e9d
commit c9c64757ae
3 changed files with 21 additions and 1 deletions

View File

@ -23613,3 +23613,6 @@
2022-11-05 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdcatch(1) that broke record and play-out
metering.
2022-11-05 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdadmin(1) that incorrectly handled changing
a password to an empty value.

View File

@ -147,7 +147,12 @@ QString RDUser::password() const
void RDUser::setPassword(const QString &password)
{
user_password=password;
if(password.isEmpty()) {
SetRowNull("PASSWORD");
}
else {
SetRow("PASSWORD",QString(password.toUtf8().toBase64()));
}
}
@ -831,3 +836,14 @@ void RDUser::SetRow(const QString &param,bool value) const
{
SetRow(param,RDYesNo(value));
}
void RDUser::SetRowNull(const QString &param) const
{
QString sql;
sql=QString("update `USERS` set `")+
param+"`=NULL where "+
"`LOGIN_NAME`='"+RDEscapeString(user_name)+"'";
RDSqlQuery::apply(sql);
}

View File

@ -118,6 +118,7 @@ class RDUser
void SetRow(const QString &param,const QString &value) const;
void SetRow(const QString &param,int value) const;
void SetRow(const QString &param,bool value) const;
void SetRowNull(const QString &param) const;
QString user_name;
QString user_password;
};