From bff16f6441ab2177cfd180dbca223a5d348ddd5d Mon Sep 17 00:00:00 2001 From: Beu Date: Mon, 14 Aug 2023 18:16:58 +0200 Subject: [PATCH] allow to remove rights to themself --- core/Admin/AuthCommands.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Admin/AuthCommands.php b/core/Admin/AuthCommands.php index 1b5997e4..1bcdc7b3 100644 --- a/core/Admin/AuthCommands.php +++ b/core/Admin/AuthCommands.php @@ -154,7 +154,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { return; } - if ($target->authLevel >= AuthenticationManager::AUTH_LEVEL_MASTERADMIN) { + if ($player !== $target && $target->authLevel >= AuthenticationManager::AUTH_LEVEL_MASTERADMIN) { $this->maniaControl->getChat()->sendError('You cannot remove rights of a MasterAdmin!', $player); return; } @@ -164,7 +164,7 @@ class AuthCommands implements CommandListener, UsageInformationAble { return; } - if ($player->authLevel <= $target->authLevel) { + if ($player !== $target && $player->authLevel <= $target->authLevel) { $this->maniaControl->getChat()->sendError('You cannot remove rights of a higher privileged player!', $player); return; }