* finish task #40304.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user