resovled todo

This commit is contained in:
kremsy 2014-01-21 19:36:09 +01:00 committed by Steffen Schröder
parent 2e982ce5a9
commit 71a19d2464
2 changed files with 5 additions and 2 deletions

View File

@ -361,7 +361,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
try { try {
$this->maniaControl->client->stopServer(); $this->maniaControl->client->stopServer();
} catch(Exception $e) { } catch(Exception $e) {
trigger_error("Server shutdown command from '{login}' failed. " . $this->maniaControl->getClientErrorText()); trigger_error("Server shutdown command from '{login}' failed. " . $e->getMessage());
return false; return false;
} }
$this->maniaControl->quit("Server shutdown requested by '{$login}'"); $this->maniaControl->quit("Server shutdown requested by '{$login}'");

View File

@ -23,6 +23,7 @@ class UpdateManager implements CallbackListener, CommandListener {
const SETTING_UPDATECHECK_CHANNEL = 'Core Update Channel (release, beta, nightly)'; const SETTING_UPDATECHECK_CHANNEL = 'Core Update Channel (release, beta, nightly)';
const SETTING_PERFORM_BACKUPS = 'Perform Backup before Updating'; const SETTING_PERFORM_BACKUPS = 'Perform Backup before Updating';
const SETTING_AUTO_UPDATE = 'Perform update automatically'; const SETTING_AUTO_UPDATE = 'Perform update automatically';
const SETTING_PERMISSION_UPDATE = 'Update Core';
const URL_WEBSERVICE = 'http://ws.maniacontrol.com/'; const URL_WEBSERVICE = 'http://ws.maniacontrol.com/';
const CHANNEL_RELEASE = 'release'; const CHANNEL_RELEASE = 'release';
const CHANNEL_BETA = 'beta'; const CHANNEL_BETA = 'beta';
@ -55,6 +56,8 @@ class UpdateManager implements CallbackListener, CommandListener {
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_1_MINUTE, $this, 'handle1Minute'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_1_MINUTE, $this, 'handle1Minute');
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerJoined'); $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerJoined');
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECTED, $this, 'handlePlayerDisconnected'); $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECTED, $this, 'handlePlayerDisconnected');
$this->maniaControl->authenticationManager->definePermissionLevel(self::SETTING_PERMISSION_UPDATE, AuthenticationManager::AUTH_LEVEL_ADMIN);
// Register for chat commands // Register for chat commands
$this->maniaControl->commandManager->registerCommandListener('checkupdate', $this, 'handle_CheckUpdate', true); $this->maniaControl->commandManager->registerCommandListener('checkupdate', $this, 'handle_CheckUpdate', true);
@ -198,7 +201,7 @@ class UpdateManager implements CallbackListener, CommandListener {
* @param Player $player * @param Player $player
*/ */
public function handle_CoreUpdate(array $chatCallback, Player $player) { public function handle_CoreUpdate(array $chatCallback, Player $player) {
if(!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN)) { //TODO, define permission setting if(!$this->maniaControl->authenticationManager->checkPermission($player, self::SETTING_PERMISSION_UPDATE)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player); $this->maniaControl->authenticationManager->sendNotAllowed($player);
return; return;
} }