X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..d86ef621881bd05c142a496d1c5216c05b7c4f51:/projects/stargazer/user_property.h diff --git a/projects/stargazer/user_property.h b/projects/stargazer/user_property.h index 5a8856d0..3ea1be45 100644 --- a/projects/stargazer/user_property.h +++ b/projects/stargazer/user_property.h @@ -131,6 +131,14 @@ private: public: USER_PROPERTIES(const SETTINGS * settings); + + const USER_STAT & GetStat() const { return stat; } + const USER_CONF & GetConf() const { return conf; } + void SetStat(const USER_STAT & s) { stat = s; } + void SetConf(const USER_CONF & c) { conf = c; } + + void SetProperties(const USER_PROPERTIES & p) { stat = p.stat; conf = p.conf; } + USER_PROPERTY_LOGGED cash; USER_PROPERTY_LOGGED up; USER_PROPERTY_LOGGED down; @@ -205,8 +213,6 @@ if (value == newValue) typename set *>::iterator ni; -//printf("USER_PROPERTY::operator= (const varT& rhs)\n"); - varT oldVal = value; ni = beforeNotifiers.begin(); @@ -427,13 +433,7 @@ stgLogger("%s User \'%s\': \'%s\' parameter changed from \'%s\' to \'%s\'. %s", newValue.c_str(), msg.c_str()); - -/*char userLogMsg[2048]; -sprintf(userLogMsg, "\'%s\' parameter changed from \'%s\' to \'%s\'. %s", - parameter.c_str(), oldValue.c_str(), - newValue.c_str(), msg.c_str());*/ store->WriteUserChgLog(login, admin.GetLogin(), admin.GetAdminIP(), parameter, oldValue, newValue, msg); -//store->WriteLogString(userLogMsg, login); } //------------------------------------------------------------------------- template @@ -441,7 +441,7 @@ void USER_PROPERTY_LOGGED::OnChange(const string & login, const string & paramName, const string & oldValue, const string & newValue, - const ADMIN &) + const ADMIN & admin) { string str1; @@ -449,7 +449,7 @@ str1 = settings->GetConfDir() + "/OnChange"; if (access(str1.c_str(), X_OK) == 0) { - string str2("\"" + str1 + "\" \"" + login + "\" \"" + paramName + "\" \"" + oldValue + "\" \"" + newValue + "\""); + string str2("\"" + str1 + "\" \"" + login + "\" \"" + paramName + "\" \"" + oldValue + "\" \"" + newValue + "\" \"" + admin.GetLogin() + "\" \"" + admin.GetAdminIPStr() + "\""); ScriptExec(str2); } else