mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2017-03-27 Fred Gleason <fredg@paravelsystems.com>
* Added a 'WEBAPI_AUTHS' table to the database. * Added a 'USERS.WEBAPI_AUTH_TIMEOUT' field to the database. * Incremented the database version to 260. * Added 'RDUser::webapiAuthTimeout()' and 'RDUser::setWebapiAuthTimeout()' methods in 'lib/rduser.cpp' and 'lib/rduser.h'. * Added a 'WebAPI Timeout' control to the Edit User dialog in 'rdadmin/edit_user.cpp' and 'rdadmin/edit_user.h'. * Implemented a 'CreateTicket' Web API call.
This commit is contained in:
@@ -131,6 +131,7 @@ void MainObject::RunSystemMaintenance()
|
||||
PurgeLogs();
|
||||
PurgeElr();
|
||||
PurgeGpioEvents();
|
||||
PurgeWebapiAuths();
|
||||
sql="update VERSION set LAST_MAINT_DATETIME=now()";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
@@ -280,6 +281,17 @@ void MainObject::PurgeGpioEvents()
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
void MainObject::PurgeWebapiAuths()
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("delete from WEBAPI_AUTHS where EXPIRATION_DATETIME<now()");
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@@ -44,6 +44,7 @@ class MainObject : public QObject
|
||||
void PurgeElr();
|
||||
void PurgeDropboxes();
|
||||
void PurgeGpioEvents();
|
||||
void PurgeWebapiAuths();
|
||||
RDConfig *maint_config;
|
||||
bool maint_verbose;
|
||||
bool maint_system;
|
||||
|
@@ -194,6 +194,10 @@ void MainObject::Revert(int schema) const
|
||||
case 259:
|
||||
Revert259();
|
||||
break;
|
||||
|
||||
case 260:
|
||||
Revert260();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,6 +533,23 @@ void MainObject::Revert259() const
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Revert260() const
|
||||
{
|
||||
QString sql;
|
||||
QSqlQuery *q;
|
||||
|
||||
sql=QString("alter table USERS drop column WEBAPI_AUTH_TIMEOUT");
|
||||
q=new QSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
sql=QString("drop table WEBAPI_AUTHS");
|
||||
q=new QSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
SetVersion(259);
|
||||
}
|
||||
|
||||
|
||||
int MainObject::GetVersion() const
|
||||
{
|
||||
QString sql;
|
||||
@@ -571,6 +592,7 @@ int MainObject::MapSchema(const QString &ver)
|
||||
version_map["2.13"]=255;
|
||||
version_map["2.14"]=258;
|
||||
version_map["2.15"]=259;
|
||||
version_map["2.16"]=260;
|
||||
|
||||
//
|
||||
// Normalize String
|
||||
|
@@ -55,6 +55,7 @@ class MainObject : public QObject
|
||||
void Revert257() const;
|
||||
void Revert258() const;
|
||||
void Revert259() const;
|
||||
void Revert260() const;
|
||||
int GetVersion() const;
|
||||
void SetVersion(int schema) const;
|
||||
int MapSchema(const QString &ver);
|
||||
|
Reference in New Issue
Block a user