From 7e0a6e8b1169fba2494e0ea1b3c67ae3bbac885a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 17 Mar 2022 09:41:28 +0800 Subject: [PATCH 1/3] * fix bug #19267. --- framework/base/helper.class.php | 10 ++++++---- module/block/model.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 89d65dbb6b..ac1dcb7f2e 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -297,9 +297,10 @@ class baseHelper if(!empty($config->encryptSecret) and $password) { $secret = $config->encryptSecret; + $iv = str_repeat("\0", 8); if(function_exists('mcrypt_encrypt')) { - $encrypted = base64_encode(@mcrypt_encrypt(MCRYPT_DES, substr($secret, 0, 8), $password, MCRYPT_MODE_CBC)); + $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_DES, substr($secret, 0, 8), $password, MCRYPT_MODE_CBC, $iv)); } elseif(function_exists('openssl_encrypt')) { @@ -307,7 +308,7 @@ class baseHelper $oversize = strlen($password) % 8; if($oversize != 0) $password .= str_repeat("\0", 8 - $oversize); - $encrypted = @openssl_encrypt($password, 'DES-CBC', substr($secret, 0, 8), OPENSSL_ZERO_PADDING); + $encrypted = openssl_encrypt($password, 'DES-CBC', substr($secret, 0, 8), OPENSSL_ZERO_PADDING, $iv); } } if(empty($encrypted)) $encrypted = $password; @@ -331,13 +332,14 @@ class baseHelper if(!empty($config->encryptSecret) and $password) { $secret = $config->encryptSecret; + $iv = str_repeat("\0", 8); if(function_exists('mcrypt_decrypt')) { - $decryptedPassword = @mcrypt_decrypt(MCRYPT_DES, substr($secret, 0, 8), base64_decode($password), MCRYPT_MODE_CBC); + $decryptedPassword = trim(mcrypt_decrypt(MCRYPT_DES, substr($secret, 0, 8), base64_decode($password), MCRYPT_MODE_CBC, $iv)); } elseif(function_exists('openssl_decrypt')) { - $decryptedPassword = openssl_decrypt($password, 'DES-CBC', substr($secret, 0, 8), OPENSSL_ZERO_PADDING); + $decryptedPassword = trim(openssl_decrypt($password, 'DES-CBC', substr($secret, 0, 8), OPENSSL_ZERO_PADDING, $iv)); } /* Check decrypted password. Judge whether there is garbled code. */ diff --git a/module/block/model.php b/module/block/model.php index 85712f25a8..5b28ed6771 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -178,7 +178,7 @@ class blockModel extends model ->andWhere('t3.deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('t1.execution')->in($this->app->user->view->sprints)->fi() ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() - ->beginIF($this->config->vision)->andWhere('t2.vision')->eq($this->config->vision)->fi() + ->beginIF($this->config->vision)->andWhere('t3.vision')->eq($this->config->vision)->fi() ->fetchAll('id'); $data['tasks'] = isset($tasks) ? count($tasks) : 0; $data['doneTasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('status')->eq('done')->fetch('count'); From 5117bf75410c9af18209089a3035877b231d26ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 17 Mar 2022 11:26:01 +0800 Subject: [PATCH 2/3] * fix bug #15347,15345. --- module/common/model.php | 2 ++ module/execution/model.php | 2 ++ module/product/model.php | 2 ++ module/project/model.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index 443cc5c95d..11df82c34d 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1630,6 +1630,8 @@ EOD; */ public static function buildMoreButton($executionID) { + if(defined('TUTORIAL')) return; + global $lang, $app; $object = $app->dbh->query('SELECT project,type FROM ' . TABLE_EXECUTION . " WHERE `id` = '$executionID'")->fetch(); diff --git a/module/execution/model.php b/module/execution/model.php index 3c6ad82e4d..5d56e2b75a 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -232,6 +232,8 @@ class executionModel extends model */ public function saveState($executionID, $executions) { + if(defined('TUTORIAL')) return $executionID; + /* When the cookie and session do not exist, get it from the database. */ if(empty($executionID) and isset($this->config->execution->lastExecution) and isset($executions[$this->config->execution->lastExecution])) { diff --git a/module/product/model.php b/module/product/model.php index 349195a3a7..b90d7846e1 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -148,6 +148,8 @@ class productModel extends model */ public function saveState($productID, $products) { + if(defined('TUTORIAL')) return $productID; + if($productID == 0 and $this->cookie->preProductID) $productID = $this->cookie->preProductID; if(($productID == 0 and $this->session->product == '') or !isset($products[$productID])) $productID = key($products); $this->session->set('product', (int)$productID, $this->app->tab); diff --git a/module/project/model.php b/module/project/model.php index 5098ad546c..3624a464a9 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -117,6 +117,8 @@ class projectModel extends model */ public function saveState($projectID = 0, $projects = array()) { + if(defined('TUTORIAL')) return $projectID; + if($projectID == 0 and $this->cookie->lastProject) $projectID = $this->cookie->lastProject; if($projectID == 0 and $this->session->project == '') $projectID = key($projects); $this->session->set('project', (int)$projectID, $this->app->tab); From ba77087ac39a212dd5e6f535885f4b5c79bac796 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Wed, 23 Mar 2022 10:41:50 +0800 Subject: [PATCH 3/3] * Change api for create bug and change stroy. --- api/v1/entries/bugs.php | 2 +- api/v1/entries/storychange.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1/entries/bugs.php b/api/v1/entries/bugs.php index ef00d94398..3a8de36727 100644 --- a/api/v1/entries/bugs.php +++ b/api/v1/entries/bugs.php @@ -79,7 +79,7 @@ class bugsEntry extends entry if(!$productID and isset($this->requestBody->product)) $productID = $this->requestBody->product; if(!$productID) return $this->sendError(400, 'Need product id.'); - $fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story,task,mailto,keywords,steps'; + $fields = 'title,project,execution,openedBuild,assignedTo,pri,module,severity,type,story,task,mailto,keywords,steps'; $this->batchSetPost($fields); $this->setPost('product', $productID); diff --git a/api/v1/entries/storychange.php b/api/v1/entries/storychange.php index 174ec4620f..b46c4defa4 100644 --- a/api/v1/entries/storychange.php +++ b/api/v1/entries/storychange.php @@ -22,7 +22,7 @@ class storyChangeEntry extends Entry { $oldStory = $this->loadModel('story')->getByID($storyID); - $fields = 'reviewer,comment'; + $fields = 'reviewer,comment,executions,bugs,cases,tasks'; $this->batchSetPost($fields); $fields = 'title,spec,verify'; $this->batchSetPost($fields, $oldStory);