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]);
|
$target = $this->maniaControl->getPlayerManager()->getPlayer($commandParts[1]);
|
||||||
if (!$target) {
|
if (!$target) {
|
||||||
$message = $this->maniaControl->getChat()->formatMessage(
|
// It's not needed to save the player, it will be done by the grantAuthLevel function
|
||||||
'Player %s not found!',
|
$target = new Player($this->maniaControl, false);
|
||||||
$commandParts[1]
|
$target->login = $commandParts[1];
|
||||||
);
|
$target->nickname = $commandParts[1];
|
||||||
$this->maniaControl->getChat()->sendError($message, $player);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$success = $this->maniaControl->getAuthenticationManager()->grantAuthLevel($target, $targetAuthLevel);
|
$success = $this->maniaControl->getAuthenticationManager()->grantAuthLevel($target, $targetAuthLevel);
|
||||||
|
Loading…
Reference in New Issue
Block a user