#include <cerrno>
-#include "users_methods.h"
-
-#include "users.h"
-#include "admins.h"
-#include "tariffs.h"
-#include "../../../user_property.h"
+#include "stg/users.h"
+#include "stg/admins.h"
+#include "stg/tariffs.h"
+#include "stg/user_ips.h"
+#include "stg/common.h"
+#include "stg/user_property.h"
+#include "users_methods.h"
#include "rpcconfig.h"
#include "user_helper.h"
-#include "user_ips.h"
#include "utils.h"
-#include "common.h"
//------------------------------------------------------------------------------
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
std::map<std::string, xmlrpc_c::value> structVal;
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
ADMIN * admin = NULL;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
ADMIN * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
USER_PTR u;
-if (users->FindByName(login, &u))
+if (!users->FindByName(login, &u))
{
users->Del(login, admin);
*retvalPtr = xmlrpc_c::value_boolean(true);
xmlrpc_c::value * const retvalPtr)
{
std::string cookie = paramList.getString(0);
-std::string enc;
paramList.verifyEnd(1);
std::map<std::string, xmlrpc_c::value> structVal;
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
xmlrpc_c::value_struct info(paramList.getStruct(2));
-std::string enc;
paramList.verifyEnd(3);
ADMIN_INFO adminInfo;
ADMIN * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
std::string login = paramList.getString(1);
double amount = paramList.getDouble(2);
std::string comment = IconvString(paramList.getString(3), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(4);
ADMIN_INFO adminInfo;
ADMIN * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
std::string login = paramList.getString(1);
double cash = paramList.getDouble(2);
std::string comment = IconvString(paramList.getString(3), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(4);
ADMIN_INFO adminInfo;
ADMIN * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
std::string tariff = paramList.getString(2);
bool delayed = paramList.getBoolean(3);
std::string comment = IconvString(paramList.getString(4), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(5);
ADMIN_INFO adminInfo;
ADMIN * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->Find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
if (u->GetProperty().nextTariff.Set(tariff,
admin,
login,
- store))
+ store,
+ comment))
{
u->WriteConf();
*retvalPtr = xmlrpc_c::value_boolean(true);
if (u->GetProperty().tariffName.Set(tariff,
admin,
login,
- store))
+ store,
+ comment))
{
+ u->ResetNextTariff();
u->WriteConf();
*retvalPtr = xmlrpc_c::value_boolean(true);
return;