* finish task #2871.

This commit is contained in:
wangyidong
2017-01-11 14:55:27 +08:00
parent 311bb335c4
commit 4f4dfe068c
3 changed files with 19 additions and 1 deletions
+2
View File
@@ -445,6 +445,8 @@ class bug extends control
if($bug->project and !$this->loadModel('project')->checkPriv($this->project->getByID($bug->project)))
{
echo(js::alert($this->lang->project->accessDenied));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index')));
die(js::locate('back'));
}
+13 -1
View File
@@ -28,6 +28,8 @@ class productModel extends model
if($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID)))
{
echo(js::alert($this->lang->product->accessDenied));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index')));
die(js::locate('back'));
}
@@ -95,7 +97,17 @@ class productModel extends model
if($productID > 0) $this->session->set('product', (int)$productID);
if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct);
if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products));
if(!isset($products[$this->session->product])) $this->session->set('product', key($products));
if(!isset($products[$this->session->product]))
{
$this->session->set('product', key($products));
if($productID > 0)
{
echo(js::alert($this->lang->product->accessDenied));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index')));
die(js::locate('back'));
}
}
if($this->cookie->preProductID != $productID)
{
$this->cookie->set('preBranch', 0);
+4
View File
@@ -86,6 +86,8 @@ class projectModel extends model
if($projects and !isset($projects[$projectID]) and !$this->checkPriv($project))
{
echo(js::alert($this->lang->project->accessDenied));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index')));
die(js::locate('back'));
}
@@ -204,6 +206,8 @@ class projectModel extends model
if($projectID > 0)
{
echo(js::alert($this->lang->project->accessDenied));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index')));
die(js::locate('back'));
}
}