This commit is contained in:
王怡栋
2022-03-23 10:55:47 +08:00
8 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+6 -4
View File
@@ -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. */
+1 -1
View File
@@ -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');
+2
View File
@@ -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();
+2
View File
@@ -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]))
{
+2
View File
@@ -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);
+2
View File
@@ -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);