X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..52f80d6ec77e44660f353e19c71e7994df59496d:/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp index 6a40979f..11c757f2 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp @@ -33,10 +33,10 @@ #include -#include "stg_const.h" -#include "postgresql_store.h" -#include "stg_locker.h" +#include "stg/const.h" +#include "stg/locker.h" #include "../../../stg_timer.h" +#include "postgresql_store.h" //----------------------------------------------------------------------------- int POSTGRESQL_STORE::GetUsersList(vector * usersList) const @@ -906,7 +906,11 @@ for (int i = 0; i < tuples; ++i) } else { - conf->userdata[i] = PQgetvalue(result, i, 1); + if (num < USERDATA_NUM && + num >= 0) + { + conf->userdata[num] = PQgetvalue(result, i, 1); + } } } @@ -1056,7 +1060,7 @@ std::stringstream query; query << "SELECT sp_add_param_log_entry(" "'" << elogin << "', " "'" << eadminLogin << "', CAST('" - << inet_ntostring(admIP) << "/24' AS INET), " + << inet_ntostring(admIP) << "/32' AS INET), " "'" << eparam << "', " "CAST('" << Int2TS(stgTime) << "' AS TIMESTAMP), " "'" << eold << "', " @@ -1330,7 +1334,7 @@ return 0; } //----------------------------------------------------------------------------- -int POSTGRESQL_STORE::WriteDetailedStat(const map * statTree, +int POSTGRESQL_STORE::WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const { @@ -1370,7 +1374,7 @@ if (EscapeString(elogin)) map::const_iterator it; time_t currTime = time(NULL); -for (it = statTree->begin(); it != statTree->end(); ++it) +for (it = statTree.begin(); it != statTree.end(); ++it) { std::stringstream query; query << "INSERT INTO tb_detail_stats "