From 5b6a59eecf52d9dd4da5766ebcd503c23a9c1763 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Fri, 21 Oct 2022 11:07:10 -0700 Subject: [PATCH 1/3] Added error message for 403 on subscriber list --- View/Elements/Components/subscriberList.ctp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index 6158726..38e0667 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -175,7 +175,10 @@ success: function(data) { createModalContent(data); }, - error: function() { + error: function(xhr) { + if (xhr.status === 403) { + $('#model-title-group-name').text(name + ' (no access)'); + } modal.addClass('error'); }, complete: function() { From c1611d14ff01eb3148b25883f9ac104cf42cc965 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Sat, 22 Oct 2022 14:49:02 -0700 Subject: [PATCH 2/3] adding error message for no member viewing --- Controller/GrouperGroupsController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index a30fac3..ee63070 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -157,9 +157,16 @@ public function groupSubscribers() $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); } + if(count($subscribers) < 1){ + $this->response->type('json'); + $this->response->statusCode(403); + //$this->response->body(json_encode(array('status' => 'ERROR', 'message' => 'NO ACCESS'))); + $this->response->send(); + $subscribers = ''; + } + $this->set(compact('subscribers')); + $this->set('_serialize', 'subscribers'); - $this->set(compact('subscribers')); - $this->set('_serialize', 'subscribers'); } /** From 8a9bb87596401843cc4c2917321889e7b7de5f2c Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 24 Oct 2022 12:09:20 -0700 Subject: [PATCH 3/3] Fixed error display after successful load --- View/Elements/Components/subscriberList.ctp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index 38e0667..4930d29 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -21,7 +21,7 @@

Loading...