X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..39c6313308afb248b140d98b8052f1b484549df2:/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp index 4eae81fd..0016babe 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp @@ -1,5 +1,7 @@ -#include "admins_methods.h" +#include // xmlrpc-c devs have missed something :) +#include "stg/common.h" +#include "admins_methods.h" #include "rpcconfig.h" //------------------------------------------------------------------------------ @@ -21,9 +23,9 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN admin; +ADMIN * admin; -if (admins->FindAdmin(login, &admin)) +if (admins->Find(login, &admin)) { structVal["result"] = xmlrpc_c::value_boolean(false); *retvalPtr = xmlrpc_c::value_struct(structVal); @@ -31,10 +33,10 @@ if (admins->FindAdmin(login, &admin)) } structVal["result"] = xmlrpc_c::value_boolean(true); -structVal["login"] = xmlrpc_c::value_string(admin.GetLogin()); -structVal["password"] = xmlrpc_c::value_string(admin.GetPassword()); +structVal["login"] = xmlrpc_c::value_string(admin->GetLogin()); +structVal["password"] = xmlrpc_c::value_string(admin->GetPassword()); -const PRIV * priv = admin.GetPriv(); +const PRIV * priv = admin->GetPriv(); structVal["user_stat"] = xmlrpc_c::value_boolean(priv->userStat); structVal["user_conf"] = xmlrpc_c::value_boolean(priv->userConf); @@ -65,9 +67,9 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN admin; +ADMIN * admin; -if (admins->FindAdmin(adminInfo.admin, &admin)) +if (admins->Find(adminInfo.admin, &admin)) { printfd(__FILE__, "METHOD_ADMIN_ADD::execute(): 'Invalid admin (logged)'\n"); *retvalPtr = xmlrpc_c::value_boolean(false); @@ -102,9 +104,9 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN admin; +ADMIN * admin; -if (admins->FindAdmin(adminInfo.admin, &admin)) +if (admins->Find(adminInfo.admin, &admin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return; @@ -137,17 +139,17 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN loggedAdmin; +ADMIN * loggedAdmin; -if (admins->FindAdmin(adminInfo.admin, &loggedAdmin)) +if (admins->Find(adminInfo.admin, &loggedAdmin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return; } -ADMIN admin; +ADMIN * admin; -if (admins->FindAdmin(login, &admin)) +if (admins->Find(login, &admin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return; @@ -155,8 +157,8 @@ if (admins->FindAdmin(login, &admin)) ADMIN_CONF conf; -conf.priv = *admin.GetPriv(); -conf.password = admin.GetPassword(); +conf.priv = *admin->GetPriv(); +conf.password = admin->GetPassword(); conf.login = login; std::map structVal(