git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mod_smux config samples added
[stg.git]
/
projects
/
stargazer
/
user_impl.cpp
diff --git
a/projects/stargazer/user_impl.cpp
b/projects/stargazer/user_impl.cpp
index 2b64ccc7062df4d94279f2510b3948191a7a785d..8c61523a835fb5ae25c45f0b23d29b421c5a4109 100644
(file)
--- a/
projects/stargazer/user_impl.cpp
+++ b/
projects/stargazer/user_impl.cpp
@@
-54,7
+54,8
@@
USER_IMPL::USER_IMPL(const SETTINGS * s,
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
- : users(u),
+ : USER(),
+ users(u),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(),
@@
-137,7
+138,8
@@
USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
- : users(u),
+ : USER(),
+ users(u),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(),
@@
-217,7
+219,8
@@
pthread_mutex_init(&mutex, &attr);
#endif
//-----------------------------------------------------------------------------
USER_IMPL::USER_IMPL(const USER_IMPL & u)
#endif
//-----------------------------------------------------------------------------
USER_IMPL::USER_IMPL(const USER_IMPL & u)
- : users(u.users),
+ : USER(),
+ users(u.users),
property(u.settings->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(u.login),
property(u.settings->GetScriptsDir()),
WriteServLog(GetStgLogger()),
login(u.login),
@@
-563,7
+566,7
@@
if (!fakeConnect)
id,
dirsStr);
id,
dirsStr);
- ScriptExec(scriptOnConnectParams);
+ ScriptExec(scriptOnConnectParams
.c_str()
);
}
else
{
}
else
{
@@
-620,7
+623,7
@@
if (!fakeDisconnect)
id,
dirsStr);
id,
dirsStr);
- ScriptExec(scriptOnDisonnectParams);
+ ScriptExec(scriptOnDisonnectParams
.c_str()
);
}
else
{
}
else
{
@@
-1029,7
+1032,7
@@
if (access(scriptOnAdd.c_str(), X_OK) == 0)
scriptOnAdd.c_str(),
login.c_str());
scriptOnAdd.c_str(),
login.c_str());
- ScriptExec(scriptOnAddParams);
+ ScriptExec(scriptOnAddParams
.c_str()
);
}
else
{
}
else
{
@@
-1051,7
+1054,7
@@
if (access(scriptOnDel.c_str(), X_OK) == 0)
scriptOnDel.c_str(),
login.c_str());
scriptOnDel.c_str(),
login.c_str());
- ScriptExec(scriptOnDelParams);
+ ScriptExec(scriptOnDelParams
.c_str()
);
}
else
{
}
else
{
@@
-1424,10
+1427,12
@@
if (newPassive && !oldPassive && user->tariff != NULL)
void CHG_TARIFF_NOTIFIER::Notify(const string &, const string & newTariff)
{
if (user->settings->GetReconnectOnTariffChange() && user->connected)
void CHG_TARIFF_NOTIFIER::Notify(const string &, const string & newTariff)
{
if (user->settings->GetReconnectOnTariffChange() && user->connected)
- user->Disconnect(
tru
e, "Change tariff");
+ user->Disconnect(
fals
e, "Change tariff");
user->tariff = user->tariffs->FindByName(newTariff);
user->tariff = user->tariffs->FindByName(newTariff);
-if (user->settings->GetReconnectOnTariffChange() && user->IsInetable())
- user->Connect(true);
+if (user->settings->GetReconnectOnTariffChange() &&
+ !user->authorizedBy.empty() &&
+ user->IsInetable())
+ user->Connect(false);
}
//-----------------------------------------------------------------------------
void CHG_CASH_NOTIFIER::Notify(const double & oldCash, const double & newCash)
}
//-----------------------------------------------------------------------------
void CHG_CASH_NOTIFIER::Notify(const double & oldCash, const double & newCash)
@@
-1440,8
+1445,8
@@
void CHG_IPS_NOTIFIER::Notify(const USER_IPS & from, const USER_IPS & to)
{
printfd(__FILE__, "Change IP from '%s' to '%s'\n", from.GetIpStr().c_str(), to.GetIpStr().c_str());
if (user->connected)
{
printfd(__FILE__, "Change IP from '%s' to '%s'\n", from.GetIpStr().c_str(), to.GetIpStr().c_str());
if (user->connected)
- user->Disconnect(
tru
e, "Change IP");
- if (user->IsInetable())
- user->Connect(
tru
e);
+ user->Disconnect(
fals
e, "Change IP");
+ if (
!user->authorizedBy.empty() &&
user->IsInetable())
+ user->Connect(
fals
e);
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------