applied common formatting

This commit is contained in:
Steffen Schröder 2014-05-02 17:31:10 +02:00
parent 3857f332f7
commit d52423b737
5 changed files with 393 additions and 378 deletions

View File

@ -3,6 +3,18 @@
<component name="ProjectCodeStyleSettingsManager"> <component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS"> <option name="PER_PROJECT_SETTINGS">
<value> <value>
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
<PHPCodeStyleSettings> <PHPCodeStyleSettings>
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" /> <option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" /> <option name="ALIGN_PHPDOC_COMMENTS" value="true" />
@ -16,6 +28,11 @@
<XML> <XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML> </XML>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PHP"> <codeStyleSettings language="PHP">
<option name="KEEP_LINE_BREAKS" value="false" /> <option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" /> <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
@ -25,9 +42,10 @@
<option name="CLASS_BRACE_STYLE" value="1" /> <option name="CLASS_BRACE_STYLE" value="1" />
<option name="METHOD_BRACE_STYLE" value="1" /> <option name="METHOD_BRACE_STYLE" value="1" />
<option name="SPECIAL_ELSE_IF_TREATMENT" value="true" /> <option name="SPECIAL_ELSE_IF_TREATMENT" value="true" />
<option name="IF_BRACE_FORCE" value="1" /> <option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="1" /> <option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="1" /> <option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<indentOptions> <indentOptions>
<option name="USE_TAB_CHARACTER" value="true" /> <option name="USE_TAB_CHARACTER" value="true" />
</indentOptions> </indentOptions>

View File

@ -18,21 +18,21 @@ use ManiaControl\Players\PlayerManager;
/** /**
* Class managing Actions Menus * Class managing Actions Menus
* *
* @author steeffeen & kremsy * @author ManiaControl Team <mail@maniacontrol.com>
* @copyright ManiaControl Copyright © 2014 ManiaControl Team * @copyright 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener { class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
/* /*
* Constants * Constants
*/ */
const MLID_MENU = 'ActionsMenu.MLID'; const MLID_MENU = 'ActionsMenu.MLID';
const SETTING_MENU_POSX = 'Menu Position: X'; const SETTING_MENU_POSX = 'Menu Position: X';
const SETTING_MENU_POSY = 'Menu Position: Y'; const SETTING_MENU_POSY = 'Menu Position: Y';
const SETTING_MENU_ITEMSIZE = 'Menu Item Size'; const SETTING_MENU_ITEMSIZE = 'Menu Item Size';
const ACTION_OPEN_ADMIN_MENU = 'ActionsMenu.OpenAdminMenu'; const ACTION_OPEN_ADMIN_MENU = 'ActionsMenu.OpenAdminMenu';
const ACTION_OPEN_PLAYER_MENU = 'ActionsMenu.OpenPlayerMenu'; const ACTION_OPEN_PLAYER_MENU = 'ActionsMenu.OpenPlayerMenu';
/* /*
* Private Properties * Private Properties
*/ */
@ -48,12 +48,12 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
*/ */
public function __construct(ManiaControl $maniaControl) { public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;
// Init settings // Init settings
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSX, 156.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSX, 156.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSY, -17.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSY, -17.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_ITEMSIZE, 6.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_ITEMSIZE, 6.);
// Register for callbacks // Register for callbacks
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_AFTERINIT, $this, 'handleAfterInit');
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerJoined'); $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerJoined');
@ -64,41 +64,24 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
* Add a new Menu Item * Add a new Menu Item
* *
* @param Control $control * @param Control $control
* @param bool $playerAction * @param bool $playerAction
* @param int $order * @param int $order
* @param string $description * @param string $description
*/ */
public function addMenuItem(Control $control, $playerAction = true, $order = 0, $description = null) { public function addMenuItem(Control $control, $playerAction = true, $order = 0, $description = null) {
if ($playerAction) { if ($playerAction) {
$this->addPlayerMenuItem($control, $order, $description); $this->addPlayerMenuItem($control, $order, $description);
} } else {
else {
$this->addAdminMenuItem($control, $order, $description); $this->addAdminMenuItem($control, $order, $description);
} }
} }
/**
* Removes a Menu Item
*
* @param $order
* @param bool $playerAction
*/
public function removeMenuItem($order, $playerAction = true) {
if ($playerAction) {
unset($this->playerMenuItems[$order]);
}
else {
unset($this->adminMenuItems[$order]);
}
$this->rebuildAndShowMenu();
}
/** /**
* Add a new Player Menu Item * Add a new Player Menu Item
* *
* @param Control $control * @param Control $control
* @param int $order * @param int $order
* @param string $description * @param string $description
*/ */
public function addPlayerMenuItem(Control $control, $order = 0, $description = null) { public function addPlayerMenuItem(Control $control, $order = 0, $description = null) {
if (!isset($this->playerMenuItems[$order])) { if (!isset($this->playerMenuItems[$order])) {
@ -109,30 +92,6 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$this->rebuildAndShowMenu(); $this->rebuildAndShowMenu();
} }
/**
* Add a new Admin Menu Item
*
* @param Control $control
* @param int $order
* @param string $description
*/
public function addAdminMenuItem(Control $control, $order = 0, $description = null) {
if (!isset($this->adminMenuItems[$order])) {
$this->adminMenuItems[$order] = array();
}
array_push($this->adminMenuItems[$order], array($control, $description));
krsort($this->adminMenuItems);
$this->rebuildAndShowMenu();
}
/**
* Handle ManiaControl AfterInit callback
*/
public function handleAfterInit() {
$this->initCompleted = true;
$this->rebuildAndShowMenu();
}
/** /**
* Build and show the menus to everyone (if a menu get made after the init) * Build and show the menus to everyone (if a menu get made after the init)
*/ */
@ -147,16 +106,6 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
} }
} }
/**
* Handle PlayerJoined callback
*
* @param Player $player
*/
public function handlePlayerJoined(Player $player) {
$maniaLink = $this->buildMenuIconsManialink($player);
$this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login);
}
/** /**
* Builds the Manialink * Builds the Manialink
* *
@ -164,22 +113,22 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
* @return ManiaLink * @return ManiaLink
*/ */
private function buildMenuIconsManialink(Player $player) { private function buildMenuIconsManialink(Player $player) {
$posX = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_POSX); $posX = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_POSX);
$posY = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_POSY); $posY = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_POSY);
$itemSize = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_ITEMSIZE); $itemSize = $this->maniaControl->settingManager->getSetting($this, self::SETTING_MENU_ITEMSIZE);
$shootManiaOffset = $this->maniaControl->manialinkManager->styleManager->getDefaultIconOffsetSM(); $shootManiaOffset = $this->maniaControl->manialinkManager->styleManager->getDefaultIconOffsetSM();
$quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultQuadStyle(); $quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultQuadStyle();
$quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultQuadSubstyle(); $quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultQuadSubstyle();
$itemMarginFactorX = 1.3; $itemMarginFactorX = 1.3;
$itemMarginFactorY = 1.2; $itemMarginFactorY = 1.2;
// If game is shootmania lower the icons position by 20 // If game is shootmania lower the icons position by 20
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'sm') { if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'sm') {
$posY -= $shootManiaOffset; $posY -= $shootManiaOffset;
} }
$manialink = new ManiaLink(self::MLID_MENU); $manialink = new ManiaLink(self::MLID_MENU);
/* /*
* Admin Menu * Admin Menu
*/ */
@ -188,17 +137,17 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$iconFrame = new Frame(); $iconFrame = new Frame();
$manialink->add($iconFrame); $manialink->add($iconFrame);
$iconFrame->setPosition($posX, $posY); $iconFrame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$iconFrame->add($backgroundQuad); $iconFrame->add($backgroundQuad);
$backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$itemQuad = new Quad_Icons64x64_1(); $itemQuad = new Quad_Icons64x64_1();
$iconFrame->add($itemQuad); $iconFrame->add($itemQuad);
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconServers); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconServers);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
// Admin Menu Description // Admin Menu Description
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$manialink->add($descriptionLabel); $manialink->add($descriptionLabel);
@ -207,7 +156,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4); $descriptionLabel->setTextSize(1.4);
$descriptionLabel->setTextColor('fff'); $descriptionLabel->setTextColor('fff');
// Admin Menu // Admin Menu
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$manialink->add($popoutFrame); $manialink->add($popoutFrame);
@ -215,15 +164,15 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame->setHAlign(Control::RIGHT); $popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false); $popoutFrame->setVisible(false);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$popoutFrame->add($backgroundQuad); $popoutFrame->add($backgroundQuad);
$backgroundQuad->setHAlign(Control::RIGHT); $backgroundQuad->setHAlign(Control::RIGHT);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
$itemQuad->addToggleFeature($popoutFrame); $itemQuad->addToggleFeature($popoutFrame);
// Add items // Add items
$x = -1; $x = -1;
foreach ($this->adminMenuItems as $menuItems) { foreach ($this->adminMenuItems as $menuItems) {
@ -237,7 +186,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$menuQuad->setX($x); $menuQuad->setX($x);
$menuQuad->setHAlign(Control::RIGHT); $menuQuad->setHAlign(Control::RIGHT);
$x -= $itemSize * 1.05; $x -= $itemSize * 1.05;
if ($menuItem[1]) { if ($menuItem[1]) {
$menuQuad->removeScriptFeatures(); $menuQuad->removeScriptFeatures();
$description = '$s' . $menuItem[1]; $description = '$s' . $menuItem[1];
@ -246,7 +195,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
} }
} }
} }
/* /*
* Player Menu * Player Menu
*/ */
@ -254,17 +203,17 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$iconFrame = new Frame(); $iconFrame = new Frame();
$manialink->add($iconFrame); $manialink->add($iconFrame);
$iconFrame->setPosition($posX, $posY - $itemSize * $itemMarginFactorY); $iconFrame->setPosition($posX, $posY - $itemSize * $itemMarginFactorY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$iconFrame->add($backgroundQuad); $iconFrame->add($backgroundQuad);
$backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$itemQuad = new Quad_Icons64x64_1(); $itemQuad = new Quad_Icons64x64_1();
$iconFrame->add($itemQuad); $iconFrame->add($itemQuad);
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
// Player Menu Description // Player Menu Description
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$manialink->add($descriptionLabel); $manialink->add($descriptionLabel);
@ -273,7 +222,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4); $descriptionLabel->setTextSize(1.4);
$descriptionLabel->setTextColor('fff'); $descriptionLabel->setTextColor('fff');
// Player Menu // Player Menu
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$manialink->add($popoutFrame); $manialink->add($popoutFrame);
@ -281,15 +230,15 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame->setHAlign(Control::RIGHT); $popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false); $popoutFrame->setVisible(false);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$popoutFrame->add($backgroundQuad); $popoutFrame->add($backgroundQuad);
$backgroundQuad->setHAlign(Control::RIGHT); $backgroundQuad->setHAlign(Control::RIGHT);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
$itemQuad->addToggleFeature($popoutFrame); $itemQuad->addToggleFeature($popoutFrame);
// Add items // Add items
$x = -1; $x = -1;
foreach ($this->playerMenuItems as $menuItems) { foreach ($this->playerMenuItems as $menuItems) {
@ -303,7 +252,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$menuQuad->setX($x); $menuQuad->setX($x);
$menuQuad->setHAlign(Control::RIGHT); $menuQuad->setHAlign(Control::RIGHT);
$x -= $itemSize * 1.05; $x -= $itemSize * 1.05;
if ($menuItem[1]) { if ($menuItem[1]) {
$menuQuad->removeScriptFeatures(); $menuQuad->removeScriptFeatures();
$description = '$s' . $menuItem[1]; $description = '$s' . $menuItem[1];
@ -311,7 +260,56 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
} }
} }
} }
return $manialink; return $manialink;
} }
/**
* Add a new Admin Menu Item
*
* @param Control $control
* @param int $order
* @param string $description
*/
public function addAdminMenuItem(Control $control, $order = 0, $description = null) {
if (!isset($this->adminMenuItems[$order])) {
$this->adminMenuItems[$order] = array();
}
array_push($this->adminMenuItems[$order], array($control, $description));
krsort($this->adminMenuItems);
$this->rebuildAndShowMenu();
}
/**
* Removes a Menu Item
*
* @param $order
* @param bool $playerAction
*/
public function removeMenuItem($order, $playerAction = true) {
if ($playerAction) {
unset($this->playerMenuItems[$order]);
} else {
unset($this->adminMenuItems[$order]);
}
$this->rebuildAndShowMenu();
}
/**
* Handle ManiaControl AfterInit callback
*/
public function handleAfterInit() {
$this->initCompleted = true;
$this->rebuildAndShowMenu();
}
/**
* Handle PlayerJoined callback
*
* @param Player $player
*/
public function handlePlayerJoined(Player $player) {
$maniaLink = $this->buildMenuIconsManialink($player);
$this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login);
}
} }

View File

@ -20,10 +20,10 @@ use ManiaControl\Players\Player;
/** /**
* Widget Class listing Authorized Players * Widget Class listing Authorized Players
* *
* @author kremsy * @author ManiaControl Team <mail@maniacontrol.com>
* @copyright ManiaControl Copyright © 2014 ManiaControl Team * @copyright 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
class AdminLists implements ManialinkPageAnswerListener, CallbackListener { class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
/* /*
@ -61,8 +61,8 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
/** /**
* Open Admin List Action * Open Admin List Action
* *
* @param array $callback * @param array $callback
* @param Player $player * @param Player $player
*/ */
public function openAdminList(array $callback, Player $player) { public function openAdminList(array $callback, Player $player) {
@ -71,7 +71,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
/** /**
* Show the Admin List * Show the Admin List
* *
* @param Player $player * @param Player $player
*/ */
public function showAdminLists(Player $player) { public function showAdminLists(Player $player) {
@ -90,8 +90,8 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
//Create ManiaLink //Create ManiaLink
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); $maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
$script = $maniaLink->getScript(); $script = $maniaLink->getScript();
$paging = new Paging(); $paging = new Paging();
$script->addFeature($paging); $script->addFeature($paging);
// Main frame // Main frame
$frame = $this->maniaControl->manialinkManager->styleManager->getDefaultListFrame($script, $pagesId); $frame = $this->maniaControl->manialinkManager->styleManager->getDefaultListFrame($script, $pagesId);
@ -115,7 +115,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
$i = 1; $i = 1;
$y = $y - 10; $y = $y - 10;
$pageFrames = array(); $pageFrames = array();
foreach($admins as $admin) { foreach ($admins as $admin) {
if (!isset($pageFrame)) { if (!isset($pageFrame)) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->add($pageFrame);
@ -124,7 +124,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
} }
array_push($pageFrames, $pageFrame); array_push($pageFrames, $pageFrame);
$y = $height / 2 - 10; $y = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
@ -158,8 +158,8 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
$rightLabel->setTextSize(0.8); $rightLabel->setTextSize(0.8);
$rightLabel->setZ(10); $rightLabel->setZ(10);
$rightLabel->setText($this->maniaControl->authenticationManager->getAuthLevelAbbreviation($admin)); $rightLabel->setText($this->maniaControl->authenticationManager->getAuthLevelAbbreviation($admin));
$description = $this->maniaControl->authenticationManager->getAuthLevelName($admin) . " " . $admin->nickname; $description = $this->maniaControl->authenticationManager->getAuthLevelName($admin) . " " . $admin->nickname;
$rightLabel->addTooltipLabelFeature($descriptionLabel, $description); $rightLabel->addTooltipLabelFeature($descriptionLabel, $description);
//Revoke Button //Revoke Button
if ($admin->authLevel > 0 && $this->maniaControl->authenticationManager->checkRight($player, $admin->authLevel + 1)) { if ($admin->authLevel > 0 && $this->maniaControl->authenticationManager->checkRight($player, $admin->authLevel + 1)) {
@ -217,7 +217,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
$adminLogin = $callback[1][1]; $adminLogin = $callback[1][1];
$targetLogin = $actionArray[2]; $targetLogin = $actionArray[2];
switch($action) { switch ($action) {
case self::ACTION_REVOKE_RIGHTS: case self::ACTION_REVOKE_RIGHTS:
$this->maniaControl->playerManager->playerActions->revokeAuthLevel($adminLogin, $targetLogin); $this->maniaControl->playerManager->playerActions->revokeAuthLevel($adminLogin, $targetLogin);
break; break;
@ -230,7 +230,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
* @param Player $player * @param Player $player
*/ */
public function updateWidget(Player $player) { public function updateWidget(Player $player) {
foreach($this->adminListShown as $login => $shown) { foreach ($this->adminListShown as $login => $shown) {
if ($shown) { if ($shown) {
$player = $this->maniaControl->playerManager->getPlayer($login); $player = $this->maniaControl->playerManager->getPlayer($login);
if ($player) { if ($player) {

View File

@ -2,16 +2,16 @@
namespace ManiaControl\Admin; namespace ManiaControl\Admin;
use ManiaControl\ManiaControl;
use ManiaControl\Commands\CommandListener; use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
/** /**
* Class offering Commands to grant Authorizations to Players * Class offering Commands to grant Authorizations to Players
* *
* @author steeffeen & kremsy * @author ManiaControl Team <mail@maniacontrol.com>
* @copyright ManiaControl Copyright © 2014 ManiaControl Team * @copyright 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
class AuthCommands implements CommandListener { class AuthCommands implements CommandListener {
/* /*
@ -22,29 +22,29 @@ class AuthCommands implements CommandListener {
/** /**
* Create a new AuthCommands instance * Create a new AuthCommands instance
* *
* @param ManiaControl $maniaControl * @param ManiaControl $maniaControl
*/ */
public function __construct(ManiaControl $maniaControl) { public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;
// Register for commands // Register for commands
$this->maniaControl->commandManager->registerCommandListener('addsuperadmin', $this, 'command_AddSuperAdmin',true, 'Add Player to the AdminList as SuperAdmin.'); $this->maniaControl->commandManager->registerCommandListener('addsuperadmin', $this, 'command_AddSuperAdmin', true, 'Add Player to the AdminList as SuperAdmin.');
$this->maniaControl->commandManager->registerCommandListener('addadmin', $this, 'command_AddAdmin',true, 'Add Player to the AdminList as Admin.'); $this->maniaControl->commandManager->registerCommandListener('addadmin', $this, 'command_AddAdmin', true, 'Add Player to the AdminList as Admin.');
$this->maniaControl->commandManager->registerCommandListener('addmod', $this, 'command_AddModerator',true, 'Add Player to the AdminList as Moderator.'); $this->maniaControl->commandManager->registerCommandListener('addmod', $this, 'command_AddModerator', true, 'Add Player to the AdminList as Moderator.');
} }
/** /**
* Handle //addsuperadmin command * Handle //addsuperadmin command
* *
* @param array $chatCallback * @param array $chatCallback
* @param Player $player * @param Player $player
*/ */
public function command_AddSuperAdmin(array $chatCallback, Player $player) { public function command_AddSuperAdmin(array $chatCallback, Player $player) {
if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_MASTERADMIN)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_MASTERADMIN)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player); $this->maniaControl->authenticationManager->sendNotAllowed($player);
return; return;
} }
$text = $chatCallback[1][2]; $text = $chatCallback[1][2];
$commandParts = explode(' ', $text); $commandParts = explode(' ', $text);
if (!array_key_exists(1, $commandParts)) { if (!array_key_exists(1, $commandParts)) {
$this->sendAddSuperAdminUsageInfo($player); $this->sendAddSuperAdminUsageInfo($player);
@ -64,18 +64,29 @@ class AuthCommands implements CommandListener {
$this->maniaControl->chat->sendSuccess($message); $this->maniaControl->chat->sendSuccess($message);
} }
/**
* Send usage example for //addsuperadmin command
*
* @param Player $player
* @return bool
*/
private function sendAddSuperAdminUsageInfo(Player $player) {
$message = "Usage Example: '//addsuperadmin login'";
return $this->maniaControl->chat->sendUsageInfo($message, $player->login);
}
/** /**
* Handle //addadmin command * Handle //addadmin command
* *
* @param array $chatCallback * @param array $chatCallback
* @param Player $player * @param Player $player
*/ */
public function command_AddAdmin(array $chatCallback, Player $player) { public function command_AddAdmin(array $chatCallback, Player $player) {
if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_SUPERADMIN)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_SUPERADMIN)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player); $this->maniaControl->authenticationManager->sendNotAllowed($player);
return; return;
} }
$text = $chatCallback[1][2]; $text = $chatCallback[1][2];
$commandParts = explode(' ', $text); $commandParts = explode(' ', $text);
if (!array_key_exists(1, $commandParts)) { if (!array_key_exists(1, $commandParts)) {
$this->sendAddAdminUsageInfo($player); $this->sendAddAdminUsageInfo($player);
@ -95,18 +106,29 @@ class AuthCommands implements CommandListener {
$this->maniaControl->chat->sendSuccess($message); $this->maniaControl->chat->sendSuccess($message);
} }
/**
* Send usage example for //addadmin command
*
* @param Player $player
* @return bool
*/
private function sendAddAdminUsageInfo(Player $player) {
$message = "Usage Example: '//addadmin login'";
return $this->maniaControl->chat->sendUsageInfo($message, $player->login);
}
/** /**
* Handle //addmod command * Handle //addmod command
* *
* @param array $chatCallback * @param array $chatCallback
* @param Player $player * @param Player $player
*/ */
public function command_AddModerator(array $chatCallback, Player $player) { public function command_AddModerator(array $chatCallback, Player $player) {
if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player); $this->maniaControl->authenticationManager->sendNotAllowed($player);
return; return;
} }
$text = $chatCallback[1][2]; $text = $chatCallback[1][2];
$commandParts = explode(' ', $text); $commandParts = explode(' ', $text);
if (!array_key_exists(1, $commandParts)) { if (!array_key_exists(1, $commandParts)) {
$this->sendAddModeratorUsageInfo($player); $this->sendAddModeratorUsageInfo($player);
@ -126,32 +148,10 @@ class AuthCommands implements CommandListener {
$this->maniaControl->chat->sendSuccess($message); $this->maniaControl->chat->sendSuccess($message);
} }
/**
* Send usage example for //addsuperadmin command
*
* @param Player $player
* @return bool
*/
private function sendAddSuperAdminUsageInfo(Player $player) {
$message = "Usage Example: '//addsuperadmin login'";
return $this->maniaControl->chat->sendUsageInfo($message, $player->login);
}
/**
* Send usage example for //addadmin command
*
* @param Player $player
* @return bool
*/
private function sendAddAdminUsageInfo(Player $player) {
$message = "Usage Example: '//addadmin login'";
return $this->maniaControl->chat->sendUsageInfo($message, $player->login);
}
/** /**
* Send usage example for //addop command * Send usage example for //addop command
* *
* @param Player $player * @param Player $player
* @return bool * @return bool
*/ */
private function sendAddModeratorUsageInfo(Player $player) { private function sendAddModeratorUsageInfo(Player $player) {

View File

@ -10,32 +10,32 @@ use ManiaControl\Players\PlayerManager;
/** /**
* Class managing Authentication Levels * Class managing Authentication Levels
* *
* @author steeffeen & kremsy * @author ManiaControl Team <mail@maniacontrol.com>
* @copyright ManiaControl Copyright © 2014 ManiaControl Team * @copyright 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
class AuthenticationManager implements CallbackListener { class AuthenticationManager implements CallbackListener {
/* /*
* Constants * Constants
*/ */
const AUTH_LEVEL_PLAYER = 0; const AUTH_LEVEL_PLAYER = 0;
const AUTH_LEVEL_MODERATOR = 1; const AUTH_LEVEL_MODERATOR = 1;
const AUTH_LEVEL_ADMIN = 2; const AUTH_LEVEL_ADMIN = 2;
const AUTH_LEVEL_SUPERADMIN = 3; const AUTH_LEVEL_SUPERADMIN = 3;
const AUTH_LEVEL_MASTERADMIN = 4; const AUTH_LEVEL_MASTERADMIN = 4;
const AUTH_NAME_PLAYER = 'Player'; const AUTH_NAME_PLAYER = 'Player';
const AUTH_NAME_MODERATOR = 'Moderator'; const AUTH_NAME_MODERATOR = 'Moderator';
const AUTH_NAME_ADMIN = 'Admin'; const AUTH_NAME_ADMIN = 'Admin';
const AUTH_NAME_SUPERADMIN = 'SuperAdmin'; const AUTH_NAME_SUPERADMIN = 'SuperAdmin';
const AUTH_NAME_MASTERADMIN = 'MasterAdmin'; const AUTH_NAME_MASTERADMIN = 'MasterAdmin';
const CB_AUTH_LEVEL_CHANGED = 'AuthenticationManager.AuthLevelChanged'; const CB_AUTH_LEVEL_CHANGED = 'AuthenticationManager.AuthLevelChanged';
/* /*
* Public Properties * Public Properties
*/ */
public $authCommands = null; public $authCommands = null;
/* /*
* Private Properties * Private Properties
*/ */
@ -43,196 +43,19 @@ class AuthenticationManager implements CallbackListener {
/** /**
* Construct a new Authentication Manager * Construct a new Authentication Manager
* *
* @param \ManiaControl\ManiaControl $maniaControl * @param \ManiaControl\ManiaControl $maniaControl
*/ */
public function __construct(ManiaControl $maniaControl) { public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl; $this->maniaControl = $maniaControl;
$this->authCommands = new AuthCommands($maniaControl); $this->authCommands = new AuthCommands($maniaControl);
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
} }
/**
* Handle ManiaControl OnInit Callback
*/
public function handleOnInit() {
$this->updateMasterAdmins();
}
/**
* Update MasterAdmins based on config
*
* @return bool
*/
private function updateMasterAdmins() {
$mysqli = $this->maniaControl->database->mysqli;
// Remove all MasterAdmins
$adminQuery = "UPDATE `" . PlayerManager::TABLE_PLAYERS . "`
SET `authLevel` = ?
WHERE `authLevel` = ?;";
$adminStatement = $mysqli->prepare($adminQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
}
$adminLevel = self::AUTH_LEVEL_SUPERADMIN;
$masterAdminLevel = self::AUTH_LEVEL_MASTERADMIN;
$adminStatement->bind_param('ii', $adminLevel, $masterAdminLevel);
$adminStatement->execute();
if ($adminStatement->error) {
trigger_error($adminStatement->error);
}
$adminStatement->close();
// Set MasterAdmins
$masterAdmins = $this->maniaControl->config->masteradmins->xpath('login');
$adminQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
`login`,
`authLevel`
) VALUES (
?, ?
) ON DUPLICATE KEY UPDATE
`authLevel` = VALUES(`authLevel`);";
$adminStatement = $mysqli->prepare($adminQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
}
$success = true;
foreach ($masterAdmins as $masterAdmin) {
$login = (string) $masterAdmin;
$adminStatement->bind_param('si', $login, $masterAdminLevel);
$adminStatement->execute();
if ($adminStatement->error) {
trigger_error($adminStatement->error);
$success = false;
}
}
$adminStatement->close();
return $success;
}
/**
* Get a List of all Admins
*
* @param $authLevel
* @return array null
*/
public function getAdmins($authLevel = -1) {
$mysqli = $this->maniaControl->database->mysqli;
if ($authLevel < 0) {
$query = "SELECT * FROM `" . PlayerManager::TABLE_PLAYERS . "` WHERE `authLevel` > 0 ORDER BY `authLevel` DESC;";
}
else {
$query = "SELECT * FROM `" . PlayerManager::TABLE_PLAYERS . "` WHERE `authLevel` = " . $authLevel . ";";
}
$result = $mysqli->query($query);
if (!$result) {
trigger_error($mysqli->error);
return null;
}
$admins = array();
while ($row = $result->fetch_object()) {
array_push($admins, $row);
}
return $admins;
}
/**
* Grant the Auth Level to the Player
*
* @param Player $player
* @param int $authLevel
* @return bool
*/
public function grantAuthLevel(Player &$player, $authLevel) {
if (!$player || !is_numeric($authLevel)) {
return false;
}
$authLevel = (int) $authLevel;
if ($authLevel >= self::AUTH_LEVEL_MASTERADMIN) {
return false;
}
$mysqli = $this->maniaControl->database->mysqli;
$authQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
`login`,
`authLevel`
) VALUES (
?, ?
) ON DUPLICATE KEY UPDATE
`authLevel` = VALUES(`authLevel`);";
$authStatement = $mysqli->prepare($authQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
}
$authStatement->bind_param('si', $player->login, $authLevel);
$authStatement->execute();
if ($authStatement->error) {
trigger_error($authStatement->error);
$authStatement->close();
return false;
}
$authStatement->close();
$player->authLevel = $authLevel;
$this->maniaControl->callbackManager->triggerCallback(self::CB_AUTH_LEVEL_CHANGED, $player);
return true;
}
/**
* Send an Error Message to the Player
*
* @param Player $player
* @return bool
*/
public function sendNotAllowed(Player $player) {
if (!$player) {
return false;
}
return $this->maniaControl->chat->sendError('You do not have the required Rights to perform this Action!', $player->login);
}
/**
* Check if the Player has enough Rights
*
* @param Player $player
* @param int $neededAuthLevel
* @return bool
*/
public static function checkRight(Player $player, $neededAuthLevel) {
return ($player->authLevel >= $neededAuthLevel);
}
/**
* Checks the permission by a right name
*
* @param Player $player
* @param $rightName
* @return bool
*/
public function checkPermission(Player $player, $rightName) {
$right = $this->maniaControl->settingManager->getSetting($this, $rightName);
return $this->checkRight($player, $right);
}
/**
* Defines a Minimum Right Level needed for an action
*
* @param $rightName
* @param $authLevelNeeded
*/
public function definePermissionLevel($rightName, $authLevelNeeded) {
$this->maniaControl->settingManager->initSetting($this, $rightName, $authLevelNeeded);
}
/** /**
* Get Name of the Authentication Level from Level Int * Get Name of the Authentication Level from Level Int
* *
* @param mixed $authLevelInt * @param mixed $authLevelInt
* @return string * @return string
*/ */
@ -251,9 +74,46 @@ class AuthenticationManager implements CallbackListener {
return self::AUTH_NAME_PLAYER; return self::AUTH_NAME_PLAYER;
} }
/**
* Get the Authentication Level Int from the given Param
*
* @param mixed $authLevelParam
* @return int
*/
public static function getAuthLevelInt($authLevelParam) {
if (is_object($authLevelParam) && property_exists($authLevelParam, 'authLevel')) {
return (int)$authLevelParam->authLevel;
}
if (is_string($authLevelParam)) {
return self::getAuthLevel($authLevelParam);
}
return (int)$authLevelParam;
}
/**
* Get Authentication Level Int from Level Name
*
* @param string $authLevelName
* @return int
*/
public static function getAuthLevel($authLevelName) {
$authLevelName = (string)$authLevelName;
switch ($authLevelName) {
case self::AUTH_NAME_MASTERADMIN:
return self::AUTH_LEVEL_MASTERADMIN;
case self::AUTH_NAME_SUPERADMIN:
return self::AUTH_LEVEL_SUPERADMIN;
case self::AUTH_NAME_ADMIN:
return self::AUTH_LEVEL_ADMIN;
case self::AUTH_NAME_MODERATOR:
return self::AUTH_LEVEL_MODERATOR;
}
return self::AUTH_LEVEL_PLAYER;
}
/** /**
* Get the Abbreviation of the Authentication Level from Level Int * Get the Abbreviation of the Authentication Level from Level Int
* *
* @param mixed $authLevelInt * @param mixed $authLevelInt
* @return string * @return string
*/ */
@ -273,39 +133,178 @@ class AuthenticationManager implements CallbackListener {
} }
/** /**
* Get Authentication Level Int from Level Name * Handle ManiaControl OnInit Callback
*
* @param string $authLevelName
* @return int
*/ */
public static function getAuthLevel($authLevelName) { public function handleOnInit() {
$authLevelName = (string) $authLevelName; $this->updateMasterAdmins();
switch ($authLevelName) {
case self::AUTH_NAME_MASTERADMIN:
return self::AUTH_LEVEL_MASTERADMIN;
case self::AUTH_NAME_SUPERADMIN:
return self::AUTH_LEVEL_SUPERADMIN;
case self::AUTH_NAME_ADMIN:
return self::AUTH_LEVEL_ADMIN;
case self::AUTH_NAME_MODERATOR:
return self::AUTH_LEVEL_MODERATOR;
}
return self::AUTH_LEVEL_PLAYER;
} }
/** /**
* Get the Authentication Level Int from the given Param * Update MasterAdmins based on Config
* *
* @param mixed $authLevelParam * @return bool
* @return int
*/ */
public static function getAuthLevelInt($authLevelParam) { private function updateMasterAdmins() {
if (is_object($authLevelParam) && property_exists($authLevelParam, 'authLevel')) { $mysqli = $this->maniaControl->database->mysqli;
return (int) $authLevelParam->authLevel;
// Remove all MasterAdmins
$adminQuery = "UPDATE `" . PlayerManager::TABLE_PLAYERS . "`
SET `authLevel` = ?
WHERE `authLevel` = ?;";
$adminStatement = $mysqli->prepare($adminQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
} }
if (is_string($authLevelParam)) { $adminLevel = self::AUTH_LEVEL_SUPERADMIN;
return self::getAuthLevel($authLevelParam); $masterAdminLevel = self::AUTH_LEVEL_MASTERADMIN;
$adminStatement->bind_param('ii', $adminLevel, $masterAdminLevel);
$adminStatement->execute();
if ($adminStatement->error) {
trigger_error($adminStatement->error);
} }
return (int) $authLevelParam; $adminStatement->close();
// Set MasterAdmins
$masterAdmins = $this->maniaControl->config->masteradmins->xpath('login');
$adminQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
`login`,
`authLevel`
) VALUES (
?, ?
) ON DUPLICATE KEY UPDATE
`authLevel` = VALUES(`authLevel`);";
$adminStatement = $mysqli->prepare($adminQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
}
$success = true;
foreach ($masterAdmins as $masterAdmin) {
$login = (string)$masterAdmin;
$adminStatement->bind_param('si', $login, $masterAdminLevel);
$adminStatement->execute();
if ($adminStatement->error) {
trigger_error($adminStatement->error);
$success = false;
}
}
$adminStatement->close();
return $success;
}
/**
* Get a List of all Admins
*
* @param $authLevel
* @return array null
*/
public function getAdmins($authLevel = -1) {
$mysqli = $this->maniaControl->database->mysqli;
if ($authLevel < 0) {
$query = "SELECT * FROM `" . PlayerManager::TABLE_PLAYERS . "` WHERE `authLevel` > 0 ORDER BY `authLevel` DESC;";
} else {
$query = "SELECT * FROM `" . PlayerManager::TABLE_PLAYERS . "` WHERE `authLevel` = " . $authLevel . ";";
}
$result = $mysqli->query($query);
if (!$result) {
trigger_error($mysqli->error);
return null;
}
$admins = array();
while ($row = $result->fetch_object()) {
array_push($admins, $row);
}
return $admins;
}
/**
* Grant the Auth Level to the Player
*
* @param Player $player
* @param int $authLevel
* @return bool
*/
public function grantAuthLevel(Player &$player, $authLevel) {
if (!$player || !is_numeric($authLevel)) {
return false;
}
$authLevel = (int)$authLevel;
if ($authLevel >= self::AUTH_LEVEL_MASTERADMIN) {
return false;
}
$mysqli = $this->maniaControl->database->mysqli;
$authQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
`login`,
`authLevel`
) VALUES (
?, ?
) ON DUPLICATE KEY UPDATE
`authLevel` = VALUES(`authLevel`);";
$authStatement = $mysqli->prepare($authQuery);
if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR);
return false;
}
$authStatement->bind_param('si', $player->login, $authLevel);
$authStatement->execute();
if ($authStatement->error) {
trigger_error($authStatement->error);
$authStatement->close();
return false;
}
$authStatement->close();
$player->authLevel = $authLevel;
$this->maniaControl->callbackManager->triggerCallback(self::CB_AUTH_LEVEL_CHANGED, $player);
return true;
}
/**
* Send an Error Message to the Player
*
* @param Player $player
* @return bool
*/
public function sendNotAllowed(Player $player) {
if (!$player) {
return false;
}
return $this->maniaControl->chat->sendError('You do not have the required Rights to perform this Action!', $player->login);
}
/**
* Checks the permission by a right name
*
* @param Player $player
* @param $rightName
* @return bool
*/
public function checkPermission(Player $player, $rightName) {
$right = $this->maniaControl->settingManager->getSetting($this, $rightName);
return $this->checkRight($player, $right);
}
/**
* Check if the Player has enough Rights
*
* @param Player $player
* @param int $neededAuthLevel
* @return bool
*/
public static function checkRight(Player $player, $neededAuthLevel) {
return ($player->authLevel >= $neededAuthLevel);
}
/**
* Defines a Minimum Right Level needed for an action
*
* @param $rightName
* @param $authLevelNeeded
*/
public function definePermissionLevel($rightName, $authLevelNeeded) {
$this->maniaControl->settingManager->initSetting($this, $rightName, $authLevelNeeded);
} }
} }