X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a89812e5bf8b8628bfc37274326cda6ed2f1a936..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/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 e794d206..87d63344 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp @@ -26,12 +26,14 @@ * */ -#include -#include - #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" @@ -43,14 +45,13 @@ STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -std::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); } @@ -68,7 +69,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); @@ -126,7 +127,7 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::RestoreAdmin(ADMIN_CONF * ac, const std::string & login) const +int FIREBIRD_STORE::RestoreAdmin(STG::AdminConf * ac, const std::string & login) const { STG_LOCKER lock(&mutex); @@ -147,13 +148,13 @@ try { st->Get(2, ac->login); st->Get(3, ac->password); - st->Get(4, (int16_t &)ac->priv.userConf); - st->Get(5, (int16_t &)ac->priv.userPasswd); - st->Get(6, (int16_t &)ac->priv.userStat); - st->Get(7, (int16_t &)ac->priv.userCash); - st->Get(8, (int16_t &)ac->priv.userAddDel); - st->Get(9, (int16_t &)ac->priv.tariffChg); - st->Get(10, (int16_t &)ac->priv.adminChg); + st->Get(4, reinterpret_cast(ac->priv.userConf)); + st->Get(5, reinterpret_cast(ac->priv.userPasswd)); + st->Get(6, reinterpret_cast(ac->priv.userStat)); + st->Get(7, reinterpret_cast(ac->priv.userCash)); + st->Get(8, reinterpret_cast(ac->priv.userAddDel)); + st->Get(9, reinterpret_cast(ac->priv.tariffChg)); + st->Get(10, reinterpret_cast(ac->priv.adminChg)); } else {