* adjust the ztcli.

This commit is contained in:
wangchunsheng
2013-01-23 02:50:40 +00:00
parent 068f5cba9c
commit db6eda8670
2 changed files with 8 additions and 3 deletions

View File

@@ -28,23 +28,28 @@ include './framework/control.class.php';
include './framework/model.class.php';
include './framework/helper.class.php';
include './config/config.php';
/* Set the PATH_INFO variable. */
if($config->requestType == 'PATH_INFO')
{
$path = pathinfo($request['path']);
/* url like http://pms.zentao.net/zentao/my-todo.html, PATH_INFO is 'my-todo.html'. */
if(strpos($path['basename'], $config->requestFix))
{
$_SERVER['PATH_INFO'] = $path['basename'];
}
else
{
/* url like http://pms.zentao.net/zentao/my/, PATH_INFO is 'my'. */
if(is_dir('./module/' . $path['basename']))
{
$_SERVER['PATH_INFO'] = $path['basename'];
}
/* url like http://pms.zentao.net/zentao/, PATH_INFO is '/'. */
else
{
$_SERVER['PATH_INFO'] = '';
$_SERVER['PATH_INFO'] = '/';
}
}
}

View File

@@ -80,7 +80,7 @@ class commonModel extends model
{
$this->app->user = $this->session->user;
}
elseif($this->app->company->guest)
elseif($this->app->company->guest or defined('IN_SHELL'))
{
$user = new stdClass();
$user->id = 0;