From ad622ccb021c6aabbed7137cffd3aaf0067e263d Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Mar 2022 15:58:35 +0800 Subject: [PATCH 1/7] * fix bug #t --- module/common/model.php | 1 + module/user/model.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 443cc5c95d..88e1273320 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -243,6 +243,7 @@ class commonModel extends model $user->admin = false; $user->rights = $this->loadModel('user')->authorize('guest'); $user->groups = array('group'); + $user->visions = $this->config->vision; if(!defined('IN_UPGRADE')) $user->view = $this->user->grantUserView($user->account, $user->rights['acls']); $this->session->set('user', $user); $this->app->user = $this->session->user; diff --git a/module/user/model.php b/module/user/model.php index b885a9c3a0..b1e74ab838 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -249,13 +249,16 @@ class userModel extends model /** * Get user info by ID. * - * @param mix $userID - * @param string $field id|account + * @param mix $userID + * @param string $field id|account * @access public * @return object|bool */ public function getById($userID, $field = 'account') { + /* Return current user when user is guest or empty to make sure pages in dashboard work fine. */ + if(empty($userID) && $this->app->user->account == 'guest') return $this->app->user; + if($field == 'id') $userID = (int)$userID; if($field == 'account') $userID = str_replace(' ', '', $userID); From ff2d0cc99f6ca1b4f54685ff5a98b9ebd50f32a8 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Mar 2022 16:44:22 +0800 Subject: [PATCH 2/7] * fix bug no permisssion --- extension/lite/execution/ext/model/lite.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php index c3d5f927f4..a995225925 100644 --- a/extension/lite/execution/ext/model/lite.php +++ b/extension/lite/execution/ext/model/lite.php @@ -25,7 +25,14 @@ public function setMenu($executionID, $buildID = 0, $extra = '') $modulePageNav .= ""; From 59840351e38902674df2496abd4a45197da3253a Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Mar 2022 17:17:22 +0800 Subject: [PATCH 3/7] * fix bug no permisssion --- extension/lite/execution/ext/model/lite.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php index a995225925..cd96f475ba 100644 --- a/extension/lite/execution/ext/model/lite.php +++ b/extension/lite/execution/ext/model/lite.php @@ -25,14 +25,20 @@ public function setMenu($executionID, $buildID = 0, $extra = '') $modulePageNav .= ""; From 15cb78764dbaf0cf75a44c7260408ad17dab6b9a Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Mar 2022 17:18:00 +0800 Subject: [PATCH 4/7] * fix bug no permisssion --- extension/lite/execution/ext/model/lite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php index cd96f475ba..0297ae5929 100644 --- a/extension/lite/execution/ext/model/lite.php +++ b/extension/lite/execution/ext/model/lite.php @@ -38,7 +38,7 @@ public function setMenu($executionID, $buildID = 0, $extra = '') $method = 'kanban'; } - $modulePageNav .= '
  • ' . html::a(helper::createLink('execution',$method, "execution=$kanban->id"), $kanban->name) . '
  • '; + $modulePageNav .= '
  • ' . html::a(helper::createLink('execution', $method, "execution=$kanban->id"), $kanban->name) . '
  • '; } $modulePageNav .= ""; From 3fefbe36992a5de3a7c5c4e5eb1dc8101f1a0c45 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Mar 2022 17:32:55 +0800 Subject: [PATCH 5/7] * fix bug no permisssion --- extension/lite/execution/ext/model/lite.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php index 0297ae5929..0d0dee4661 100644 --- a/extension/lite/execution/ext/model/lite.php +++ b/extension/lite/execution/ext/model/lite.php @@ -25,11 +25,11 @@ public function setMenu($executionID, $buildID = 0, $extra = '') $modulePageNav .= "