X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/cf3954a35eaddf462fbe1247f54c0b4b9f9eac80..1c324d5b2380a68f209e65969079677dbaf1c511:/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp index fa949281..a6369acc 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp @@ -26,33 +26,33 @@ * */ -#include -#include - -using namespace std; - #include "firebird_store.h" + #include "stg/ibpp.h" +#include "stg/admin_conf.h" #include "stg/blowfish.h" +#include "stg/common.h" + +#include +#include #define adm_enc_passwd "cjeifY8m3" //----------------------------------------------------------------------------- -int FIREBIRD_STORE::GetAdminsList(vector * adminsList) const +int FIREBIRD_STORE::GetAdminsList(std::vector * adminsList) const { STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -string login; - try { tr->Start(); st->Execute("select login from tb_admins"); while (st->Fetch()) { + std::string login; st->Get(1, login); adminsList->push_back(login); } @@ -70,7 +70,7 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::SaveAdmin(const ADMIN_CONF & ac) const +int FIREBIRD_STORE::SaveAdmin(const STG::AdminConf & ac) const { STG_LOCKER lock(&mutex); @@ -128,7 +128,7 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::RestoreAdmin(ADMIN_CONF * ac, const string & login) const +int FIREBIRD_STORE::RestoreAdmin(STG::AdminConf * ac, const std::string & login) const { STG_LOCKER lock(&mutex); @@ -191,7 +191,7 @@ ac->password = adminPass; return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::AddAdmin(const string & login) const +int FIREBIRD_STORE::AddAdmin(const std::string & login) const { STG_LOCKER lock(&mutex); @@ -229,7 +229,7 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::DelAdmin(const string & login) const +int FIREBIRD_STORE::DelAdmin(const std::string & login) const { STG_LOCKER lock(&mutex);