From 9c114cd13ba1f5bb75d2b5dfa414768b761018e4 Mon Sep 17 00:00:00 2001 From: beu Date: Wed, 28 Aug 2024 18:26:55 +0200 Subject: [PATCH] allow to add admin without having them in the database --- core/Admin/AuthCommands.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/Admin/AuthCommands.php b/core/Admin/AuthCommands.php index 1bcdc7b3..93a27c53 100644 --- a/core/Admin/AuthCommands.php +++ b/core/Admin/AuthCommands.php @@ -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);