* change for xx sso zentao.

This commit is contained in:
wangyidong
2018-12-13 15:29:47 +08:00
parent 0e2e1f57ed
commit f214a07e3f
5 changed files with 111 additions and 11 deletions
+6
View File
@@ -0,0 +1,6 @@
<?php
$filter->default->get['display'] = 'code';
$filter->entry = new stdclass();
$filter->entry->visit = new stdclass();
$filter->entry->visit->get['referer'] = 'reg::any';
@@ -1,11 +0,0 @@
<?php
class chat extends control
{
public function extensions($userID = 0)
{
$this->output->result = 'success';
$this->output->data = array();
$this->output->users = array($userID);
die($this->app->encrypt($this->output));
}
}
@@ -22,4 +22,38 @@ class xuanxuanChat extends chatModel
$this->loadModel('setting')->setItem('system.common.xxserver.installed', 1);
exit;
}
public function getExtensionList($userID)
{
$entries = array();
$baseURL = commonModel::getSysURL();
$actions = new stdclass();
$actions->createBug = array('title' => "创建 Bug", 'url' => $baseURL . helper::createLink('bug', 'create', 'product=1', 'xhtml'), 'height' => "600px", 'width' => "800px");
$actions->createDoc = array('title' => "创建文档", 'url' => $baseURL . helper::createLink('doc', 'create', 'lib=1', 'xhtml'), 'height' => "600px", 'width' => "800px");
$actions->createStory = array('title' => "创建需求", 'url' => $baseURL . helper::createLink('story', 'create', 'product=1', 'xhtml'), 'height' => "600px", 'width' => "800px");
$actions->createTask = array('title' => "创建任务", 'url' => $baseURL . helper::createLink('task', 'create', 'project=1', 'xhtml'), 'height' => "600px", 'width' => "800px");
$actions->createTodo = array('title' => "创建待办", 'url' => $baseURL . helper::createLink('todo', 'create', '', 'xhtml'), 'height' => "600px", 'width' => "800px");
$urls['/bug-view-'] = array('height' => "700px", 'width' => "600px");
$urls['/task-view-'] = array('height' => "700px", 'width' => "600px");
$urls['/doc-view-'] = array('height' => "700px", 'width' => "600px");
$urls['/story-view-'] = array('height' => "700px", 'width' => "600px");
$urls['/todo-view-'] = array('height' => "700px", 'width' => "600px");
$data = new stdClass();
$data->entryID = 1;
$data->name = 'zentao-integrated';
$data->displayName = '禅道集成';
$data->webViewUrl = $baseURL;
$data->download = $baseURL . $this->config->webRoot . 'zentao-integrated.zip';
$data->md5 = '38915bcd63ca82a2a39c3536bf5ca3da';
$data->data['actions'] = $actions;
$data->data['urls'] = $urls;
$data->data['entryUrl'] = $baseURL;
$entries[] = $data;
return $entries;
}
}
@@ -3,3 +3,8 @@ public function downloadXXD($setting)
{
return $this->loadExtension('xuanxuan')->downloadXXD($setting);
}
public function getExtensionList($userID)
{
return $this->loadExtension('xuanxuan')->getExtensionList($userID);
}
@@ -0,0 +1,66 @@
<?php
class entry extends control
{
/**
* Visit entry.
*
* @param int $entryID
* @param string $referer
* @access public
* @return void
*/
public function visit($entryID = '', $referer = '')
{
if(RUN_MODE != 'xuanxuan') die();
$referer = !empty($_GET['referer']) ? $this->get->referer : $referer;
if(empty($referer)) $referer = $this->createLink('index');
$output = new stdclass();
$output->module = $this->moduleName;
$output->method = $this->methodName;
$output->result = 'success';
$output->users = array();
$query = '';
$query = $this->config->sessionVar . '=' . session_id();
$location = $referer;
$pathinfo = parse_url($location);
if(!empty($pathinfo['query']))
{
$location = rtrim($location, '&') . "&$query";
}
else
{
$location = rtrim($location, '?') . "?$query";
}
$location .= "&display=card";
$output->data = $location;
if($this->session->userID)
{
$output->users = array($this->session->userID);
$this->loadModel('user');
$user = $this->dao->select('*')->from(TABLE_USER)->where('id')->eq($this->session->userID)->fetch();
unset($user->password);
$this->user->cleanLocked($user->account);
$user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
$user->rights = $this->user->authorize($user->account);
$user->groups = $this->user->getGroups($user->account);
$user->view = $this->user->grantUserView($user->account, $user->rights['acls']);
$last = time();
$user->last = date(DT_DATETIME1, $last);
$user->lastTime = $user->last;
$user->ip = $this->session->clientIP->IP;
$this->session->set('user', $user);
$this->app->user = $this->session->user;
}
die($this->app->encrypt($output));
}
}