]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
Code cleanup for mod_auth_ao
[stg.git] / projects / stargazer / plugins / authorization / inetaccess / inetaccess.h
index 453ce38274a5830d7f3afbcf19ae342352073dae..2d932d54c1ba519f5495256c49762b47ba54a958 100644 (file)
@@ -118,7 +118,8 @@ private:
 //-----------------------------------------------------------------------------
 struct IA_USER {
     IA_USER()
-        : lastSendAlive(0),
+        : user(NULL),
+          lastSendAlive(0),
           rnd(random()),
           port(0),
           protoVer(0),
@@ -185,7 +186,20 @@ private:
     FREEMB          freeMbShowType;
 };
 //-----------------------------------------------------------------------------
+class AUTH_IA;
+//-----------------------------------------------------------------------------
+class DEL_USER_NOTIFIER: public NOTIFIER_BASE<USER_PTR> {
+public:
+    DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {}
+    virtual ~DEL_USER_NOTIFIER() {}
+
+    void Notify(const USER_PTR & user);
+private:
+    AUTH_IA & auth;
+};
+//-----------------------------------------------------------------------------
 class AUTH_IA :public AUTH {
+friend class DEL_USER_NOTIFIER;
 public:
                         AUTH_IA();
     virtual             ~AUTH_IA();
@@ -315,19 +329,7 @@ private:
 
     uint32_t            enabledDirs;
 
-    class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
-    public:
-        DEL_USER_NONIFIER(AUTH_IA & a) : auth(a) {}
-        virtual ~DEL_USER_NONIFIER() {}
-
-        void Notify(const USER_PTR & user)
-            {
-            auth.DelUser(user);
-            }
-
-    private:
-        AUTH_IA & auth;
-    } onDelUserNotifier;
+    DEL_USER_NOTIFIER   onDelUserNotifier;
 
     class UnauthorizeUser : std::unary_function<const std::pair<uint32_t, IA_USER> &, void> {
         public:
@@ -342,5 +344,10 @@ private:
 
 };
 //-----------------------------------------------------------------------------
+inline
+void DEL_USER_NOTIFIER::Notify(const USER_PTR & user)
+{
+    auth.DelUser(user);
+}
 
 #endif