2013-11-09 17:24:03 +01:00
|
|
|
<?php
|
|
|
|
|
2013-11-13 01:43:12 +01:00
|
|
|
namespace ManiaControl\Admin;
|
2013-11-09 17:24:03 +01:00
|
|
|
|
2014-01-31 13:40:07 +01:00
|
|
|
use ManiaControl\Callbacks\CallbackListener;
|
2014-05-24 16:39:12 +02:00
|
|
|
use ManiaControl\Callbacks\Callbacks;
|
2014-08-05 01:49:13 +02:00
|
|
|
use ManiaControl\Logger;
|
2013-11-13 01:43:12 +01:00
|
|
|
use ManiaControl\ManiaControl;
|
2013-11-12 15:48:25 +01:00
|
|
|
use ManiaControl\Players\Player;
|
2013-11-12 19:33:25 +01:00
|
|
|
use ManiaControl\Players\PlayerManager;
|
2014-05-13 16:03:26 +02:00
|
|
|
use ManiaControl\Settings\Setting;
|
2013-11-12 15:48:25 +01:00
|
|
|
|
2013-11-09 17:24:03 +01:00
|
|
|
/**
|
2014-01-06 17:48:40 +01:00
|
|
|
* Class managing Authentication Levels
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
|
|
|
* @copyright 2014 ManiaControl Team
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2013-11-09 17:24:03 +01:00
|
|
|
*/
|
2014-01-09 22:13:25 +01:00
|
|
|
class AuthenticationManager implements CallbackListener {
|
2014-04-12 12:14:37 +02:00
|
|
|
/*
|
2013-11-09 17:24:03 +01:00
|
|
|
* Constants
|
|
|
|
*/
|
2014-05-02 17:31:10 +02:00
|
|
|
const AUTH_LEVEL_PLAYER = 0;
|
|
|
|
const AUTH_LEVEL_MODERATOR = 1;
|
|
|
|
const AUTH_LEVEL_ADMIN = 2;
|
|
|
|
const AUTH_LEVEL_SUPERADMIN = 3;
|
2013-11-24 23:55:54 +01:00
|
|
|
const AUTH_LEVEL_MASTERADMIN = 4;
|
2014-05-02 17:31:10 +02:00
|
|
|
const AUTH_NAME_PLAYER = 'Player';
|
|
|
|
const AUTH_NAME_MODERATOR = 'Moderator';
|
|
|
|
const AUTH_NAME_ADMIN = 'Admin';
|
|
|
|
const AUTH_NAME_SUPERADMIN = 'SuperAdmin';
|
|
|
|
const AUTH_NAME_MASTERADMIN = 'MasterAdmin';
|
|
|
|
const CB_AUTH_LEVEL_CHANGED = 'AuthenticationManager.AuthLevelChanged';
|
|
|
|
|
2014-04-12 12:14:37 +02:00
|
|
|
/*
|
2014-08-02 22:31:46 +02:00
|
|
|
* Private properties
|
2013-11-09 17:24:03 +01:00
|
|
|
*/
|
2014-08-02 22:31:46 +02:00
|
|
|
/** @var ManiaControl $maniaControl */
|
2013-11-10 19:30:14 +01:00
|
|
|
private $maniaControl = null;
|
2014-08-02 22:31:46 +02:00
|
|
|
/** @var AuthCommands $authCommands */
|
2014-07-25 16:28:47 +02:00
|
|
|
private $authCommands = null;
|
2013-11-09 17:24:03 +01:00
|
|
|
|
|
|
|
/**
|
2014-08-02 22:31:46 +02:00
|
|
|
* Construct a new Authentication Manager instance
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
2014-08-02 22:31:46 +02:00
|
|
|
* @param ManiaControl $maniaControl
|
2013-11-09 17:24:03 +01:00
|
|
|
*/
|
2013-11-10 19:30:14 +01:00
|
|
|
public function __construct(ManiaControl $maniaControl) {
|
|
|
|
$this->maniaControl = $maniaControl;
|
2013-12-03 18:03:16 +01:00
|
|
|
$this->authCommands = new AuthCommands($maniaControl);
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2014-08-03 01:34:18 +02:00
|
|
|
// Callbacks
|
|
|
|
$this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|
|
|
|
|
2014-05-02 17:31:10 +02:00
|
|
|
/**
|
|
|
|
* Get Name of the Authentication Level from Level Int
|
|
|
|
*
|
|
|
|
* @param mixed $authLevelInt
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function getAuthLevelName($authLevelInt) {
|
|
|
|
$authLevelInt = self::getAuthLevelInt($authLevelInt);
|
|
|
|
switch ($authLevelInt) {
|
|
|
|
case self::AUTH_LEVEL_MASTERADMIN:
|
|
|
|
return self::AUTH_NAME_MASTERADMIN;
|
|
|
|
case self::AUTH_LEVEL_SUPERADMIN:
|
|
|
|
return self::AUTH_NAME_SUPERADMIN;
|
|
|
|
case self::AUTH_LEVEL_ADMIN:
|
|
|
|
return self::AUTH_NAME_ADMIN;
|
|
|
|
case self::AUTH_LEVEL_MODERATOR:
|
|
|
|
return self::AUTH_NAME_MODERATOR;
|
|
|
|
}
|
|
|
|
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
|
|
|
|
*
|
|
|
|
* @param mixed $authLevelInt
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function getAuthLevelAbbreviation($authLevelInt) {
|
|
|
|
$authLevelInt = self::getAuthLevelInt($authLevelInt);
|
|
|
|
switch ($authLevelInt) {
|
|
|
|
case self::AUTH_LEVEL_MASTERADMIN:
|
|
|
|
return 'MA';
|
|
|
|
case self::AUTH_LEVEL_SUPERADMIN:
|
|
|
|
return 'SA';
|
|
|
|
case self::AUTH_LEVEL_ADMIN:
|
|
|
|
return 'AD';
|
|
|
|
case self::AUTH_LEVEL_MODERATOR:
|
|
|
|
return 'MOD';
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2014-02-19 15:44:00 +01:00
|
|
|
/**
|
|
|
|
* Handle ManiaControl OnInit Callback
|
|
|
|
*/
|
|
|
|
public function handleOnInit() {
|
2014-01-09 22:13:25 +01:00
|
|
|
$this->updateMasterAdmins();
|
|
|
|
}
|
2014-01-09 18:45:39 +01:00
|
|
|
|
2013-11-09 17:24:03 +01:00
|
|
|
/**
|
2014-05-02 17:31:10 +02:00
|
|
|
* Update MasterAdmins based on Config
|
|
|
|
*
|
2013-11-09 17:24:03 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
2014-01-06 17:48:40 +01:00
|
|
|
private function updateMasterAdmins() {
|
2014-08-03 01:34:18 +02:00
|
|
|
$masterAdminsElements = $this->maniaControl->getConfig()->xpath('masteradmins');
|
2014-05-27 10:59:14 +02:00
|
|
|
if (!$masterAdminsElements) {
|
2014-08-05 01:49:13 +02:00
|
|
|
Logger::logError('Missing MasterAdmins configuration!');
|
2014-05-27 10:59:14 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
$masterAdminsElement = $masterAdminsElements[0];
|
|
|
|
|
2014-08-03 01:34:18 +02:00
|
|
|
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2013-11-24 23:55:54 +01:00
|
|
|
// Remove all MasterAdmins
|
2014-05-02 17:31:10 +02:00
|
|
|
$adminQuery = "UPDATE `" . PlayerManager::TABLE_PLAYERS . "`
|
2013-11-10 19:30:14 +01:00
|
|
|
SET `authLevel` = ?
|
|
|
|
WHERE `authLevel` = ?;";
|
|
|
|
$adminStatement = $mysqli->prepare($adminQuery);
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($mysqli->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($mysqli->error, E_USER_ERROR);
|
|
|
|
return false;
|
|
|
|
}
|
2014-05-02 17:31:10 +02:00
|
|
|
$adminLevel = self::AUTH_LEVEL_SUPERADMIN;
|
2014-01-06 14:22:48 +01:00
|
|
|
$masterAdminLevel = self::AUTH_LEVEL_MASTERADMIN;
|
|
|
|
$adminStatement->bind_param('ii', $adminLevel, $masterAdminLevel);
|
2013-11-10 19:30:14 +01:00
|
|
|
$adminStatement->execute();
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($adminStatement->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($adminStatement->error);
|
|
|
|
}
|
|
|
|
$adminStatement->close();
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2014-05-27 10:59:14 +02:00
|
|
|
// Set configured MasterAdmins
|
|
|
|
$loginElements = $masterAdminsElement->xpath('login');
|
2014-05-02 17:31:10 +02:00
|
|
|
$adminQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
|
2013-11-10 19:30:14 +01:00
|
|
|
`login`,
|
|
|
|
`authLevel`
|
|
|
|
) VALUES (
|
|
|
|
?, ?
|
|
|
|
) ON DUPLICATE KEY UPDATE
|
|
|
|
`authLevel` = VALUES(`authLevel`);";
|
|
|
|
$adminStatement = $mysqli->prepare($adminQuery);
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($mysqli->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($mysqli->error, E_USER_ERROR);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
$success = true;
|
2014-05-27 10:59:14 +02:00
|
|
|
foreach ($loginElements as $loginElement) {
|
|
|
|
$login = (string)$loginElement;
|
2014-02-13 00:46:41 +01:00
|
|
|
$adminStatement->bind_param('si', $login, $masterAdminLevel);
|
2013-11-10 19:30:14 +01:00
|
|
|
$adminStatement->execute();
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($adminStatement->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($adminStatement->error);
|
|
|
|
$success = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$adminStatement->close();
|
2014-05-27 10:59:14 +02:00
|
|
|
|
2013-11-10 19:30:14 +01:00
|
|
|
return $success;
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|
|
|
|
|
2014-05-20 14:59:53 +02:00
|
|
|
/**
|
|
|
|
* Get all connected Players with at least the given Auth Level
|
|
|
|
*
|
|
|
|
* @param int $authLevel
|
2014-05-27 22:17:07 +02:00
|
|
|
* @return Player[]
|
2014-05-20 14:59:53 +02:00
|
|
|
*/
|
|
|
|
public function getConnectedAdmins($authLevel = self::AUTH_LEVEL_MODERATOR) {
|
2014-08-03 01:34:18 +02:00
|
|
|
$players = $this->maniaControl->getPlayerManager()->getPlayers();
|
2014-05-20 14:59:53 +02:00
|
|
|
$admins = array();
|
|
|
|
foreach ($players as $player) {
|
|
|
|
if (self::checkRight($player, $authLevel)) {
|
|
|
|
array_push($admins, $player);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $admins;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether the Player has enough Rights
|
|
|
|
*
|
|
|
|
* @param Player $player
|
|
|
|
* @param int|Setting $neededAuthLevel
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public static function checkRight(Player $player, $neededAuthLevel) {
|
|
|
|
if ($neededAuthLevel instanceof Setting) {
|
|
|
|
$neededAuthLevel = $neededAuthLevel->value;
|
|
|
|
}
|
|
|
|
return ($player->authLevel >= $neededAuthLevel);
|
|
|
|
}
|
|
|
|
|
2014-01-31 13:40:07 +01:00
|
|
|
/**
|
|
|
|
* Get a List of all Admins
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param int $authLevel
|
2014-05-27 22:17:07 +02:00
|
|
|
* @return Player[]
|
2014-01-31 13:40:07 +01:00
|
|
|
*/
|
2014-05-20 14:59:53 +02:00
|
|
|
public function getAdmins($authLevel = self::AUTH_LEVEL_MODERATOR) {
|
2014-08-03 01:34:18 +02:00
|
|
|
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
|
2014-05-27 22:17:07 +02:00
|
|
|
$query = "SELECT `login` FROM `" . PlayerManager::TABLE_PLAYERS . "`
|
2014-05-20 14:59:53 +02:00
|
|
|
WHERE `authLevel` > " . $authLevel . "
|
|
|
|
ORDER BY `authLevel` DESC;";
|
2014-01-31 13:40:07 +01:00
|
|
|
$result = $mysqli->query($query);
|
|
|
|
if (!$result) {
|
|
|
|
trigger_error($mysqli->error);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
$admins = array();
|
2014-04-30 00:05:09 +02:00
|
|
|
while ($row = $result->fetch_object()) {
|
2014-08-03 01:34:18 +02:00
|
|
|
$player = $this->maniaControl->getPlayerManager()->getPlayer($row->login, false);
|
2014-05-27 22:17:07 +02:00
|
|
|
if ($player) {
|
|
|
|
array_push($admins, $player);
|
|
|
|
}
|
2014-01-31 13:40:07 +01:00
|
|
|
}
|
2014-05-20 14:59:53 +02:00
|
|
|
$result->free();
|
2014-01-31 13:40:07 +01:00
|
|
|
return $admins;
|
|
|
|
}
|
|
|
|
|
2013-11-09 17:24:03 +01:00
|
|
|
/**
|
2014-01-06 17:48:40 +01:00
|
|
|
* Grant the Auth Level to the Player
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
2013-12-31 17:17:11 +01:00
|
|
|
* @param Player $player
|
2014-05-02 17:31:10 +02:00
|
|
|
* @param int $authLevel
|
2013-11-09 17:24:03 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
2014-01-06 17:48:40 +01:00
|
|
|
public function grantAuthLevel(Player &$player, $authLevel) {
|
2014-01-31 13:40:07 +01:00
|
|
|
if (!$player || !is_numeric($authLevel)) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-05-02 17:31:10 +02:00
|
|
|
$authLevel = (int)$authLevel;
|
2014-01-31 16:55:01 +01:00
|
|
|
if ($authLevel >= self::AUTH_LEVEL_MASTERADMIN) {
|
2014-01-31 13:40:07 +01:00
|
|
|
return false;
|
2014-01-31 16:55:01 +01:00
|
|
|
}
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2014-08-03 01:34:18 +02:00
|
|
|
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
|
2014-05-02 17:31:10 +02:00
|
|
|
$authQuery = "INSERT INTO `" . PlayerManager::TABLE_PLAYERS . "` (
|
2013-11-10 19:30:14 +01:00
|
|
|
`login`,
|
|
|
|
`authLevel`
|
|
|
|
) VALUES (
|
|
|
|
?, ?
|
|
|
|
) ON DUPLICATE KEY UPDATE
|
|
|
|
`authLevel` = VALUES(`authLevel`);";
|
|
|
|
$authStatement = $mysqli->prepare($authQuery);
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($mysqli->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($mysqli->error, E_USER_ERROR);
|
2013-11-09 17:24:03 +01:00
|
|
|
return false;
|
|
|
|
}
|
2013-11-10 19:30:14 +01:00
|
|
|
$authStatement->bind_param('si', $player->login, $authLevel);
|
2014-01-06 17:48:40 +01:00
|
|
|
$authStatement->execute();
|
2014-01-09 22:13:25 +01:00
|
|
|
if ($authStatement->error) {
|
2013-11-10 19:30:14 +01:00
|
|
|
trigger_error($authStatement->error);
|
|
|
|
$authStatement->close();
|
|
|
|
return false;
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|
2013-11-10 19:30:14 +01:00
|
|
|
$authStatement->close();
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2014-01-06 17:48:40 +01:00
|
|
|
$player->authLevel = $authLevel;
|
2014-08-03 01:34:18 +02:00
|
|
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_AUTH_LEVEL_CHANGED, $player);
|
2014-05-02 17:31:10 +02:00
|
|
|
|
2014-01-06 17:48:40 +01:00
|
|
|
return true;
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-01-06 17:48:40 +01:00
|
|
|
* Send an Error Message to the Player
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
2013-12-09 13:45:58 +01:00
|
|
|
* @param Player $player
|
2013-11-10 19:30:14 +01:00
|
|
|
* @return bool
|
2013-11-09 17:24:03 +01:00
|
|
|
*/
|
2013-11-10 19:30:14 +01:00
|
|
|
public function sendNotAllowed(Player $player) {
|
2014-01-31 16:55:01 +01:00
|
|
|
if (!$player) {
|
2014-01-31 13:40:07 +01:00
|
|
|
return false;
|
2014-01-31 16:55:01 +01:00
|
|
|
}
|
2014-08-03 01:34:18 +02:00
|
|
|
return $this->maniaControl->getChat()->sendError('You do not have the required Rights to perform this Action!', $player);
|
2013-11-13 01:43:12 +01:00
|
|
|
}
|
|
|
|
|
2013-11-09 17:24:03 +01:00
|
|
|
/**
|
2014-05-02 17:31:10 +02:00
|
|
|
* Checks the permission by a right name
|
|
|
|
*
|
2013-12-09 13:45:58 +01:00
|
|
|
* @param Player $player
|
2014-05-02 17:31:10 +02:00
|
|
|
* @param $rightName
|
2013-11-10 19:30:14 +01:00
|
|
|
* @return bool
|
2013-11-09 17:24:03 +01:00
|
|
|
*/
|
2014-05-02 17:31:10 +02:00
|
|
|
public function checkPermission(Player $player, $rightName) {
|
2014-08-03 01:34:18 +02:00
|
|
|
$right = $this->maniaControl->getSettingManager()->getSettingValue($this, $rightName);
|
2014-05-25 10:23:45 +02:00
|
|
|
return $this->checkRight($player, $this->getAuthLevel($right));
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|
2013-11-25 00:19:37 +01:00
|
|
|
|
2014-01-09 18:45:39 +01:00
|
|
|
/**
|
2014-05-13 16:40:05 +02:00
|
|
|
* Define a Minimum Right Level needed for an Action
|
2014-05-02 17:31:10 +02:00
|
|
|
*
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param string $rightName
|
|
|
|
* @param int $authLevelNeeded
|
2014-01-09 18:45:39 +01:00
|
|
|
*/
|
|
|
|
public function definePermissionLevel($rightName, $authLevelNeeded) {
|
2014-08-03 01:34:18 +02:00
|
|
|
$this->maniaControl->getSettingManager()->initSetting($this, $rightName, $this->getPermissionLevelNameArray($authLevelNeeded));
|
2014-05-25 10:06:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the PermissionLevelNameArray
|
|
|
|
*
|
|
|
|
* @param $authLevelNeeded
|
2014-05-27 22:17:07 +02:00
|
|
|
* @return array[]
|
2014-05-25 10:06:22 +02:00
|
|
|
*/
|
2014-05-25 10:10:01 +02:00
|
|
|
private function getPermissionLevelNameArray($authLevelNeeded) {
|
2014-05-25 10:06:22 +02:00
|
|
|
switch ($authLevelNeeded) {
|
|
|
|
case self::AUTH_LEVEL_MODERATOR:
|
|
|
|
return array(self::AUTH_NAME_MODERATOR, self::AUTH_NAME_ADMIN, self::AUTH_NAME_SUPERADMIN, self::AUTH_NAME_MASTERADMIN);
|
|
|
|
case self::AUTH_LEVEL_ADMIN:
|
|
|
|
return array(self::AUTH_NAME_ADMIN, self::AUTH_NAME_SUPERADMIN, self::AUTH_NAME_MASTERADMIN, self::AUTH_NAME_MODERATOR);
|
|
|
|
case self::AUTH_LEVEL_SUPERADMIN:
|
|
|
|
return array(self::AUTH_NAME_SUPERADMIN, self::AUTH_NAME_MASTERADMIN, self::AUTH_NAME_MODERATOR, self::AUTH_NAME_ADMIN);
|
|
|
|
case self::AUTH_LEVEL_MASTERADMIN:
|
|
|
|
return array(self::AUTH_NAME_MASTERADMIN, self::AUTH_NAME_MODERATOR, self::AUTH_NAME_ADMIN, self::AUTH_NAME_SUPERADMIN);
|
|
|
|
}
|
|
|
|
return array("-");
|
2014-01-09 18:45:39 +01:00
|
|
|
}
|
2013-11-09 17:24:03 +01:00
|
|
|
}
|