]> git.stg.codes - stg.git/blobdiff - projects/sgconf/users.cpp
Implemented some service and corporation management functions.
[stg.git] / projects / sgconf / users.cpp
index 0fb68544e1584961a5aad457729481e91eaf51fe..3958869c0eb6ab3ed80ac2c40f3d7d7e86d442e1 100644 (file)
@@ -25,7 +25,8 @@ std::cout << Indent(level, true) << "login: " << info.login << "\n"
           << Indent(level)       << "cash: " << info.cash << "\n"
           << Indent(level)       << "credit: " << info.credit << "\n"
           << Indent(level)       << "credit expire: " << TimeToString(info.creditExpire) << "\n"
-          << Indent(level)       << "last cash add: " << info.lastCash << "\n"
+          << Indent(level)       << "last cash add: " << info.lastCashAdd << "\n"
+          << Indent(level)       << "last cash add time: " << TimeToString(info.lastCashAddTime) << "\n"
           << Indent(level)       << "prepaid traffic: " << info.prepaidTraff << "\n"
           << Indent(level)       << "disabled: " << (info.disabled ? "t" : "f") << "\n"
           << Indent(level)       << "passive: " << (info.passive ? "t" : "f") << "\n"
@@ -42,6 +43,8 @@ std::cout << Indent(level, true) << "login: " << info.login << "\n"
           << Indent(level)       << "address: " << info.address << "\n"
           << Indent(level)       << "phone: " << info.phone << "\n"
           << Indent(level)       << "free mb: " << info.stat.freeMb << "\n"
+          << Indent(level)       << "last ping time: " << TimeToString(info.pingTime) << "\n"
+          << Indent(level)       << "last activity time: " << TimeToString(info.lastActivityTime) << "\n"
           << Indent(level)       << "traffic:\n";
 for (size_t i = 0; i < DIR_NUM; ++i)
     {
@@ -54,6 +57,12 @@ for (size_t i = 0; i < DIR_NUM; ++i)
 std::cout << Indent(level)       << "user data:\n";
 for (size_t i = 0; i < USERDATA_NUM; ++i)
     std::cout << Indent(level + 1, true) << "user data " << i << ": " << info.userData[i] << "\n";
+if (!info.authBy.empty())
+    {
+    std::cout << Indent(level) << "auth by:\n";
+    for (size_t i = 0; i < info.authBy.size(); ++i)
+        std::cout << Indent(level + 1, true) << info.authBy[i] << "\n";
+    }
 }
 
 void SimpleCallback(bool result,
@@ -132,8 +141,8 @@ return proto.DelUser(arg, SimpleCallback, NULL) == STG::st_ok;
 }
 
 bool SGCONF::AddUserFunction(const SGCONF::CONFIG & config,
-                               const std::string & arg,
-                               const std::map<std::string, std::string> & /*options*/)
+                             const std::string & arg,
+                             const std::map<std::string, std::string> & /*options*/)
 {
 // TODO
 std::cerr << "Unimplemented.\n";
@@ -141,6 +150,15 @@ return false;
 }
 
 bool SGCONF::ChgUserFunction(const SGCONF::CONFIG & config,
+                             const std::string & arg,
+                             const std::map<std::string, std::string> & options)
+{
+// TODO
+std::cerr << "Unimplemented.\n";
+return false;
+}
+
+bool SGCONF::CheckUserFunction(const SGCONF::CONFIG & config,
                                const std::string & arg,
                                const std::map<std::string, std::string> & options)
 {
@@ -148,3 +166,12 @@ bool SGCONF::ChgUserFunction(const SGCONF::CONFIG & config,
 std::cerr << "Unimplemented.\n";
 return false;
 }
+
+bool SGCONF::SendMessageFunction(const SGCONF::CONFIG & config,
+                                 const std::string & arg,
+                                 const std::map<std::string, std::string> & options)
+{
+// TODO
+std::cerr << "Unimplemented.\n";
+return false;
+}