From 3754cff2266c2c1bff0768006146082265e66a01 Mon Sep 17 00:00:00 2001 From: s0nder Date: Tue, 17 Jan 2023 19:34:03 +0100 Subject: [PATCH] fixed handleAuthorization method in baseclass portal to prevent an authloop --- .../evilportal/src/assets/api/Portal.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/evilportal/projects/evilportal/src/assets/api/Portal.php b/evilportal/projects/evilportal/src/assets/api/Portal.php index c1e5a5e..b88800a 100644 --- a/evilportal/projects/evilportal/src/assets/api/Portal.php +++ b/evilportal/projects/evilportal/src/assets/api/Portal.php @@ -81,15 +81,15 @@ abstract class Portal */ protected function handleAuthorization() { - if (isset($this->request->target)) { - $this->authorizeClient($_SERVER['REMOTE_ADDR']); - $this->onSuccess(); + if ($this->isClientAuthorized($_SERVER['REMOTE_ADDR']) and isset($this->request->target)) { $this->redirect(); - } elseif ($this->isClientAuthorized($_SERVER['REMOTE_ADDR'])) { - $this->redirect(); - } else { - $this->showError(); - } + } elseif (isset($this->request->target)) { + $this->authorizeClient($_SERVER['REMOTE_ADDR']); + $this->onSuccess(); + $this->redirect(); + } else { + $this->showError(); + } } /**