From 0a2b90f779fcf97bc32e5cfb7c78fcae9c731aa7 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 10 May 2023 11:10:05 +0000 Subject: [PATCH] * Move isLimitedInExecution function from control to zen. --- module/task/control.php | 19 +------------------ module/task/zen.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index b03cd712f2..b29c872743 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -115,7 +115,7 @@ class task extends control parse_str($extra, $output); /* 判断不能访问的执行。 TODO: 提示语应改为执行。 */ - if($this->checkLimitedExecution($executionID)) + if($this->taskZen->isLimitedInExecution($executionID)) { echo js::alert($this->lang->task->createDenied); return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); @@ -1912,21 +1912,4 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs(); $this->display('', 'editteam'); } - - /** - * 检查当前用户在该执行中是否是受限用户。 - * Checks if the current user is a limited user in this execution. - * - * @param string $executionID - * @access public - * @return bool - */ - public function checkLimitedExecution(string $executionID): bool - { - $this->execution->getLimitedExecution(); - $limitedExecutions = !empty($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : ''; - - if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) return true; - return false; - } } diff --git a/module/task/zen.php b/module/task/zen.php index aff63d2da2..cbb4163321 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -576,6 +576,23 @@ class taskZen extends task return $task; } + /** + * 检查当前用户在该执行中是否是受限用户。 + * Checks if the current user is a limited user in this execution. + * + * @param string $executionID + * @access public + * @return bool + */ + public function isLimitedInExecution(string $executionID): bool + { + $this->execution->getLimitedExecution(); + $limitedExecutions = !empty($this->session->limitedExecutions) ? $this->session->limitedExecutions : ''; + + if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) return true; + return false; + } + /** * 检查传入的创建数据是否符合要求。 * Check if the input post meets the requirements.