]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/rpcconfig/user_helper.h
Move projects back into subfolder.
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / user_helper.h
1 #pragma once
2
3 #include <string>
4
5 #include <xmlrpc-c/base.hpp>
6
7 namespace STG
8 {
9
10 struct Admin;
11 struct Store;
12 struct Tariffs;
13 struct User;
14 struct Users;
15
16 }
17
18 class USER_HELPER
19 {
20 public:
21     using UserPtr = STG::User*;
22     USER_HELPER(UserPtr & p, STG::Users & us)
23         : ptr(p),
24           users(us)
25     {
26     }
27
28     void GetUserInfo(xmlrpc_c::value * info,
29                      bool hidePassword = false);
30     bool SetUserInfo(const xmlrpc_c::value & info,
31                      const STG::Admin& admin,
32                      const std::string & login,
33                      const STG::Store & store,
34                      STG::Tariffs * tariffs);
35 private:
36     UserPtr & ptr;
37     STG::Users & users;
38 };