X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/687631532197750696d35aa12c40406b04fb878d..b5e75bbd70279384c22f598a6f41f0714b537e4e:/projects/stargazer/admins_impl.cpp diff --git a/projects/stargazer/admins_impl.cpp b/projects/stargazer/admins_impl.cpp index 0179910e..a780fcb3 100644 --- a/projects/stargazer/admins_impl.cpp +++ b/projects/stargazer/admins_impl.cpp @@ -32,8 +32,6 @@ #include #include -#include "stg/admins.h" -#include "stg/admin.h" #include "stg/common.h" #include "admins_impl.h" #include "admin_impl.h" @@ -42,7 +40,8 @@ using namespace std; //----------------------------------------------------------------------------- ADMINS_IMPL::ADMINS_IMPL(STORE * st) - : stg(0xFFFF, "@stargazer", ""), + : ADMINS(), + stg(0xFFFF, "@stargazer", ""), noAdmin(0xFFFF, "NO-ADMIN", ""), data(), store(st), @@ -51,7 +50,7 @@ ADMINS_IMPL::ADMINS_IMPL(STORE * st) handle(0) { pthread_mutex_init(&mutex, NULL); -ReadAdmins(); +Read(); } //----------------------------------------------------------------------------- int ADMINS_IMPL::Add(const string & login, const ADMIN * admin) @@ -72,7 +71,7 @@ admin_iter ai(find(data.begin(), data.end(), adm)); if (ai != data.end()) { - strError = "Administrator \'" + login + "\' cannot not be added. Administrator alredy exist."; + strError = "Administrator \'" + login + "\' cannot not be added. Administrator already exist."; WriteServLog("%s %s", admin->GetLogStr().c_str(), strError.c_str()); return -1; @@ -175,7 +174,7 @@ WriteServLog("%s Administrator \'%s\' changed.", return 0; } //----------------------------------------------------------------------------- -int ADMINS_IMPL::ReadAdmins() +int ADMINS_IMPL::Read() { STG_LOCKER lock(&mutex, __FILE__, __LINE__); vector adminsList; @@ -211,7 +210,7 @@ while (ai != data.end()) } } //----------------------------------------------------------------------------- -bool ADMINS_IMPL::FindAdmin(const string & l, ADMIN ** admin) +bool ADMINS_IMPL::Find(const string & l, ADMIN ** admin) { assert(admin != NULL && "Pointer to admin is not null"); @@ -235,7 +234,7 @@ if (ai != data.end()) return true; } //----------------------------------------------------------------------------- -bool ADMINS_IMPL::AdminExists(const string & login) const +bool ADMINS_IMPL::Exists(const string & login) const { STG_LOCKER lock(&mutex, __FILE__, __LINE__); if (data.empty()) @@ -253,7 +252,7 @@ if (ai != data.end()) return false; } //----------------------------------------------------------------------------- -bool ADMINS_IMPL::AdminCorrect(const string & login, const std::string & password, ADMIN ** admin) +bool ADMINS_IMPL::Correct(const string & login, const std::string & password, ADMIN ** admin) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); if (data.empty())