]> git.stg.codes - stg.git/commitdiff
Method GetParamValue
authorNaffanya <naffanya@naffanya.(none)>
Sun, 14 Jul 2013 18:50:14 +0000 (21:50 +0300)
committerNaffanya <naffanya@naffanya.(none)>
Sun, 14 Jul 2013 18:50:14 +0000 (21:50 +0300)
include/stg/user.h
include/stg/users.h
projects/stargazer/main.cpp
projects/stargazer/user_impl.cpp
projects/stargazer/user_impl.h

index b9d638d626a5437a0ebc8c1b49d501c7ba43781b..b011555581dfc0e8e75c4160bb9bcf6d6a1b7dd2 100644 (file)
@@ -100,6 +100,8 @@ public:
 
     virtual void                OnAdd() = 0;
     virtual void                OnDelete() = 0;
 
     virtual void                OnAdd() = 0;
     virtual void                OnDelete() = 0;
+
+    virtual const std::string & GetParamValue(const std::string & name) const = 0;
 };
 
 typedef USER * USER_PTR;
 };
 
 typedef USER * USER_PTR;
index 2ba238332297b5b70d0267dc4e967d5aacec9428..ed9af90172639606c22a6a6566992fcdfd410862 100644 (file)
@@ -60,6 +60,7 @@ public:
 
     virtual int  Start() = 0;
     virtual int  Stop() = 0;
 
     virtual int  Start() = 0;
     virtual int  Stop() = 0;
+
 };
 
 #endif
 };
 
 #endif
index c2134f4906860f25d82a532e4f34e341736e0bb8..020af9dad817727d8f66f2a580f2b7e7e0de9c55 100644 (file)
@@ -267,7 +267,7 @@ if (settings->ReadSettings())
 
     if (settings->GetLogFileName() != "")
         WriteServLog.SetLogFileName(settings->GetLogFileName());
 
     if (settings->GetLogFileName() != "")
         WriteServLog.SetLogFileName(settings->GetLogFileName());
-    
+
     WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
     exit(1);
     }
     WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
     exit(1);
     }
@@ -279,7 +279,7 @@ if (settings->ReadSettings())
         printfd(__FILE__, "%s\n", it->c_str());
         ++it;
         }
         printfd(__FILE__, "%s\n", it->c_str());
         ++it;
         }
-    printfd(__FILE__, "--- End dump ---\n"); 
+    printfd(__FILE__, "--- End dump ---\n");
     /*************************************************************************************************/
 #ifndef NO_DAEMON
 std::string startFile(settings->GetConfDir() + START_FILE);
     /*************************************************************************************************/
 #ifndef NO_DAEMON
 std::string startFile(settings->GetConfDir() + START_FILE);
index ac8399cabe77cf7149267dcdc71562eab1ac7563..95989c45361d8dd880dd12856cfffb16eef016fd 100644 (file)
@@ -1457,6 +1457,121 @@ while (it != messages.end())
     }
 }
 //-----------------------------------------------------------------------------
     }
 }
 //-----------------------------------------------------------------------------
+const std::string & USER_IMPL::GetParamValue(const std::string & name) const
+    {
+    std::string value;
+
+    if (name=="cash")
+        {
+        value=property.cash;
+        }
+    if (name=="freeMb")
+        {
+        value=property.freeMb;
+        }
+    if (name=="passive")
+        {
+        value=property.passive;
+        }
+    if (name=="disabled")
+        {
+        value=property.disabled;
+        }
+    if (name=="alwaysOnline")
+        {
+        value=property.alwaysOnline;
+        }
+    if (name=="tariffName")
+        {
+        value=property.tariffName;
+        }
+    if (name=="nextTariff")
+        {
+        value=property.nextTariff;
+        }
+    if (name=="address")
+        {
+        value=property.address;
+        }
+    if (name=="note")
+        {
+        value=property.note;
+        }
+    if (name=="group")
+        {
+        value=property.group;
+        }
+    if (name=="email")
+        {
+        value=property.email;
+        }
+    if (name=="phone")
+        {
+        value=property.phone;
+        }
+    if (name=="realName")
+        {
+        value=property.realName;
+        }
+    if (name=="credit")
+        {
+        value=property.credit;
+        }
+    if (name=="userdata0")
+        {
+        value=property.userdata0;
+        }
+    if (name=="userdata1")
+        {
+        value=property.userdata1;
+        }
+    if (name=="userdata2")
+        {
+        value=property.userdata2;
+        }
+    if (name=="userdata3")
+        {
+        value=property.userdata3;
+        }
+    if (name=="userdata4")
+        {
+        value=property.userdata4;
+        }
+    if (name=="userdata5")
+        {
+        value=property.userdata5;
+        }
+    if (name=="userdata6")
+        {
+        value=property.userdata6;
+        }
+    if (name=="userdata7")
+        {
+        value=property.userdata7;
+        }
+    if (name=="userdata8")
+        {
+        value=property.userdata8;
+        }
+    if (name=="userdata9")
+        {
+        value=property.userdata9;
+        }
+    if (name=="id")
+        {
+        value=id;
+        }
+    if (name=="login")
+        {
+        value=login;
+        }
+    if (name=="ip")
+        {
+        value=currIP;
+        }
+    return value;
+    }
+//-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void CHG_PASSIVE_NOTIFIER::Notify(const int & oldPassive, const int & newPassive)
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void CHG_PASSIVE_NOTIFIER::Notify(const int & oldPassive, const int & newPassive)
index 5e8f49dbad303a53d95607d4776c1bbe73f83c70..5fe02bb35cfa62847a3ce18c1b1f6e7c02cd2383 100644 (file)
@@ -216,6 +216,8 @@ public:
     void            OnAdd();
     void            OnDelete();
 
     void            OnAdd();
     void            OnDelete();
 
+    virtual const std::string & GetParamValue(const std::string & name) const;
+
 private:
     USER_IMPL & operator=(const USER_IMPL & rvalue);
 
 private:
     USER_IMPL & operator=(const USER_IMPL & rvalue);