X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/203056055696ed765a66342e7e9e74ba1ffc10a3..bc4721533e4041a19b42cb247064f9f42c3f9d5f:/projects/stargazer/users_impl.cpp?ds=sidebyside diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index 08181ae1..fa726560 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -53,7 +53,8 @@ extern const volatile time_t stgTime; //----------------------------------------------------------------------------- USERS_IMPL::USERS_IMPL(SETTINGS_IMPL * s, STORE * st, TARIFFS * t, const ADMIN * sa) - : users(), + : USERS(), + users(), usersToDelete(), userIPNotifiersBefore(), userIPNotifiersAfter(), @@ -227,6 +228,8 @@ if (!priv->userAddDel) login.c_str()); return; } + + u->SetDeleted(); } { @@ -251,7 +254,6 @@ if (!priv->userAddDel) STG_LOCKER lock(&mutex, __FILE__, __LINE__); u->OnDelete(); - u->SetDeleted(); USER_TO_DEL utd; utd.iter = u; @@ -274,7 +276,7 @@ usersList.clear(); if (store->GetUsersList(&usersList) < 0) { WriteServLog(store->GetStrError().c_str()); - exit(1); + return -1; } user_iter ui; @@ -458,7 +460,7 @@ if (t1.tm_mday == dayResetTraff) { printfd(__FILE__, "ResetTraff\n"); for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::ProcessNewMonth)); - for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::SetPrepaidTraff)); + //for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::SetPrepaidTraff)); } } //----------------------------------------------------------------------------- @@ -525,7 +527,7 @@ for (list::iterator it = users.begin(); it->WriteDetailStat(true); for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::WriteStat)); -for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::WriteConf)); +//for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::WriteConf)); printfd(__FILE__, "USERS::Stop()\n"); return 0; @@ -560,11 +562,6 @@ while (iter != usersToDelete.end()) return; } //----------------------------------------------------------------------------- -int USERS_IMPL::GetUserNum() const -{ -return users.size(); -} -//----------------------------------------------------------------------------- void USERS_IMPL::AddToIPIdx(user_iter user) { printfd(__FILE__, "USERS: Add IP Idx\n");