X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/4271ab433cd55bbd2612292bcf39e4dc3d7274f1..0907aa4037b12b6b88ee24495d4577a064d4f8db:/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 index 00000000..5457c953 --- /dev/null +++ b/projects/stargazer/plugins/configuration/rpcconfig/user_helper.h @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include + +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; +};