mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-17 16:11:12 +02:00
2022-10-06 Fred Gleason <fredg@paravelsystems.com>
* Changed the type of the 'MATRICES.PASSWORD` field in the database to 'text'. * Changed the type of the 'MATRICES.PASSWORD_2` field in the database to 'text'. * Applied Base64 encoding to the 'MATRICES.PASSWORD' field in the database. * Applied Base64 encoding to the 'MATRICES.PASSWORD_2' field in the database. * Incremented the database version to 362. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -459,10 +459,10 @@ QString RDMatrix::password(RDMatrix::Role role) const
|
||||
{
|
||||
switch(role) {
|
||||
case RDMatrix::Primary:
|
||||
return GetRow("PASSWORD").toString();
|
||||
return QByteArray::fromBase64(GetRow("PASSWORD").toString().toUtf8());
|
||||
|
||||
case RDMatrix::Backup:
|
||||
return GetRow("PASSWORD_2").toString();
|
||||
return QByteArray::fromBase64(GetRow("PASSWORD_2").toString().toUtf8());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
@@ -472,10 +472,10 @@ void RDMatrix::setPassword(RDMatrix::Role role,const QString &passwd) const
|
||||
{
|
||||
switch(role) {
|
||||
case RDMatrix::Primary:
|
||||
SetRow("PASSWORD",passwd);
|
||||
SetRow("PASSWORD",passwd.toUtf8().toBase64());
|
||||
|
||||
case RDMatrix::Backup:
|
||||
SetRow("PASSWORD_2",passwd);
|
||||
SetRow("PASSWORD_2",passwd.toUtf8().toBase64());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -985,6 +985,26 @@ void RDMatrix::SetRow(const QString ¶m,const QString &value) const
|
||||
}
|
||||
|
||||
|
||||
void RDMatrix::SetRow(const QString ¶m,const QByteArray &value) const
|
||||
{
|
||||
QString sql;
|
||||
|
||||
if(value.size()==0) {
|
||||
sql=QString("update `MATRICES` set `")+
|
||||
param+"`=NULL where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(mx_station)+"' && "+
|
||||
QString::asprintf("`MATRIX`=%d",mx_number);
|
||||
}
|
||||
else {
|
||||
sql=QString("update `MATRICES` set `")+
|
||||
param+"`='"+RDEscapeString(value)+"' where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(mx_station)+"' && "+
|
||||
QString::asprintf("`MATRIX`=%d",mx_number);
|
||||
}
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDMatrix::SetRow(const QString ¶m,int value) const
|
||||
{
|
||||
QString sql;
|
||||
|
Reference in New Issue
Block a user