]> git.stg.codes - stg.git/blobdiff - projects/stargazer/admins_impl.cpp
Lots of stylistic fixes.
[stg.git] / projects / stargazer / admins_impl.cpp
index 53775717700899a1c332179a336d19e4d2069175..10d1108e45fa308e00021c6094cecd5ded75a6bb 100644 (file)
@@ -47,10 +47,12 @@ ADMINS_IMPL::ADMINS_IMPL(STORE * st)
       store(st),
       WriteServLog(GetStgLogger()),
       searchDescriptors(),
-      handle(0)
+      handle(0),
+      mutex(),
+      strError()
 {
 pthread_mutex_init(&mutex, NULL);
-ReadAdmins();
+Read();
 }
 //-----------------------------------------------------------------------------
 int ADMINS_IMPL::Add(const string & login, const ADMIN * admin)
@@ -174,7 +176,7 @@ WriteServLog("%s Administrator \'%s\' changed.",
 return 0;
 }
 //-----------------------------------------------------------------------------
-int ADMINS_IMPL::ReadAdmins()
+int ADMINS_IMPL::Read()
 {
 STG_LOCKER lock(&mutex, __FILE__, __LINE__);
 vector<string> adminsList;
@@ -199,25 +201,14 @@ for (unsigned int i = 0; i < adminsList.size(); i++)
 return 0;
 }
 //-----------------------------------------------------------------------------
-void ADMINS_IMPL::PrintAdmins() const
-{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-const_admin_iter ai(data.begin());
-while (ai != data.end())
-    {
-    ai->Print();
-    ai++;
-    }
-}
-//-----------------------------------------------------------------------------
-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");
 
 STG_LOCKER lock(&mutex, __FILE__, __LINE__);
 if (data.empty())
     {
-    printfd(__FILE__, "no admin in system!\n");
+    printfd(__FILE__, "No admin in system!\n");
     *admin = &noAdmin;
     return false;
     }
@@ -234,7 +225,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())
@@ -252,7 +243,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())