From: Maxim Mamontov <faust@gts.dp.ua>
Date: Tue, 7 Dec 2010 13:59:01 +0000 (+0200)
Subject: Исправлена ошибка приводящая к тому что в OnChange не попадали логин и
X-Git-Tag: 2.407-rc3~339
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/c798b518dd51530b3e309f58de96cdc5c61f7355

Исправлена ошибка приводящая к тому что в OnChange не попадали логин и
IP-адрес админа изменившего параметр
---

diff --git a/projects/stargazer/user_property.h b/projects/stargazer/user_property.h
index 57e11a49..3ea1be45 100644
--- a/projects/stargazer/user_property.h
+++ b/projects/stargazer/user_property.h
@@ -213,8 +213,6 @@ if (value == newValue)
 
 typename set<PROPERTY_NOTIFIER_BASE<varT> *>::iterator ni;
 
-//printf("USER_PROPERTY<varT>::operator= (const varT& rhs)\n");
-
 varT oldVal = value;
 
 ni = beforeNotifiers.begin();
@@ -435,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 <typename varT>
@@ -449,7 +441,7 @@ void USER_PROPERTY_LOGGED<varT>::OnChange(const string & login,
                                           const string & paramName,
                                           const string & oldValue,
                                           const string & newValue,
-                                          const ADMIN  &)
+                                          const ADMIN  & admin)
 {
 string str1;
 
@@ -457,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