* change for set cookie secure.
This commit is contained in:
+5
-4
@@ -106,6 +106,7 @@ $config->framework->logDays = 14; // 日志文件保存的天数。
|
||||
$config->framework->autoRepairTable = true;
|
||||
$config->framework->autoLang = false;
|
||||
$config->framework->filterCSRF = false;
|
||||
$config->framework->setCookieSecure = true;
|
||||
|
||||
$config->framework->detectDevice['zh-cn'] = true; // 在zh-cn语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
|
||||
$config->framework->detectDevice['zh-tw'] = true; // 在zh-tw语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
|
||||
@@ -150,6 +151,10 @@ if(file_exists($filterConfig)) include $filterConfig;
|
||||
$dbConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'db.php';
|
||||
if(file_exists($dbConfig)) include $dbConfig;
|
||||
|
||||
/* 引用自定义的配置。 Include the custom config file. */
|
||||
$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php';
|
||||
if(file_exists($myConfig)) include $myConfig;
|
||||
|
||||
/* 禅道配置文件。zentaopms settings. */
|
||||
$zentaopmsConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'zentaopms.php';
|
||||
if(file_exists($zentaopmsConfig)) include $zentaopmsConfig;
|
||||
@@ -157,7 +162,3 @@ if(file_exists($zentaopmsConfig)) include $zentaopmsConfig;
|
||||
/* Include extension config files. */
|
||||
$extConfigFiles = glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ext/*.php');
|
||||
if($extConfigFiles) foreach($extConfigFiles as $extConfigFile) include $extConfigFile;
|
||||
|
||||
/* 引用自定义的配置。 Include the custom config file. */
|
||||
$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php';
|
||||
if(file_exists($myConfig)) include $myConfig;
|
||||
|
||||
@@ -868,3 +868,17 @@ function zget($var, $key, $valueWhenNone = false, $valueWhenExists = false)
|
||||
if($valueWhenNone !== false) return $valueWhenNone;
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is https.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function isHttps()
|
||||
{
|
||||
if(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') return true;
|
||||
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') return true;
|
||||
if(!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -376,6 +376,7 @@ class baseRouter
|
||||
$this->loadClass('dao', $static = true);
|
||||
$this->loadClass('mobile', $static = true);
|
||||
|
||||
$this->setCookieSecure();
|
||||
$this->setSuperVars();
|
||||
$this->setDebug();
|
||||
$this->setErrorHandler();
|
||||
@@ -617,6 +618,18 @@ class baseRouter
|
||||
$_COOKIE = validater::filterSuper($_COOKIE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cookieSecure config.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setCookieSecure()
|
||||
{
|
||||
$this->config->cookieSecure = false;
|
||||
if($this->config->framework->setCookieSecure and isHttps()) $this->config->cookieSecure = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置Debug模式。
|
||||
* set Debug.
|
||||
@@ -839,7 +852,7 @@ class baseRouter
|
||||
{
|
||||
$sessionName = $this->config->sessionVar;
|
||||
session_name($sessionName);
|
||||
session_set_cookie_params(0, $this->config->webRoot);
|
||||
session_set_cookie_params(0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if($this->config->customSession) session_save_path($this->getTmpRoot() . 'session');
|
||||
session_start();
|
||||
|
||||
@@ -916,7 +929,7 @@ class baseRouter
|
||||
$this->clientLang = $this->config->default->lang;
|
||||
}
|
||||
|
||||
setcookie('lang', $this->clientLang, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lang', $this->clientLang, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if(!isset($_COOKIE['lang'])) $_COOKIE['lang'] = $this->clientLang;
|
||||
|
||||
return true;
|
||||
@@ -970,7 +983,7 @@ class baseRouter
|
||||
$this->clientTheme = $this->config->default->theme;
|
||||
}
|
||||
|
||||
setcookie('theme', $this->clientTheme, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('theme', $this->clientTheme, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = $this->clientTheme;
|
||||
|
||||
return true;
|
||||
@@ -996,7 +1009,7 @@ class baseRouter
|
||||
$this->clientDevice = ($mobile->isMobile() and !$mobile->isTablet()) ? 'mobile' : 'desktop';
|
||||
}
|
||||
|
||||
setcookie('device', $this->clientDevice, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('device', $this->clientDevice, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if(!isset($_COOKIE['device'])) $_COOKIE['device'] = $this->clientDevice;
|
||||
|
||||
return $this->clientDevice;
|
||||
|
||||
+14
-14
@@ -108,22 +108,22 @@ class bug extends control
|
||||
/* Set productID, moduleID, queryID and branch. */
|
||||
if(!$this->projectID) $productID = $this->product->saveState($productID, $this->products);
|
||||
$branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch;
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch or $browseType == 'bybranch')
|
||||
{
|
||||
$_COOKIE['bugModule'] = 0;
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
}
|
||||
if($browseType == 'bymodule' or $browseType == '')
|
||||
{
|
||||
setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$_COOKIE['bugBranch'] = 0;
|
||||
setcookie('bugBranch', 0, 0, $this->config->webRoot, '', false, false);
|
||||
if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('bugBranch', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
}
|
||||
if($browseType == 'bybranch') setcookie('bugBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
if($browseType == 'bybranch') setcookie('bugBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('bugBrowseType', $browseType);
|
||||
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
|
||||
@@ -135,7 +135,7 @@ class bug extends control
|
||||
/* Set moduleTree. */
|
||||
if($browseType == '')
|
||||
{
|
||||
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$browseType = 'unclosed';
|
||||
}
|
||||
|
||||
@@ -153,7 +153,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, '', false, true);
|
||||
setcookie('qaBugOrder', $orderBy, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
@@ -341,7 +341,7 @@ class bug extends control
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
|
||||
/* Set from param if there is a object to transfer bug. */
|
||||
setcookie('lastBugModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastBugModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$bugResult = $this->bug->create($from = isset($fromObjectIDKey) ? $fromObjectIDKey : '');
|
||||
if(!$bugResult or dao::isError())
|
||||
{
|
||||
@@ -383,17 +383,17 @@ class bug extends control
|
||||
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID));
|
||||
|
||||
if(isset($output['executionID']))
|
||||
if(!empty($output['executionID']))
|
||||
{
|
||||
$location = $this->createLink('execution', 'bug', "executionID={$output['executionID']}");
|
||||
}
|
||||
elseif(isset($output['projectID']))
|
||||
elseif(!empty($output['projectID']))
|
||||
{
|
||||
$location = $this->createLink('project', 'bug', "projectID={$output['projectID']}");
|
||||
}
|
||||
else
|
||||
{
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc");
|
||||
}
|
||||
if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID");
|
||||
@@ -608,7 +608,7 @@ class bug extends control
|
||||
{
|
||||
$actions = $this->bug->batchCreate($productID, $branch);
|
||||
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
die(js::locate($this->createLink('bug', 'browse', "productID={$productID}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc"), 'parent'));
|
||||
}
|
||||
|
||||
|
||||
@@ -170,14 +170,14 @@ class caselib extends control
|
||||
|
||||
/* Set menu. */
|
||||
$libID = $this->caselib->saveLibState($libID, $libraries);
|
||||
setcookie('preCaseLibID', $libID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preCaseLibID', $libID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if($this->cookie->preCaseLibID != $libID)
|
||||
{
|
||||
$_COOKIE['libCaseModule'] = 0;
|
||||
setcookie('libCaseModule', 0, 0, $this->config->webRoot, '', false, true);
|
||||
setcookie('libCaseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
}
|
||||
|
||||
if($browseType == 'bymodule') setcookie('libCaseModule', (int)$param, 0, $this->config->webRoot, '', false, true);
|
||||
if($browseType == 'bymodule') setcookie('libCaseModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, 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;
|
||||
@@ -241,7 +241,7 @@ class caselib extends control
|
||||
{
|
||||
$this->loadModel('testcase');
|
||||
$this->config->testcase->create->requiredFields = $this->config->caselib->createcase->requiredFields;
|
||||
setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$caseResult = $this->testcase->create($bugID = 0);
|
||||
if(!$caseResult or dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class doc extends control
|
||||
public function index()
|
||||
{
|
||||
$this->from = 'doc';
|
||||
setcookie('from', 'doc', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('from', 'doc', $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$this->session->set('docList', $this->app->getURI(true), 'doc');
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -79,7 +79,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, '', false, true);
|
||||
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$this->loadModel('search');
|
||||
|
||||
@@ -321,7 +321,7 @@ class doc extends control
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
setcookie('lastDocModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastDocModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$docResult = $this->doc->create();
|
||||
if(!$docResult or dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
@@ -802,7 +802,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, '', false, true);
|
||||
setcookie('product', $product, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$libName = $this->lang->doc->libTypeList[$type];
|
||||
$crumb = html::a(inlink('allLibs', "type=$type&product=$product"), $libName);
|
||||
@@ -858,7 +858,7 @@ class doc extends control
|
||||
$this->app->session->set('docList', $uri, 'doc');
|
||||
|
||||
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
|
||||
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
|
||||
@@ -1553,7 +1553,7 @@ class docModel extends model
|
||||
$executionProduct = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($productID)->andWhere('project')->eq($executionID)->fetch();
|
||||
if(empty($executionProduct))
|
||||
{
|
||||
setcookie('product', 0, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('product', 0, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
return html::a(helper::createLink('doc', 'allLibs', "type=execution"), $this->lang->executionCommon) . $this->lang->doc->separator;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,7 +933,7 @@ class fileModel extends model
|
||||
for($i = 0; $i < $obLevel; $i++) ob_end_clean();
|
||||
|
||||
/* Set the downloading cookie, thus the export form page can use it to judge whether to close the window or not. */
|
||||
setcookie('downloading', 1, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('downloading', 1, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
/* Only download upload file that is in zentao. */
|
||||
if($type == 'file' and stripos($content, $this->savePath) !== 0) die();
|
||||
|
||||
@@ -137,23 +137,23 @@ class product extends control
|
||||
|
||||
/* Set product, module and query. */
|
||||
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch or $browseType == 'bybranch')
|
||||
{
|
||||
$_COOKIE['storyModule'] = 0;
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
}
|
||||
|
||||
if($browseType == 'bymodule' or $browseType == '')
|
||||
{
|
||||
setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$_COOKIE['storyBranch'] = 0;
|
||||
setcookie('storyBranch', 0, 0, $this->config->webRoot, '', false, false);
|
||||
if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyBranch', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
}
|
||||
if($browseType == 'bybranch') setcookie('storyBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
if($browseType == 'bybranch') setcookie('storyBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0));
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
@@ -172,7 +172,7 @@ class product extends control
|
||||
$createModuleLink = $storyType == 'story' ? 'createStoryLink' : 'createRequirementLink';
|
||||
if($browseType == '')
|
||||
{
|
||||
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$browseType = 'unclosed';
|
||||
}
|
||||
else
|
||||
@@ -195,7 +195,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, '', false, true);
|
||||
setcookie('productStoryOrder', $orderBy, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
@@ -80,7 +80,7 @@ class productModel extends model
|
||||
}
|
||||
$isMobile = $this->app->viewType == 'mhtml';
|
||||
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if($productID) $currentProduct = $this->getById($productID);
|
||||
|
||||
if($isProject) $extra = $this->session->project;
|
||||
@@ -149,7 +149,7 @@ class productModel extends model
|
||||
if($this->cookie->preProductID != $productID)
|
||||
{
|
||||
$this->cookie->set('preBranch', 0);
|
||||
setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
}
|
||||
|
||||
return $this->session->product;
|
||||
|
||||
@@ -411,7 +411,7 @@ class repo extends control
|
||||
{
|
||||
$infos = unserialize(file_get_contents($cacheFile));
|
||||
}
|
||||
if($this->cookie->repoRefresh) setcookie('repoRefresh', 0, 0, $this->config->webRoot);
|
||||
if($this->cookie->repoRefresh) setcookie('repoRefresh', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
/* Set logType and revisions. */
|
||||
$logType = 'dir';
|
||||
@@ -885,7 +885,7 @@ class repo extends control
|
||||
}
|
||||
|
||||
$this->repo->setRepoBranch($branchID);
|
||||
setcookie("syncBranch", $branchID, 0, $this->config->webRoot);
|
||||
setcookie("syncBranch", $branchID, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -919,7 +919,7 @@ class repo extends control
|
||||
if($branchID) $this->repo->saveExistCommits4Branch($repo->id, $branchID);
|
||||
|
||||
$branchID = reset($branches);
|
||||
setcookie("syncBranch", $branchID, 0, $this->config->webRoot);
|
||||
setcookie("syncBranch", $branchID, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
if($branchID) $this->repo->fixCommit($repoID);
|
||||
}
|
||||
@@ -955,7 +955,7 @@ class repo extends control
|
||||
$this->scm->setEngine($repo);
|
||||
|
||||
$this->repo->setRepoBranch($branch);
|
||||
setcookie("syncBranch", $branch, 0, $this->config->webRoot);
|
||||
setcookie("syncBranch", $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$latestInDB = $this->dao->select('DISTINCT t1.*')->from(TABLE_REPOHISTORY)->alias('t1')
|
||||
->leftJoin(TABLE_REPOBRANCH)->alias('t2')->on('t1.id=t2.revision')
|
||||
@@ -975,7 +975,7 @@ class repo extends control
|
||||
{
|
||||
if($branch) $this->repo->saveExistCommits4Branch($repo->id, $branch);
|
||||
|
||||
setcookie("syncBranch", $branch, 0, $this->config->webRoot);
|
||||
setcookie("syncBranch", $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
$this->repo->markSynced($repoID);
|
||||
die('finish');
|
||||
}
|
||||
|
||||
@@ -941,7 +941,7 @@ class repoModel extends model
|
||||
*/
|
||||
public function setRepoBranch($branch)
|
||||
{
|
||||
setcookie("repoBranch", $branch, 0, $this->config->webRoot);
|
||||
setcookie("repoBranch", $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
$_COOKIE['repoBranch'] = $branch;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ class story extends control
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
|
||||
setcookie('lastStoryModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastStoryModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$storyResult = $this->story->create($objectID, $bugID, $from = isset($fromObjectIDKey) ? $fromObjectIDKey : '');
|
||||
if(!$storyResult or dao::isError())
|
||||
{
|
||||
@@ -159,14 +159,14 @@ class story extends control
|
||||
$moduleID = $this->post->module ? $this->post->module : 0;
|
||||
if($objectID == 0)
|
||||
{
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$branchID = $this->post->branch ? $this->post->branch : $branch;
|
||||
$response['locate'] = $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=unclosed¶m=0&type=$type&orderBy=id_desc");
|
||||
if($this->session->storyList) $response['locate'] = $this->session->storyList;
|
||||
}
|
||||
else
|
||||
{
|
||||
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true);
|
||||
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
$execution = $this->dao->findById((int)$objectID)->from(TABLE_EXECUTION)->fetch();
|
||||
$moduleName = $execution->type == 'project' ? 'projectstory' : 'execution';
|
||||
$param = $execution->type == 'project' ? "projectID=$objectID&productID=$productID" : "executionID=$objectID&orderBy=id_desc&browseType=unclosed";
|
||||
@@ -364,7 +364,7 @@ class story extends control
|
||||
|
||||
/* Clear title when switching products and set the session for the current product. */
|
||||
if($productID != $this->cookie->preProductID) unset($_SESSION['storyImagesFile']);
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$this->story->replaceURLang($type);
|
||||
|
||||
@@ -407,7 +407,7 @@ class story extends control
|
||||
}
|
||||
elseif($executionID)
|
||||
{
|
||||
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$moduleName = $execution->type == 'project' ? 'projectstory' : 'execution';
|
||||
$param = $execution->type == 'project' ? "projectID=$executionID&productID=$productID" : "executionID=$executionID&orderBy=id_desc&browseType=unclosed";
|
||||
$link = $this->createLink($moduleName, 'story', $param);
|
||||
@@ -415,7 +415,7 @@ class story extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('storyModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID=$productID&branch=$branch&browseType=unclosed&queryID=0&type=$type");
|
||||
die(js::locate($locateLink, 'parent'));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?php include './header.html.php';?>
|
||||
<style>
|
||||
#product_chosen {border-right:1px solid #dcdcdc;}
|
||||
#branch_chosen>a {border-left:0px;}
|
||||
</style>
|
||||
<?php js::set('holders', $lang->story->placeholder); ?>
|
||||
<?php js::set('blockID', $blockID); ?>
|
||||
<?php if(common::checkNotCN()):?>
|
||||
@@ -37,15 +41,11 @@
|
||||
<tr>
|
||||
<th><?php echo $lang->story->product;?></th>
|
||||
<td colspan="2">
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<div class='input-group'>
|
||||
<?php endif;?>
|
||||
<?php echo html::select('product', $products, $productID, "onchange='loadProduct(this.value);' class='form-control chosen control-product'");?>
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<span class='input-group-addon fix-border fix-padding'></span>
|
||||
<?php echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
|
||||
@@ -90,7 +90,7 @@ class task extends control
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
|
||||
setcookie('lastTaskModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastTaskModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if($this->post->execution) $executionID = (int)$this->post->execution;
|
||||
$tasksID = $this->task->create($executionID);
|
||||
if(dao::isError())
|
||||
@@ -150,7 +150,7 @@ class task extends control
|
||||
}
|
||||
elseif($this->post->after == 'toTaskList')
|
||||
{
|
||||
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$taskLink = $this->createLink('execution', 'task', "executionID=$executionID&status=unclosed¶m=0&orderBy=id_desc");
|
||||
$response['locate'] = $taskLink;
|
||||
$this->send($response);
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<tbody>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($stories as $storyID => $storyTitle):?>
|
||||
<?php if(empty($storyID) or isset($testStoryIdList[$storyID])) continue;?>
|
||||
<?php if(empty($storyID) or !isset($testStoryIdList[$storyID])) continue;?>
|
||||
<tr>
|
||||
<td><?php echo html::select("testStory[]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("testPri[]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
|
||||
|
||||
+11
-12
@@ -98,13 +98,16 @@ class testcase extends control
|
||||
/* Set browseType, productID, moduleID and queryID. */
|
||||
$productID = $this->app->openApp != 'project' ? $this->product->saveState($productID, $this->products) : $productID;
|
||||
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
|
||||
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)
|
||||
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
|
||||
{
|
||||
$_COOKIE['caseModule'] = 0;
|
||||
setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('caseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
}
|
||||
if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot, '', false, false);
|
||||
if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, 0, $this->config->webRoot, '', false, true);
|
||||
if($browseType == 'bymodule') setcookie('caseModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if($browseType != 'bymodule') $this->session->set('caseBrowseType', $browseType);
|
||||
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->caseModule ? $this->cookie->caseModule : 0));
|
||||
@@ -296,7 +299,7 @@ class testcase extends control
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
|
||||
setcookie('lastCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', false, false);
|
||||
setcookie('lastCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$caseResult = $this->testcase->create($bugID);
|
||||
if(!$caseResult or dao::isError())
|
||||
{
|
||||
@@ -323,12 +326,8 @@ 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', 0, 0, $this->config->webRoot, '', false, false);
|
||||
$currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase';
|
||||
$currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse';
|
||||
$projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : '';
|
||||
$response['locate'] = $this->createLink($currentModule, $currentMethod, $projectParam . "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc");
|
||||
if($this->app->openApp == 'execution') $response['locate'] = $this->createLink('execution', 'testcase', "executionID={$this->session->execution}&type=all");
|
||||
setcookie('caseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc");
|
||||
$this->send($response);
|
||||
}
|
||||
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
|
||||
@@ -477,7 +476,7 @@ class testcase extends control
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
|
||||
setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('caseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
$currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase';
|
||||
$currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse';
|
||||
$projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : '';
|
||||
|
||||
@@ -32,7 +32,7 @@ class testsuiteModel extends model
|
||||
return;
|
||||
}
|
||||
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
$currentProduct = $this->product->getById($productID);
|
||||
|
||||
$dropMenuLink = helper::createLink('product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
|
||||
@@ -440,7 +440,7 @@ class testtask extends control
|
||||
{
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID);
|
||||
}
|
||||
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
/* Determines whether an object is editable. */
|
||||
$canBeChanged = common::canBeChanged('testtask', $task);
|
||||
@@ -448,10 +448,10 @@ class testtask extends control
|
||||
if($this->cookie->preTaskID != $taskID)
|
||||
{
|
||||
$_COOKIE['taskCaseModule'] = 0;
|
||||
setcookie('taskCaseModule', 0, 0, $this->config->webRoot, '', false, true);
|
||||
setcookie('taskCaseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
}
|
||||
|
||||
if($browseType == 'bymodule') setcookie('taskCaseModule', (int)$param, 0, $this->config->webRoot, '', false, true);
|
||||
if($browseType == 'bymodule') setcookie('taskCaseModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
if($browseType != 'bymodule') $this->session->set('taskCaseBrowseType', $browseType);
|
||||
|
||||
/* Set the browseType, moduleID and queryID. */
|
||||
@@ -1084,7 +1084,7 @@ class testtask extends control
|
||||
else
|
||||
{
|
||||
/* set cookie for ajax load caselist when close colorbox. */
|
||||
setcookie('selfClose', 1, 0, $this->config->webRoot, '', false, false);
|
||||
setcookie('selfClose', 1, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
if($preAndNext->next)
|
||||
{
|
||||
|
||||
@@ -1763,7 +1763,7 @@ class treeModel extends model
|
||||
break;
|
||||
}
|
||||
if(strpos($this->session->{$module->type . 'List'}, 'param=' . $moduleID)) $this->session->set($module->type . 'List', str_replace('param=' . $moduleID, 'param=0', $this->session->{$module->type . 'List'}));
|
||||
if($cookieName) setcookie($cookieName, 0, time() - 3600, $this->config->webRoot, '', false, false);
|
||||
if($cookieName) setcookie($cookieName, 0, time() - 3600, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -988,9 +988,9 @@ class userModel extends model
|
||||
*/
|
||||
public function keepLogin($user)
|
||||
{
|
||||
setcookie('keepLogin', 'on', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('za', $user->account, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('zp', sha1($user->account . $user->password . $this->server->request_time), $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setcookie('keepLogin', 'on', $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
setcookie('za', $user->account, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
setcookie('zp', sha1($user->account . $user->password . $this->server->request_time), $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ class webhook extends control
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Unset selectedDepts cookie. */
|
||||
setcookie('selectedDepts', '', 0, $this->config->webRoot, '', false, true);
|
||||
setcookie('selectedDepts', '', 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
$this->view->title = $this->lang->webhook->api . $this->lang->colon . $this->lang->webhook->list;
|
||||
$this->view->webhooks = $this->webhook->getList($orderBy, $pager);
|
||||
@@ -196,7 +196,7 @@ class webhook extends control
|
||||
/* Get selected depts. */
|
||||
if($this->get->selectedDepts)
|
||||
{
|
||||
setcookie('selectedDepts', $this->get->selectedDepts, 0, $this->config->webRoot, '', false, true);
|
||||
setcookie('selectedDepts', $this->get->selectedDepts, 0, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
$_COOKIE['selectedDepts'] = $this->get->selectedDepts;
|
||||
}
|
||||
$selectedDepts = $this->cookie->selectedDepts ? $this->cookie->selectedDepts : '';
|
||||
|
||||
Reference in New Issue
Block a user