+#include <cerrno>
+
#include "users_methods.h"
+#include "users.h"
+#include "admins.h"
+#include "tariffs.h"
+
#include "rpcconfig.h"
#include "user_helper.h"
#include "user_ips.h"
#include "utils.h"
-
#include "common.h"
+#include "user_property.h"
//------------------------------------------------------------------------------
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
return;
}
-ADMIN admin;
+ADMIN * admin = NULL;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
return;
}
-ADMIN admin;
+ADMIN * admin;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
bool hidePassword = !adminInfo.priviledges.userConf ||
!adminInfo.priviledges.userPasswd;
-user_iter u;
+USER_PTR u;
int h = users->OpenSearch();
if (!h)
return;
}
-ADMIN admin;
+ADMIN * admin;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
if (!adminInfo.priviledges.userConf || !adminInfo.priviledges.userPasswd)
{
- uhelper.SetUserInfo(info, admin, login, *store);
+ uhelper.SetUserInfo(info, admin, login, *store, tariffs);
}
else
{
- uhelper.SetUserInfo(info, admin, login, *store);
+ uhelper.SetUserInfo(info, admin, login, *store, tariffs);
}
u->WriteConf();
return;
}
-ADMIN admin;
+ADMIN * admin;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
return;
}
-double cash = u->property.cash.Get();
+double cash = u->GetProperty().cash.Get();
cash += amount;
-if (!u->property.cash.Set(cash, admin, login, store, comment))
+if (!u->GetProperty().cash.Set(cash, admin, login, store, comment))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
return;
}
-ADMIN admin;
+ADMIN * admin;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
return;
}
-if (!u->property.cash.Set(cash, admin, login, store, comment))
+if (!u->GetProperty().cash.Set(cash, admin, login, store, comment))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
return;
}
-ADMIN admin;
+ADMIN * admin;
if (admins->FindAdmin(adminInfo.admin, &admin))
{
return;
}
-user_iter u;
+USER_PTR u;
if (users->FindByName(login, &u))
{
{
if (delayed)
{
- if (u->property.nextTariff.Set(tariff,
- admin,
- login,
- store))
+ if (u->GetProperty().nextTariff.Set(tariff,
+ admin,
+ login,
+ store))
{
u->WriteConf();
*retvalPtr = xmlrpc_c::value_boolean(true);
return;
}
}
- if (u->property.tariffName.Set(tariff,
- admin,
- login,
- store))
+ else
{
- u->WriteConf();
- *retvalPtr = xmlrpc_c::value_boolean(true);
- return;
+ if (u->GetProperty().tariffName.Set(tariff,
+ admin,
+ login,
+ store))
+ {
+ u->WriteConf();
+ *retvalPtr = xmlrpc_c::value_boolean(true);
+ return;
+ }
}
}
std::vector<xmlrpc_c::value> ips;
-user_iter u;
+USER_PTR u;
int handle = users->OpenSearch();
if (!handle)