X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d05a2f0b9869c82f8c02c37e2a8a158dee671a4c..d29d84149a36d3fb5c4baa045d0398e87f79eba8:/include/stg/user.h

diff --git a/include/stg/user.h b/include/stg/user.h
index f0f77bc0..1fa49201 100644
--- a/include/stg/user.h
+++ b/include/stg/user.h
@@ -24,6 +24,9 @@
 #include <ctime>
 #include <string>
 
+#include <vector>
+#include <string>
+
 #include "os_int.h"
 #include "notifer.h"
 #include "message.h"
@@ -33,8 +36,12 @@
 class USER_PROPERTIES;
 class AUTH;
 
+typedef PROPERTY_NOTIFIER_BASE<uint32_t> CURR_IP_NOTIFIER;
+typedef PROPERTY_NOTIFIER_BASE<bool> CONNECTED_NOTIFIER;
+
 class USER {
 public:
+    virtual ~USER() {}
     virtual int                 WriteConf() = 0;
     virtual int                 WriteStat() = 0;
 
@@ -43,17 +50,17 @@ public:
     virtual uint32_t            GetCurrIP() const = 0;
     virtual time_t              GetCurrIPModificationTime() const = 0;
 
-    virtual void                AddCurrIPBeforeNotifier(PROPERTY_NOTIFIER_BASE<uint32_t> * notifier) = 0;
-    virtual void                DelCurrIPBeforeNotifier(PROPERTY_NOTIFIER_BASE<uint32_t> * notifier) = 0;
+    virtual void                AddCurrIPBeforeNotifier(CURR_IP_NOTIFIER * notifier) = 0;
+    virtual void                DelCurrIPBeforeNotifier(const CURR_IP_NOTIFIER * notifier) = 0;
 
-    virtual void                AddCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE<uint32_t> * notifier) = 0;
-    virtual void                DelCurrIPAfterNotifier(PROPERTY_NOTIFIER_BASE<uint32_t> * notifier) = 0;
+    virtual void                AddCurrIPAfterNotifier(CURR_IP_NOTIFIER * notifier) = 0;
+    virtual void                DelCurrIPAfterNotifier(const CURR_IP_NOTIFIER * notifier) = 0;
 
-    virtual void                AddConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE<bool> * notifier) = 0;
-    virtual void                DelConnectedBeforeNotifier(PROPERTY_NOTIFIER_BASE<bool> * notifier) = 0;
+    virtual void                AddConnectedBeforeNotifier(CONNECTED_NOTIFIER * notifier) = 0;
+    virtual void                DelConnectedBeforeNotifier(const CONNECTED_NOTIFIER * notifier) = 0;
 
-    virtual void                AddConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE<bool> * notifier) = 0;
-    virtual void                DelConnectedAfterNotifier(PROPERTY_NOTIFIER_BASE<bool> * notifier) = 0;
+    virtual void                AddConnectedAfterNotifier(CONNECTED_NOTIFIER * notifier) = 0;
+    virtual void                DelConnectedAfterNotifier(const CONNECTED_NOTIFIER * notifier) = 0;
 
     virtual int                 GetID() const = 0;
 
@@ -67,12 +74,12 @@ public:
 
     virtual bool                GetConnected() const = 0;
     virtual time_t              GetConnectedModificationTime() const = 0;
+    virtual const std::string & GetLastDisconnectReason() const = 0;
     virtual int                 GetAuthorized() const = 0;
-    virtual int                 Authorize(uint32_t ip,
-                                          uint32_t enabledDirs,
-                                          const AUTH * auth) = 0;
-    virtual void                Unauthorize(const AUTH * auth) = 0;
+    virtual time_t              GetAuthorizedModificationTime() const = 0;
+
     virtual bool                IsAuthorizedBy(const AUTH * auth) const = 0;
+    virtual std::vector<std::string> GetAuthorizers() const = 0;
 
     virtual int                 AddMessage(STG_MSG * msg) = 0;
 
@@ -99,5 +106,6 @@ public:
 };
 
 typedef USER * USER_PTR;
+typedef const USER * CONST_USER_PTR;
 
 #endif