X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..ee1709cd231588fe672d0bd2546ef69ee87ff88c:/projects/stargazer/plugins/authorization/ao/ao.h diff --git a/projects/stargazer/plugins/authorization/ao/ao.h b/projects/stargazer/plugins/authorization/ao/ao.h index dbb2993a..18b41429 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.h +++ b/projects/stargazer/plugins/authorization/ao/ao.h @@ -24,6 +24,7 @@ #include "stg/module_settings.h" #include "stg/store.h" #include "stg/notifer.h" +#include "stg/subscriptions.h" #include "stg/user_ips.h" #include "stg/user.h" #include "stg/logger.h" @@ -51,7 +52,7 @@ public: : user(u), auth(a) {} CHG_BEFORE_NOTIFIER(const CHG_BEFORE_NOTIFIER & rvalue) : user(rvalue.user), auth(rvalue.auth) {} - void Notify(const T & oldValue, const T & newValue); + void notify(const T & oldValue, const T & newValue) override; UserPtr GetUser() const { return user; } private: @@ -68,7 +69,7 @@ public: : user(u), auth(a) {} CHG_AFTER_NOTIFIER(const CHG_AFTER_NOTIFIER & rvalue) : user(rvalue.user), auth(rvalue.auth) {} - void Notify(const T & oldValue, const T & newValue); + void notify(const T & oldValue, const T & newValue) override; UserPtr GetUser() const { return user; } private: @@ -121,31 +122,8 @@ private: std::list > BeforeChgIPNotifierList; std::list > AfterChgIPNotifierList; - class ADD_USER_NONIFIER: public STG::NotifierBase { - public: - explicit ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {} - virtual ~ADD_USER_NONIFIER() {} - void Notify(const UserPtr & user) { auth.AddUser(user); } - - private: - ADD_USER_NONIFIER(const ADD_USER_NONIFIER & rvalue); - ADD_USER_NONIFIER & operator=(const ADD_USER_NONIFIER & rvalue); - - AUTH_AO & auth; - } onAddUserNotifier; - - class DEL_USER_NONIFIER: public STG::NotifierBase { - public: - explicit DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {} - virtual ~DEL_USER_NONIFIER() {} - void Notify(const UserPtr & user) { auth.DelUser(user); } - - private: - DEL_USER_NONIFIER(const DEL_USER_NONIFIER & rvalue); - DEL_USER_NONIFIER & operator=(const DEL_USER_NONIFIER & rvalue); - - AUTH_AO & auth; - } onDelUserNotifier; + STG::ScopedConnection m_onAddUserConn; + STG::ScopedConnection m_onDelUserConn; STG::PluginLogger logger;