]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp
Merge branch 'master' of madf.dyndns.org:/var/git/stg
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / users_methods.cpp
index d6812f55235cb9b841fa492bac8781b465df32e9..fd9f86be3beec117fe7c752c8755d4204f27fa03 100644 (file)
@@ -1,10 +1,15 @@
+#include <cerrno>
+
 #include "users_methods.h"
 
+#include "../../../users.h"
+#include "../../../admins.h"
+#include "../../../tariffs.h"
+
 #include "rpcconfig.h"
 #include "user_helper.h"
 #include "user_ips.h"
 #include "utils.h"
-
 #include "common.h"
 
 //------------------------------------------------------------------------------
@@ -221,11 +226,11 @@ USER_HELPER uhelper(u);
 
 if (!adminInfo.priviledges.userConf || !adminInfo.priviledges.userPasswd)
     {
-    uhelper.SetUserInfo(info, admin, login, *store);
+    uhelper.SetUserInfo(info, admin, login, *store, tariffs);
     }
 else
     {
-    uhelper.SetUserInfo(info, admin, login, *store);
+    uhelper.SetUserInfo(info, admin, login, *store, tariffs);
     }
 
 u->WriteConf();
@@ -382,14 +387,17 @@ if (tariffs->FindByName(tariff))
             return;
             }
         }
-    if (u->property.tariffName.Set(tariff,
-                                   admin,
-                                   login,
-                                   store))
+    else
         {
-        u->WriteConf();
-        *retvalPtr = xmlrpc_c::value_boolean(true);
-        return;
+        if (u->property.tariffName.Set(tariff,
+                                       admin,
+                                       login,
+                                       store))
+            {
+            u->WriteConf();
+            *retvalPtr = xmlrpc_c::value_boolean(true);
+            return;
+            }
         }
     }