From ece396c4c02f59ee1cd10997be3bb1ce1df07912 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 4 Dec 2023 13:00:38 +0800 Subject: [PATCH] * Fix bug when the user does not have execution permission. --- module/bug/zen.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/module/bug/zen.php b/module/bug/zen.php index a92df4dee4..3a5b48cccd 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -35,14 +35,24 @@ class bugZen extends bug { if($bug->execution && !$this->loadModel('execution')->checkPriv($bug->execution)) { - echo js::alert($this->lang->bug->notice->executionAccessDenied); + if(isInModal()) + { + echo js::alert($this->lang->bug->notice->executionAccessDenied); - $loginLink = $this->createLink('user', 'login'); - if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate($this->createLink('bug', 'index', ''))); + $loginLink = $this->createLink('user', 'login'); + if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate($this->createLink('bug', 'index', ''))); - if($this->app->tab == 'my') return print(js::reload('parent')); + if($this->app->tab == 'my') return print(js::reload('parent')); - return print(js::locate('back')); + return print(js::locate('back')); + } + else + { + $locate = array('load' => true); + $loginLink = $this->createLink('user', 'login'); + if(strpos($this->server->http_referer, $loginLink) !== false) $locate = $this->createLink('bug', 'index'); + return $this->send(array('result' => 'fail', 'message' => $this->lang->bug->notice->executionAccessDenied, 'load' => array('alert' => $this->lang->bug->notice->executionAccessDenied, 'locate' => $locate))); + } } return true;