mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-25 08:56:00 +02:00
2020-08-19 Fred Gleason <fredg@paravelsystems.com>
* Changed the database field 'FEEDS.PURGE_PASSWORD' from 'varchar(64)' to 'text'. * Changed the contents of the 'FEEDS.PURGE_PASSWORD' database field from plaintext to Base64 encoding. * Incremented the database version to 334. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
6e03dc160f
commit
c5de016536
@ -20259,3 +20259,9 @@
|
||||
rdadmin(1).
|
||||
* Added an 'Authenticate with local identity file' checkbox to
|
||||
the 'Feed' dialog in rdadmin(1).
|
||||
2020-08-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Changed the database field 'FEEDS.PURGE_PASSWORD' from
|
||||
'varchar(64)' to 'text'.
|
||||
* Changed the contents of the 'FEEDS.PURGE_PASSWORD' database
|
||||
field from plaintext to Base64 encoding.
|
||||
* Incremented the database version to 334.
|
||||
|
@ -26,7 +26,7 @@ BASE_URL varchar(191)
|
||||
BASE_PREAMBLE varchar(191)
|
||||
PURGE_URL varchar(191)
|
||||
PURGE_USERNAME varchar(64)
|
||||
PURGE_PASSWORD varchar(64)
|
||||
PURGE_PASSWORD text Base64 encoded
|
||||
PURGE_USE_ID_FILE enum('N','Y')
|
||||
RSS_SCHEMA int(10) unsigned 0=Custom, 1=RSS-2.0.2
|
||||
HEADER_XML text
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 333
|
||||
#define RD_VERSION_DATABASE 334
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
@ -455,14 +455,14 @@ void RDFeed::setPurgeUsername(const QString &str) const
|
||||
|
||||
QString RDFeed::purgePassword() const
|
||||
{
|
||||
return RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname,"PURGE_PASSWORD").
|
||||
toString();
|
||||
return QString(QByteArray::fromBase64(RDGetSqlValue("FEEDS","KEY_NAME",
|
||||
feed_keyname,"PURGE_PASSWORD").toString().toUtf8()));
|
||||
}
|
||||
|
||||
|
||||
void RDFeed::setPurgePassword(const QString &str) const
|
||||
{
|
||||
SetRow("PURGE_PASSWORD",str);
|
||||
SetRow("PURGE_PASSWORD",QString(str.toUtf8().toBase64()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,6 +40,35 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
// NEW SCHEMA REVERSIONS GO HERE...
|
||||
|
||||
|
||||
//
|
||||
// Revert 334
|
||||
//
|
||||
if((cur_schema==334)&&(set_schema<cur_schema)) {
|
||||
sql=QString("select ")+
|
||||
"KEY_NAME,"+ // 00
|
||||
"PURGE_PASSWORD "+ // 01
|
||||
"from FEEDS";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
QString password(QByteArray::fromBase64(q->value(1).toString().toUtf8()));
|
||||
sql=QString("update FEEDS set ")+
|
||||
"PURGE_PASSWORD=\""+RDEscapeString(password)+"\" where "+
|
||||
"KEY_NAME=\""+RDEscapeString(q->value(0).toString())+"\"";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
sql=QString("alter table FEEDS modify column ")+
|
||||
"PURGE_PASSWORD varchar(64)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(--cur_schema);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Revert 333
|
||||
//
|
||||
|
@ -161,7 +161,7 @@ void MainObject::InitializeSchemaMap() {
|
||||
global_version_map["3.2"]=311;
|
||||
global_version_map["3.3"]=314;
|
||||
global_version_map["3.4"]=317;
|
||||
global_version_map["4.0"]=333;
|
||||
global_version_map["4.0"]=334;
|
||||
}
|
||||
|
||||
|
||||
|
@ -10218,6 +10218,31 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
if((cur_schema<334)&&(set_schema>cur_schema)) {
|
||||
sql=QString("alter table FEEDS modify column ")+
|
||||
"PURGE_PASSWORD text";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
sql=QString("select ")+
|
||||
"KEY_NAME,"+ // 00
|
||||
"PURGE_PASSWORD "+ // 01
|
||||
"from FEEDS";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
sql=QString("update FEEDS set ")+
|
||||
"PURGE_PASSWORD=\""+
|
||||
RDEscapeString(q->value(1).toString().toUtf8().toBase64())+"\" where "+
|
||||
"KEY_NAME=\""+RDEscapeString(q->value(0).toString())+"\"";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user