X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/4b7c2c628f550de5c28e756a4abf033e52ffca38..30723e4545227800cd3b43f2423f6760b1e4e22d:/projects/stargazer/plugins/authorization/ao/ao.cpp diff --git a/projects/stargazer/plugins/authorization/ao/ao.cpp b/projects/stargazer/plugins/authorization/ao/ao.cpp index 84e97a0d..f1b05dbc 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.cpp +++ b/projects/stargazer/plugins/authorization/ao/ao.cpp @@ -34,6 +34,7 @@ $Author: faust $ #include "user.h" #include "users.h" #include "user_property.h" +#include "common.h" #include "../../../eventloop.h" class AO_CREATOR @@ -135,33 +136,13 @@ isRunning = false; return 0; } //----------------------------------------------------------------------------- -bool AUTH_AO::IsRunning() -{ -return isRunning; -} -//----------------------------------------------------------------------------- -uint16_t AUTH_AO::GetStartPosition() const -{ -return 70; -} -//----------------------------------------------------------------------------- -uint16_t AUTH_AO::GetStopPosition() const -{ -return 70; -} -//----------------------------------------------------------------------------- void AUTH_AO::SetUserNotifiers(USER_PTR u) { // ---------- AlwaysOnline ------------------- CHG_BEFORE_NOTIFIER BeforeChgAONotifier(*this, u); CHG_AFTER_NOTIFIER AfterChgAONotifier(*this, u); -/*BeforeChgAONotifier.SetAuthorizator(this); -BeforeChgAONotifier.SetUser(u);*/ BeforeChgAONotifierList.push_front(BeforeChgAONotifier); - -/*AfterChgAONotifier.SetAuthorizator(this); -AfterChgAONotifier.SetUser(u);*/ AfterChgAONotifierList.push_front(AfterChgAONotifier); u->GetProperty().alwaysOnline.AddBeforeNotifier(&(*BeforeChgAONotifierList.begin())); @@ -172,12 +153,7 @@ u->GetProperty().alwaysOnline.AddAfterNotifier(&(*AfterChgAONotifierList.begin() CHG_BEFORE_NOTIFIER BeforeChgIPNotifier(*this, u); CHG_AFTER_NOTIFIER AfterChgIPNotifier(*this, u); -/*BeforeChgIPNotifier.SetAuthorizator(this); -BeforeChgIPNotifier.SetUser(u);*/ BeforeChgIPNotifierList.push_front(BeforeChgIPNotifier); - -/*AfterChgIPNotifier.SetAuthorizator(this); -AfterChgIPNotifier.SetUser(u);*/ AfterChgIPNotifierList.push_front(AfterChgIPNotifier); u->GetProperty().ips.AddBeforeNotifier(&(*BeforeChgIPNotifierList.begin())); @@ -254,12 +230,8 @@ if (!h) return; } -while (1) +while (users->SearchNext(h, &u)) { - if (users->SearchNext(h, &u)) - { - break; - } usersList.push_back(u); SetUserNotifiers(u); } @@ -297,8 +269,9 @@ void AUTH_AO::DelUser(USER_PTR u) { Unauthorize(u); UnSetUserNotifiers(u); +usersList.remove(u); -list::iterator users_iter; +/*list::iterator users_iter; users_iter = usersList.begin(); while (users_iter != usersList.end()) @@ -309,7 +282,7 @@ while (users_iter != usersList.end()) break; } ++users_iter; - } + }*/ } //----------------------------------------------------------------------------- int AUTH_AO::SendMessage(const STG_MSG &, uint32_t) const