]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/user_helper.h
Move projects back into subfolder.
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / user_helper.h
diff --git a/projects/stargazer/plugins/configuration/rpcconfig/user_helper.h b/projects/stargazer/plugins/configuration/rpcconfig/user_helper.h
new file mode 100644 (file)
index 0000000..5457c95
--- /dev/null
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <string>
+
+#include <xmlrpc-c/base.hpp>
+
+namespace STG
+{
+
+struct Admin;
+struct Store;
+struct Tariffs;
+struct User;
+struct Users;
+
+}
+
+class USER_HELPER
+{
+public:
+    using UserPtr = STG::User*;
+    USER_HELPER(UserPtr & p, STG::Users & us)
+        : ptr(p),
+          users(us)
+    {
+    }
+
+    void GetUserInfo(xmlrpc_c::value * info,
+                     bool hidePassword = false);
+    bool SetUserInfo(const xmlrpc_c::value & info,
+                     const STG::Admin& admin,
+                     const std::string & login,
+                     const STG::Store & store,
+                     STG::Tariffs * tariffs);
+private:
+    UserPtr & ptr;
+    STG::Users & users;
+};