fix permission check
This commit is contained in:
		| @@ -23,7 +23,7 @@ class GuestlistManager implements CommandListener, CallbackListener, TimerListen | |||||||
| 	 * Constants | 	 * Constants | ||||||
| 	 */ | 	 */ | ||||||
| 	const PLUGIN_ID			= 154; | 	const PLUGIN_ID			= 154; | ||||||
| 	const PLUGIN_VERSION	= 2.2; | 	const PLUGIN_VERSION	= 2.3; | ||||||
| 	const PLUGIN_NAME		= 'Guestlist Manager'; | 	const PLUGIN_NAME		= 'Guestlist Manager'; | ||||||
| 	const PLUGIN_AUTHOR		= 'Beu'; | 	const PLUGIN_AUTHOR		= 'Beu'; | ||||||
|  |  | ||||||
| @@ -556,9 +556,10 @@ class GuestlistManager implements CommandListener, CallbackListener, TimerListen | |||||||
| 		if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADD_ADMINS)) return; | 		if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADD_ADMINS)) return; | ||||||
|  |  | ||||||
| 		$guestlist = $this->maniaControl->getClient()->getGuestList(); | 		$guestlist = $this->maniaControl->getClient()->getGuestList(); | ||||||
|  | 		$authLevel = $this->maniaControl->getAuthenticationManager()->getAuthLevelInt($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADMIN_LEVEL)); | ||||||
|  | 		$admins = $this->maniaControl->getAuthenticationManager()->getAdmins($authLevel); | ||||||
|  |  | ||||||
| 		foreach ($this->maniaControl->getAuthenticationManager()->getAdmins() as $admin) { | 		foreach ($admins as $admin) { | ||||||
| 			if ($this->maniaControl->getAuthenticationManager()->checkRight($admin, $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADMIN_LEVEL))) continue; |  | ||||||
| 			$this->addLoginToGL($admin->login, $guestlist); | 			$this->addLoginToGL($admin->login, $guestlist); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| @@ -574,7 +575,8 @@ class GuestlistManager implements CommandListener, CallbackListener, TimerListen | |||||||
| 		$guestlist = $this->maniaControl->getClient()->getGuestList(); | 		$guestlist = $this->maniaControl->getClient()->getGuestList(); | ||||||
|  |  | ||||||
| 		$isGuestlisted = in_array($player->login, array_column($guestlist, 'login')); | 		$isGuestlisted = in_array($player->login, array_column($guestlist, 'login')); | ||||||
| 		$isAdmin = $this->maniaControl->getAuthenticationManager()->checkRight($player,$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADMIN_LEVEL)); | 		$authLevel = $this->maniaControl->getAuthenticationManager()->getAuthLevelInt($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADMIN_LEVEL)); | ||||||
|  | 		$isAdmin = $this->maniaControl->getAuthenticationManager()->checkRight($player, $authLevel); | ||||||
|  |  | ||||||
| 		if (!$isGuestlisted && $isAdmin) { | 		if (!$isGuestlisted && $isAdmin) { | ||||||
| 			$this->addLoginToGL($player->login, $guestlist); | 			$this->addLoginToGL($player->login, $guestlist); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user