]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp
Corrected upload/download mess.
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / parser_users.cpp
index f596bfbfd9f0fc87d4a6109ccb3ed8b4170f73ee..23cb17def527966b517a54545c5f8ab182318ae0 100644 (file)
@@ -26,7 +26,6 @@
 #include "stg/user_property.h"
 #include "stg/user_conf.h"
 #include "stg/user_stat.h"
-#include "stg/common.h"
 
 #include <cstdio>
 #include <cassert>
@@ -127,8 +126,8 @@ std::string UserToXML(const USER & user, bool loginInStart, bool showPass, time_
         answer += "<IP value=\"" + user.GetProperty().ips.Get().GetIpStr() + "\"/>";
 
     answer += "<Traff";
-    const DIR_TRAFF & upload(user.GetProperty().down.Get());
-    const DIR_TRAFF & download(user.GetProperty().up.Get());
+    const DIR_TRAFF & upload(user.GetProperty().up.Get());
+    const DIR_TRAFF & download(user.GetProperty().down.Get());
     if (user.GetProperty().up.ModificationTime() > lastTime)
         for (size_t j = 0; j < DIR_NUM; j++)
             answer += " MU" + x2str(j) + "=\"" + x2str(upload[j]) + "\"";
@@ -585,9 +584,11 @@ int CHG_USER::ApplyChanges()
                                            &m_store,
                                            m_cashMsg))
                 return -1;
-            else
-                if (!u->GetProperty().cash.Set(m_usr.cash.const_data(), &m_currAdmin, m_login, &m_store, m_cashMsg))
-                    return -1;
+        }
+        else
+        {
+            if (!u->GetProperty().cash.Set(m_usr.cash.const_data(), &m_currAdmin, m_login, &m_store, m_cashMsg))
+                return -1;
         }