X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..dfefbf4a96165e25f45548388dd27292eb3dbc95:/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp index 4eae81fd..ad9c0324 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( @@ -221,14 +223,14 @@ void METHOD_ADMINS_GET::execute(xmlrpc_c::paramList const & paramList, std::string cookie = paramList.getString(0); paramList.verifyEnd(1); -std::map structVal; +std::map mainStructVal; std::vector retval; ADMIN_INFO adminInfo; if (config->GetAdminInfo(cookie, &adminInfo)) { - structVal["result"] = xmlrpc_c::value_boolean(false); - *retvalPtr = xmlrpc_c::value_struct(structVal); + mainStructVal["result"] = xmlrpc_c::value_boolean(false); + *retvalPtr = xmlrpc_c::value_struct(mainStructVal); return; }