diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 6298796383..611531ac57 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -825,7 +825,7 @@ class baseRouter session_start(); $this->sessionID = session_id(); - if(isset($_GET[$this->config->sessionVar]) and $this->sessionID != $_GET[$this->config->sessionVar]) helper::restartSession($_GET[$this->config->sessionVar]); + if(isset($_GET[$this->config->sessionVar])) helper::restartSession($_GET[$this->config->sessionVar]); define('SESSION_STARTED', true); } diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index 1422d76ecb..6e4cdee8fd 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -66,12 +66,21 @@ class xuanxuanChat extends chatModel $entries = array(); $baseURL = commonModel::getSysURL(); + $this->loadModel('user'); + $user = $this->dao->select('*')->from(TABLE_USER)->where('id')->eq($userID)->fetch(); + $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; + $user->rights = $this->user->authorize($user->account); + $user->groups = $this->user->getGroups($user->account); + + $this->session->set('user', $user); + $this->app->user = $this->session->user; + $actions = new stdclass(); - $actions->createBug = array('title' => $this->lang->chat->createBug, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('bug', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - $actions->createDoc = array('title' => $this->lang->chat->createDoc, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('doc', 'create', 'lib=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - $actions->createStory = array('title' => $this->lang->chat->createStory, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('story', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - $actions->createTask = array('title' => $this->lang->chat->createTask, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('task', 'create', 'project=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); - $actions->createTodo = array('title' => $this->lang->chat->createTodo, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->chat->createBug, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('bug', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->chat->createDoc, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('doc', 'create', 'lib=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->chat->createStory, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('story', 'create', 'product=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->chat->createTask, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('task', 'create', 'project=1', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->chat->createTodo, 'url' => $baseURL . str_replace('/xuanxuan.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); $urls = array(); foreach($this->config->chat->cards as $moduleName => $methods) @@ -103,6 +112,7 @@ class xuanxuanChat extends chatModel $data->data['entryUrl'] = trim($baseURL . $this->config->webRoot, '/'); $entries[] = $data; + unset($_SESSION['user']); return $entries; } } diff --git a/xuanxuan/module/entry/ext/control/visit.php b/xuanxuan/module/entry/ext/control/visit.php index 457d124e38..16be2d2127 100644 --- a/xuanxuan/module/entry/ext/control/visit.php +++ b/xuanxuan/module/entry/ext/control/visit.php @@ -14,7 +14,7 @@ class entry extends control if(RUN_MODE != 'xuanxuan') die(); $referer = !empty($_GET['referer']) ? $this->get->referer : $referer; - if(empty($referer)) $referer = common::getSysURL() . str_replace('/xuanxuan.php', '/index.php', $this->createLink('index', 'index', '', 'xhtml')); + if(empty($referer)) $referer = common::getSysURL() . str_replace('/xuanxuan.php', '/index.php', $this->createLink('my', 'index', '', 'html')); $output = new stdclass(); $output->module = $this->moduleName;