X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp index ad28af3a..ba21aa61 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp @@ -44,14 +44,13 @@ STG_LOCKER lock(&mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -std::string name; - try { tr->Start(); st->Execute("select name from tb_users"); while (st->Fetch()) { + std::string name; st->Get(1, name); usersList->push_back(name); } @@ -337,11 +336,11 @@ try st->Execute(); st->Prepare("insert into tb_allowed_ip (fk_user, ip, mask) values (?, ?, ?)"); - for(size_t i = 0; i < conf.ips.count(); i++) + for(size_t j = 0; j < conf.ips.count(); j++) { st->Set(1, uid); - st->Set(2, (int32_t)conf.ips[i].ip); - st->Set(3, (int32_t)conf.ips[i].mask); + st->Set(2, (int32_t)conf.ips[j].ip); + st->Set(3, (int32_t)conf.ips[j].mask); st->Execute(); } tr->Commit();