allow to add admin without having them in the database
This commit is contained in:
parent
c8bbb3d7c6
commit
9c114cd13b
@ -68,12 +68,10 @@ class AuthCommands implements CommandListener, UsageInformationAble {
|
||||
|
||||
$target = $this->maniaControl->getPlayerManager()->getPlayer($commandParts[1]);
|
||||
if (!$target) {
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
'Player %s not found!',
|
||||
$commandParts[1]
|
||||
);
|
||||
$this->maniaControl->getChat()->sendError($message, $player);
|
||||
return;
|
||||
// It's not needed to save the player, it will be done by the grantAuthLevel function
|
||||
$target = new Player($this->maniaControl, false);
|
||||
$target->login = $commandParts[1];
|
||||
$target->nickname = $commandParts[1];
|
||||
}
|
||||
|
||||
$success = $this->maniaControl->getAuthenticationManager()->grantAuthLevel($target, $targetAuthLevel);
|
||||
|
Loading…
Reference in New Issue
Block a user