* finish task #40304.

This commit is contained in:
wangyidong
2021-07-16 13:28:46 +08:00
parent 92ea15541f
commit 143d8336b1
2 changed files with 10 additions and 2 deletions
+8 -1
View File
@@ -892,7 +892,14 @@ class baseControl
$data = (array) $data;
if(helper::isAjaxRequest() or $this->viewType == 'json')
{
print(json_encode($data));
/* Process for zh-cn in json. */
foreach($data as $key => $value)
{
if(!is_string($value)) continue;
$data[$key] = urlencode($value);
}
print(urldecode(json_encode($data)));
$response = helper::removeUTF8Bom(ob_get_clean());
if(defined('RUN_MODE') and RUN_MODE == 'api') return print($response);
+2 -1
View File
@@ -1739,7 +1739,8 @@ EOD;
{
/* Check program priv. */
$viewProjects = trim($this->app->user->view->projects, ',');
if($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false and !$this->app->user->admin) $this->loadModel('project')->accessDenied();
$accessDenied = ($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false);
if($accessDenied and !$this->app->user->admin) $this->loadModel('project')->accessDenied();
$this->resetProgramPriv($module, $method);
if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method, false);
}