This commit is contained in:
Catouse
2019-11-21 15:19:23 +08:00
19 changed files with 64 additions and 61 deletions
+6 -6
View File
@@ -77,15 +77,15 @@ class bug extends control
/* Set productID, moduleID, queryID and branch. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
$_COOKIE['bugModule'] = 0;
setcookie('bugModule', 0, 0, $this->config->webRoot);
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule') setcookie('bugModule', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bymodule') setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType != 'bymodule') $this->session->set('bugBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
@@ -97,7 +97,7 @@ class bug extends control
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc';
setcookie('qaBugOrder', $orderBy, 0, $this->config->webRoot);
setcookie('qaBugOrder', $orderBy, 0, $this->config->webRoot, '', false, true);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
@@ -299,7 +299,7 @@ class bug extends control
if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID));
setcookie('bugModule', (int)$this->post->module, 0, $this->config->webRoot);
setcookie('bugModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, true);
$location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&browseType=unclosed&param=0&orderBy=id_desc");
if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID");
$response['locate'] = $location;
+3 -3
View File
@@ -171,14 +171,14 @@ class caselib extends control
/* Set menu. */
$libID = $this->caselib->saveLibState($libID, $libraries);
setcookie('preCaseLibID', $libID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preCaseLibID', $libID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preCaseLibID != $libID)
{
$_COOKIE['libCaseModule'] = 0;
setcookie('libCaseModule', 0, 0, $this->config->webRoot);
setcookie('libCaseModule', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule') setcookie('libCaseModule', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bymodule') setcookie('libCaseModule', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType != 'bymodule') $this->session->set('libBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->libCaseModule ? $this->cookie->libCaseModule : 0));
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
+1 -1
View File
@@ -59,7 +59,7 @@ class caselibModel extends model
}
}
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot);
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$pageNav = '';
$pageActions = '';
+4 -4
View File
@@ -78,7 +78,7 @@ class doc extends control
public function browse($libID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $from = 'doc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->from = $from;
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot);
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->loadModel('search');
@@ -656,7 +656,7 @@ class doc extends control
*/
public function allLibs($type, $product = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
setcookie('product', $product, $this->config->cookieLife, $this->config->webRoot);
setcookie('product', $product, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$libName = $this->lang->doc->libTypeList[$type];
$crumb = html::a(inlink('allLibs', "type=$type&product=$product"), $libName);
@@ -707,7 +707,7 @@ class doc extends control
$this->app->session->set('docList', $uri);
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot);
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch();
@@ -798,7 +798,7 @@ class doc extends control
public function objectLibs($type, $objectID, $from = 'doc')
{
$this->from = $from;
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot);
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch();
+1 -1
View File
@@ -1500,7 +1500,7 @@ class docModel extends model
$projectProduct = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($productID)->andWhere('project')->eq($projectID)->fetch();
if(empty($projectProduct))
{
setcookie('product', 0, $this->config->cookieLife, $this->config->webRoot);
setcookie('product', 0, $this->config->cookieLife, $this->config->webRoot, '', false, true);
return html::a(helper::createLink('doc', 'allLibs', "type=project"), $this->lang->projectCommon) . $this->lang->doc->separator;
}
}
+1 -1
View File
@@ -90,7 +90,7 @@ class extensionModel extends model
public function getModulesByAPI()
{
$requestType = $this->config->requestType;
$webRoot = helper::safe64Encode($this->config->webRoot);
$webRoot = helper::safe64Encode($this->config->webRoot, '', false, true);
$apiURL = $this->apiRoot . 'apiGetmodules-' . $requestType . '-' . $webRoot . '.json';
$data = $this->fetchAPI($apiURL);
if(isset($data->modules)) return $data->modules;
+1 -1
View File
@@ -641,7 +641,7 @@ class gitModel extends model
$diff = '';
$oldSelf = $this->server->PHP_SELF;
$this->server->set('PHP_SELF', $this->config->webRoot);
$this->server->set('PHP_SELF', $this->config->webRoot, '', false, true);
if(!$repoRoot) $repoRoot = $this->repoRoot;
+5 -5
View File
@@ -115,15 +115,15 @@ class product extends control
/* Set product, module and query. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
$_COOKIE['storyModule'] = 0;
setcookie('storyModule', 0, 0, $this->config->webRoot);
setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule') setcookie('storyModule', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bymodule') setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType != 'bymodule') $this->session->set('storyBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0));
@@ -134,7 +134,7 @@ class product extends control
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc';
setcookie('productStoryOrder', $orderBy, 0, $this->config->webRoot);
setcookie('productStoryOrder', $orderBy, 0, $this->config->webRoot, '', false, true);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
+2 -2
View File
@@ -123,7 +123,7 @@ class productModel extends model
}
$isMobile = $this->app->viewType == 'mhtml';
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot);
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProduct = $this->getById($productID);
$this->session->set('currentProductType', $currentProduct->type);
@@ -201,7 +201,7 @@ class productModel extends model
if($this->cookie->preProductID != $productID)
{
$this->cookie->set('preBranch', 0);
setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot, '', false, true);
}
return $this->session->product;
+22 -22
View File
@@ -126,23 +126,23 @@ class project extends control
$project = $this->commonAction($projectID, $status);
$projectID = $project->id;
$products = $this->config->global->flow == 'onlyTask' ? array() : $this->loadModel('product')->getProductsByProject($projectID);
setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProjectID != $projectID)
{
$_COOKIE['moduleBrowseParam'] = $_COOKIE['productBrowseParam'] = 0;
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot);
setcookie('productBrowseParam', 0, 0, $this->config->webRoot);
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('productBrowseParam', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule')
{
setcookie('moduleBrowseParam', (int)$param, 0, $this->config->webRoot);
setcookie('productBrowseParam', 0, 0, $this->config->webRoot);
setcookie('moduleBrowseParam', (int)$param, 0, $this->config->webRoot, '', false, true);
setcookie('productBrowseParam', 0, 0, $this->config->webRoot, '', false, true);
}
elseif($browseType == 'byproduct')
{
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot);
setcookie('productBrowseParam', (int)$param, 0, $this->config->webRoot);
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('productBrowseParam', (int)$param, 0, $this->config->webRoot, '', false, true);
}
else
{
@@ -162,7 +162,7 @@ class project extends control
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->projectTaskOrder ? $this->cookie->projectTaskOrder : 'status,id_desc';
setcookie('projectTaskOrder', $orderBy, 0, $this->config->webRoot);
setcookie('projectTaskOrder', $orderBy, 0, $this->config->webRoot, '', false, true);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
@@ -636,40 +636,40 @@ class project extends control
$this->project->getLimitedProject();
$type = strtolower($type);
setcookie('storyPreProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot);
setcookie('storyPreProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->storyPreProjectID != $projectID)
{
$_COOKIE['storyModuleParam'] = $_COOKIE['storyProductParam'] = $_COOKIE['storyBranchParam'] = 0;
setcookie('storyModuleParam', 0, 0, $this->config->webRoot);
setcookie('storyProductParam', 0, 0, $this->config->webRoot);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot);
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyProductParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot, '', false, true);
}
if($type == 'bymodule')
{
$_COOKIE['storyModuleParam'] = (int)$param;
$_COOKIE['storyProductParam'] = 0;
$_COOKIE['storyBranchParam'] = 0;
setcookie('storyModuleParam', (int)$param, 0, $this->config->webRoot);
setcookie('storyProductParam', 0, 0, $this->config->webRoot);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot);
setcookie('storyModuleParam', (int)$param, 0, $this->config->webRoot, '', false, true);
setcookie('storyProductParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot, '', false, true);
}
elseif($type == 'byproduct')
{
$_COOKIE['storyModuleParam'] = 0;
$_COOKIE['storyProductParam'] = (int)$param;
$_COOKIE['storyBranchParam'] = 0;
setcookie('storyModuleParam', 0, 0, $this->config->webRoot);
setcookie('storyProductParam', (int)$param, 0, $this->config->webRoot);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot);
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyProductParam', (int)$param, 0, $this->config->webRoot, '', false, true);
setcookie('storyBranchParam', 0, 0, $this->config->webRoot, '', false, true);
}
elseif($type == 'bybranch')
{
$_COOKIE['storyModuleParam'] = 0;
$_COOKIE['storyProductParam'] = 0;
$_COOKIE['storyBranchParam'] = $param;
setcookie('storyModuleParam', 0, 0, $this->config->webRoot);
setcookie('storyProductParam', 0, 0, $this->config->webRoot);
setcookie('storyBranchParam', $param, 0, $this->config->webRoot);
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyProductParam', 0, 0, $this->config->webRoot, '', false, true);
setcookie('storyBranchParam', $param, 0, $this->config->webRoot, '', false, true);
}
else
{
@@ -681,7 +681,7 @@ class project extends control
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->projectStoryOrder ? $this->cookie->projectStoryOrder : 'pri';
setcookie('projectStoryOrder', $orderBy, 0, $this->config->webRoot);
setcookie('projectStoryOrder', $orderBy, 0, $this->config->webRoot, '', false, true);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
+1 -1
View File
@@ -160,7 +160,7 @@ class projectModel extends model
$isMobile = $this->app->viewType == 'mhtml';
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot);
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProject = $this->getById($projectID);
$dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod&extra=$extra");
+1 -1
View File
@@ -126,7 +126,7 @@ class story extends control
$response['locate'] = $this->createLink('project', 'story', "projectID=$projectID&orderBy=&browseType=byModule&moduleID=$moduleID");
if($projectID == 0)
{
setcookie('storyModule', (int)$moduleID, 0, $this->config->webRoot);
setcookie('storyModule', (int)$moduleID, 0, $this->config->webRoot, '', false, true);
$productID = $this->post->product ? $this->post->product : $productID;
$branchID = $this->post->branch ? $this->post->branch : $branch;
$response['locate'] = $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=unclosed&param=0&orderBy=id_desc");
+1 -1
View File
@@ -603,7 +603,7 @@ class svnModel extends model
$diff = '';
$oldSelf = $this->server->PHP_SELF;
$this->server->set('PHP_SELF', $this->config->webRoot);
$this->server->set('PHP_SELF', $this->config->webRoot, '', false, true);
if(!$repoRoot) $repoRoot = $this->repoRoot;
+1 -1
View File
@@ -155,7 +155,7 @@ class task extends control
}
elseif($this->post->after == 'toTaskList')
{
setcookie('moduleBrowseParam', (int)$this->post->module, 0, $this->config->webRoot);
setcookie('moduleBrowseParam', (int)$this->post->module, 0, $this->config->webRoot, '', false, true);
$taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=unclosed&param=0&orderBy=id_desc");
$response['locate'] = $taskLink;
$this->send($response);
+6 -6
View File
@@ -63,16 +63,16 @@ class testcase extends control
/* Set browseType, productID, moduleID and queryID. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
$_COOKIE['caseModule'] = 0;
setcookie('caseModule', 0, 0, $this->config->webRoot);
setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType != 'bymodule') $this->session->set('caseBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->caseModule ? $this->cookie->caseModule : 0));
@@ -243,7 +243,7 @@ class testcase extends control
/* If link from no head then reload. */
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
setcookie('caseModule', (int)$this->post->module, 0, $this->config->webRoot);
setcookie('caseModule', (int)$this->post->module, 0, $this->config->webRoot, '', false, true);
$response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all&param=0&orderBy=id_desc");
$this->send($response);
}
+1 -1
View File
@@ -81,7 +81,7 @@ class testsuiteModel extends model
return;
}
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot);
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$currentProduct = $this->product->getById($productID);
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
+3 -3
View File
@@ -264,14 +264,14 @@ class testtask extends control
if(!$task) die(js::error($this->lang->testtask->checkLinked) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID, $task->branch, $taskID);
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preTaskID != $taskID)
{
$_COOKIE['taskCaseModule'] = 0;
setcookie('taskCaseModule', 0, 0, $this->config->webRoot);
setcookie('taskCaseModule', 0, 0, $this->config->webRoot, '', false, true);
}
if($browseType == 'bymodule') setcookie('taskCaseModule', (int)$param, 0, $this->config->webRoot);
if($browseType == 'bymodule') setcookie('taskCaseModule', (int)$param, 0, $this->config->webRoot, '', false, true);
if($browseType != 'bymodule') $this->session->set('taskCaseBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->taskCaseModule ? $this->cookie->taskCaseModule : 0));
+1 -1
View File
@@ -829,7 +829,7 @@ class user extends control
}
$this->app->loadLang('misc');
$this->view->noGDLib = sprintf($this->lang->misc->noGDLib, common::getSysURL() . $this->config->webRoot);
$this->view->noGDLib = sprintf($this->lang->misc->noGDLib, common::getSysURL() . $this->config->webRoot, '', false, true);
$this->view->title = $this->lang->user->login;
$this->view->referer = $this->referer;
$this->view->s = zget($this->config->global, 'sn', '');
+3
View File
@@ -17,6 +17,9 @@ error_reporting(0);
/* Start output buffer. */
ob_start();
/* Set cookie_httponly. */
ini_set("session.cookie_httponly", 1);
/* Load the framework. */
include '../framework/router.class.php';
include '../framework/control.class.php';