Add logging when an admin change a setting
This commit is contained in:
@ -618,6 +618,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
|
|
||||||
// Trigger own callback
|
// Trigger own callback
|
||||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTING_CHANGED, $settingName, $settingValue);
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_GAMEMODESETTING_CHANGED, $settingName, $settingValue);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the gamemode setting "'. $settingName .'" to "'. $settingValue .'"');
|
||||||
|
|
||||||
$settingIndex++;
|
$settingIndex++;
|
||||||
}
|
}
|
||||||
@ -627,7 +628,6 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
|
|
||||||
$chatMessage .= '!';
|
$chatMessage .= '!';
|
||||||
$this->maniaControl->getChat()->sendInformation($chatMessage);
|
$this->maniaControl->getChat()->sendInformation($chatMessage);
|
||||||
Logger::logInfo($chatMessage, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ use FML\Script\Script;
|
|||||||
use ManiaControl\Admin\AuthenticationManager;
|
use ManiaControl\Admin\AuthenticationManager;
|
||||||
use ManiaControl\Callbacks\CallbackListener;
|
use ManiaControl\Callbacks\CallbackListener;
|
||||||
use ManiaControl\Callbacks\CallbackManager;
|
use ManiaControl\Callbacks\CallbackManager;
|
||||||
|
use ManiaControl\Logger;
|
||||||
use ManiaControl\ManiaControl;
|
use ManiaControl\ManiaControl;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use ManiaControl\Settings\Setting;
|
use ManiaControl\Settings\Setting;
|
||||||
@ -528,6 +529,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$setting->value = $settingData['Value'];
|
$setting->value = $settingData['Value'];
|
||||||
}
|
}
|
||||||
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the setting "'. $setting->class . '\\\\' . $setting->setting .'" to "'. $setting->value .'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->maniaControl->getChat()->sendSuccess('Settings saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Settings saved!', $player);
|
||||||
|
@ -636,6 +636,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
|||||||
$setting->value = $settingData['Value'];
|
$setting->value = $settingData['Value'];
|
||||||
}
|
}
|
||||||
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
$this->maniaControl->getSettingManager()->saveSetting($setting);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the setting "'. $setting->class . '\\\\' . $setting->setting .'" to "'. $setting->value .'"');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->maniaControl->getChat()->sendSuccess('Plugin Settings saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Plugin Settings saved!', $player);
|
||||||
|
@ -418,6 +418,7 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
|
|||||||
$success = $this->applyNewServerOptions($newServerOptions, $player);
|
$success = $this->applyNewServerOptions($newServerOptions, $player);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->maniaControl->getChat()->sendSuccess('Server Options saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Server Options saved!', $player);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed Server Options');
|
||||||
} else {
|
} else {
|
||||||
$this->maniaControl->getChat()->sendError('Server Options saving failed!', $player);
|
$this->maniaControl->getChat()->sendError('Server Options saving failed!', $player);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ use ManiaControl\Admin\AuthenticationManager;
|
|||||||
use ManiaControl\Callbacks\CallbackListener;
|
use ManiaControl\Callbacks\CallbackListener;
|
||||||
use ManiaControl\Callbacks\TimerListener;
|
use ManiaControl\Callbacks\TimerListener;
|
||||||
use ManiaControl\Configurator\ConfiguratorMenu;
|
use ManiaControl\Configurator\ConfiguratorMenu;
|
||||||
|
use ManiaControl\Logger;
|
||||||
use ManiaControl\ManiaControl;
|
use ManiaControl\ManiaControl;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
|
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
|
||||||
@ -166,6 +167,7 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
|
|||||||
$success = $this->maniaControl->getClient()->setCallVoteRatios($newVoteRatios);
|
$success = $this->maniaControl->getClient()->setCallVoteRatios($newVoteRatios);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->maniaControl->getChat()->sendSuccess('Vote Ratios saved!', $player);
|
$this->maniaControl->getChat()->sendSuccess('Vote Ratios saved!', $player);
|
||||||
|
Logger::log(AuthenticationManager::getAuthLevelName($player->authLevel) .' "'. $player->nickname . '" ('. $player->login .') changed the Vote Ratios');
|
||||||
} else {
|
} else {
|
||||||
$this->maniaControl->getChat()->sendError('Vote Ratios saving failed!', $player);
|
$this->maniaControl->getChat()->sendError('Vote Ratios saving failed!', $player);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user