From 8687172eb17378a0c5eacd8fc18c1679dad89cb3 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Mon, 5 Jun 2023 10:01:53 -0700 Subject: [PATCH] Fixing link/login issue --- Controller/GrouperGroupsController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index c889e60..e2f9eea 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -65,8 +65,13 @@ public function beforeFilter() { parent::beforeFilter(); - if($this->Session->read('Auth.User.username') !== null || $this->Session->read('Auth.User.username') == ''){ - $this->Auth->unauthorizedRedirect = "/"; + // Perform a bit of a sanity check before we get any further + try { + $this->verifyRequestedId(); + } + catch(InvalidArgumentException $e) { + $this->Flash->set('You are currently not logged into COmanage, please log in.', array('key' => 'error')); + $this->redirect("/"); } $this->Security->unlockedActions = array('removeSubscriber', 'addSubscriber');