X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5023cccbd5e2a7eb64aa22798a88a1c8d17842f5..e9f74534ad9bd4df3cecab080f6b6ac9a6cb6b7c:/projects/stargazer/users_impl.cpp diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index a9761455..14c44604 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -51,29 +51,18 @@ extern volatile time_t stgTime; //#define USERS_DEBUG 1 //----------------------------------------------------------------------------- -USERS_IMPL::USERS_IMPL(SETTINGS_IMPL * s, STORE * st, TARIFFS * t, const ADMIN * sa) - : USERS(), - users(), - usersToDelete(), - /*userIPNotifiersBefore(), - userIPNotifiersAfter(),*/ - ipIndex(), - loginIndex(), - settings(s), +USERS_IMPL::USERS_IMPL(SETTINGS_IMPL * s, STORE * st, + TARIFFS * t, SERVICES & svcs, + const ADMIN * sa) + : settings(s), tariffs(t), + m_services(svcs), store(st), sysAdmin(sa), WriteServLog(GetStgLogger()), nonstop(false), isRunning(false), - mutex(), - thread(), - handle(0), - searchDescriptors(), - onAddNotifiers(), - onDelNotifiers(), - onAddNotifiersImpl(), - onDelNotifiersImpl() + handle(0) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -171,7 +160,7 @@ if (store->AddUser(login)) } ////// -USER_IMPL u(settings, store, tariffs, sysAdmin, this); +USER_IMPL u(settings, store, tariffs, sysAdmin, this, m_services); /*struct tm * tms; time_t t = stgTime; @@ -355,9 +344,10 @@ if (store->GetUsersList(&usersList) < 0) user_iter ui; +unsigned errors = 0; for (unsigned int i = 0; i < usersList.size(); i++) { - USER_IMPL u(settings, store, tariffs, sysAdmin, this); + USER_IMPL u(settings, store, tariffs, sysAdmin, this, m_services); u.SetLogin(usersList[i]); users.push_front(u); @@ -366,12 +356,14 @@ for (unsigned int i = 0; i < usersList.size(); i++) AddUserIntoIndexes(ui); if (ui->ReadConf() < 0) - return -1; + errors++; if (ui->ReadStat() < 0) - return -1; + errors++; } +if (errors > 0) + return -1; return 0; } //-----------------------------------------------------------------------------