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'); diff --git a/module/common/model.php b/module/common/model.php index 06a592add3..5f6c449edc 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1644,6 +1644,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 1b29ccfd57..b0420b1458 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 bbe814b283..70063f678a 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 4e07d53447..dadebc2276 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);