database request to delete all expired reset keys
This commit is contained in:
@ -118,6 +118,12 @@ namespace Database {
|
|||||||
const static std::string PREPARED_STATEMENT_UPDATE_FREELANCER_PASSWORD_HASH = "updateFreelancerPasswordHash";
|
const static std::string PREPARED_STATEMENT_UPDATE_FREELANCER_PASSWORD_HASH = "updateFreelancerPasswordHash";
|
||||||
const static std::string SQL_STATEMENT_UPDATE_FREELANCER_PASSWORD_HASH = "update freelancers set hash = $1, salt = $2 where emailaddress = $3;";
|
const static std::string SQL_STATEMENT_UPDATE_FREELANCER_PASSWORD_HASH = "update freelancers set hash = $1, salt = $2 where emailaddress = $3;";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Statement to remove expired reset keys
|
||||||
|
*/
|
||||||
|
const static std::string SQL_STATEMENT_PURGE_EXPIRED_FREELANCER_RESET_KEYS = "delete from passwordresetkeys where expiration <= CURRENT_TIMESTAMP;";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Selects freelancers, their basicInfo and if the commissions are closed/open ordered by name.
|
* Selects freelancers, their basicInfo and if the commissions are closed/open ordered by name.
|
||||||
* Delivers if the commission limit has been reached and if the commissions are closed based on the accepted/completed state of the freelancers requests
|
* Delivers if the commission limit has been reached and if the commissions are closed based on the accepted/completed state of the freelancers requests
|
||||||
@ -301,6 +307,17 @@ namespace Database {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Executes the PURGE_EXPIRED_FREELANCER_RESET_KEYS statement
|
||||||
|
* Takes an open pqxx::connection
|
||||||
|
* todo::regular execution
|
||||||
|
*/
|
||||||
|
void executeStatement_STATEMENT_PURGE_EXPIRED_FREELANCER_RESET_KEYS(pqxx::connection &connection) {
|
||||||
|
pqxx::work work(connection);
|
||||||
|
work.exec(SQL_STATEMENT_PURGE_EXPIRED_FREELANCER_RESET_KEYS);
|
||||||
|
work.commit();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Executes the prepared statement SELECT_ITEM_BY_ID
|
* Executes the prepared statement SELECT_ITEM_BY_ID
|
||||||
* Takes an open pqxx::connection and the id to select by
|
* Takes an open pqxx::connection and the id to select by
|
||||||
|
Reference in New Issue
Block a user