* Delete some file which move to xuanxuan.

This commit is contained in:
Yagami
2019-01-17 10:30:18 +08:00
parent 8beb1b1459
commit 608257fdb0
10 changed files with 24 additions and 289 deletions
@@ -6,12 +6,12 @@ class admin extends control
if(in_array($type, array('config', 'package')))
{
$this->loadModel('chat');
$server = $this->chat->getServer();
$server = $this->chat->getServer('zentao');
if(strpos($server, '127.0.0.1') !== false) die(js::alert($this->lang->chat->xxdServerError));
$setting = $this->config->xuanxuan;
$setting->os = $os;
$this->chat->downloadXXD($setting, $type);
$this->chat->downloadXXD('zentao', $setting, $type);
}
die("Params error.");
}
@@ -43,7 +43,7 @@ class admin extends control
$this->view->adminList = $this->loadModel('user')->getPairs('admin');
$this->view->os = $os . '_' . php_uname('m');
$this->view->type = $type;
$this->view->domain = $this->loadModel('chat')->getServer();
$this->view->domain = $this->loadModel('chat')->getServer('zentao');
$this->view->turnon = isset($this->config->xuanxuan->turnon) ? $this->config->xuanxuan->turnon : 1;
$this->view->isHttps = $this->config->xuanxuan->isHttps ? $this->config->xuanxuan->isHttps : 0;
$this->display();
+11 -62
View File
@@ -1,72 +1,21 @@
<?php
$lang->chat->common = 'Xuanxuan';
$lang->chat->turnon = 'On';
$lang->chat->downloadXXD = 'Download XXD';
$lang->chat->help = 'Help';
$lang->chat->settings = 'Settings';
$lang->chat->turnonList = array();
$lang->chat->turnonList[1] = 'On';
$lang->chat->turnonList[0] = 'Off';
$lang->chat->status = 'Status';
$lang->chat->common = 'Xuanxuan';
$lang->chat->turnon = 'On';
$lang->chat->help = 'Help';
$lang->chat->settings = 'Settings';
$lang->chat->xxdServer = 'Zentao Server';
$lang->chat->downloadXXD = 'Download XXD';
$lang->chat->listenIP = 'Listen IP';
$lang->chat->chatPort = 'Chat Port';
$lang->chat->uploadFileSize = 'File Size';
$lang->chat->downloadPackage = 'Full Package';
$lang->chat->downloadConfig = 'Only Config';
$lang->chat->zentaoIntegrate = 'Zentao Integrated';
$lang->chat->changeSetting = 'Change Setting';
$lang->chat->zentaoClient = 'ZenTao Client is added!';
$lang->chat->createBug = 'Create Bug';
$lang->chat->createDoc = 'Create Doc';
$lang->chat->createStory = 'Create Story';
$lang->chat->createTask = 'Create Task';
$lang->chat->createTodo = 'Create Todo';
$lang->chat->turnonList = array();
$lang->chat->turnonList[1] = 'Enable';
$lang->chat->turnonList[0] = 'Disable';
$lang->chat->statusList[1] = 'Enable';
$lang->chat->statusList[0] = 'Disable';
$lang->chat->info = "ZenTao client is powered by <a href='https://xuan.im/' target='_blank'>Xuan</a>, a secure and open source Instant Messenger by Nature Easy Soft. It is a self-hosted and cross-platform tool with numerous plug-ins and robust features. In Xuan, you can code your own plug-ins. Click <a href='https://xuan.im/' target='_blank'>HERE</a> for more.";
$lang->chat->xxClientConfirm = 'Click the lower right icon to download new zentao client!';
$lang->chat->xxServerConfirm = 'Go to Admin-Integrate-Xuanxuan download new zentao client server!';
$lang->chat->xxdServerTip = 'XXD server address contains protocol and host and portsuch as http://192.168.1.35 or http://pms.zentao.com. that can not be 127.0.0.1.';
$lang->chat->xxdServerEmpty = 'XXD server address is empty.';
$lang->chat->xxdServerError = 'XXD server address can not be 127.0.0.1.';
$lang->chat->xxdSchemeError = 'Server address should started with http:// or https://.';
$lang->chat->xxdPortError = 'Server address should contain valid port and the default is <strong>11443</strong>.';
$lang->chat->zentaoClient = 'ZenTao Client is added';
$lang->chat->xxClientConfirm = 'Click to download new zentao client!';
$lang->chat->xxServerConfirm = 'Click to download new zentao client server!';
$lang->chat->info = "ZenTao client is powered by <a href='https://xuan.im/' target='_blank'>Xuan</a>, a secure and open source Instant Messenger by Nature Easy Soft. It is a self-hosted and cross-platform tool with numerous plug-ins and robust features. In Xuan, you can code your own plug-ins. Click <a href='https://xuan.im/' target='_blank'>HERE</a> for more.";
$lang->chat->xxd = new stdclass();
$lang->chat->xxd->os = 'OS';
$lang->chat->xxd->ip = 'Listen IP';
$lang->chat->xxd->chatPort = 'Chat Port';
$lang->chat->xxd->commonPort = 'Common Port';
$lang->chat->xxd->isHttps = 'Ishttps';
$lang->chat->xxd->uploadFileSize = 'File Size';
$lang->chat->xxd->maxOnlineUser = 'Max. Online';
$lang->chat->xxd->sslcrt = 'SSL Crt';
$lang->chat->xxd->sslkey = 'SSL Key';
$lang->chat->xxd->max = 'Max.';
$lang->chat->httpsOptions[1] = 'On';
$lang->chat->httpsOptions[0] = 'Off';
$lang->chat->placeholder = new stdclass();
$lang->chat->placeholder->xxd = new stdclass();
$lang->chat->placeholder->xxd->ip = 'Listen the IP of the server. Enter 0.0.0.0 if it is not set.';
$lang->chat->placeholder->xxd->chatPort = 'Port for communications with the client.';
$lang->chat->placeholder->xxd->commonPort = 'Common port for client user login authentication and file upload/download.';
$lang->chat->placeholder->xxd->isHttps = 'Use HTTPS';
$lang->chat->placeholder->xxd->uploadFileSize = 'File size for the uploaded.';
$lang->chat->placeholder->xxd->maxOnlineUser = 'Maximum number of users online.';
$lang->chat->placeholder->xxd->sslcrt = 'Copy and paste certificate here.';
$lang->chat->placeholder->xxd->sslkey = 'Copy and paste key here.';
$lang->chat->osList['win_i386'] = 'Windows 32-bit';
$lang->chat->osList['win_x86_64'] = 'Windows 64-bit';
$lang->chat->osList['linux_i386'] = 'Linux 32-bit';
$lang->chat->osList['linux_x86_64'] = 'Linux 64-bit';
$lang->chat->osList['darwin_x86_64'] = 'macOS';
@@ -3,69 +3,19 @@ $lang->chat->common = '客户端';
$lang->chat->turnon = '是否打开';
$lang->chat->help = '使用说明';
$lang->chat->settings = '服务器设置';
$lang->chat->xxdServer = '禅道服务器';
$lang->chat->downloadXXD = '下载喧喧服务端';
$lang->chat->zentaoIntegrate = '禅道集成';
$lang->chat->zentaoClient = '新增禅道客户端!';
$lang->chat->turnonList = array();
$lang->chat->turnonList[1] = '是';
$lang->chat->turnonList[0] = '否';
$lang->chat->status = '状态';
$lang->chat->xxdServer = '禅道服务器';
$lang->chat->downloadXXD = '下载喧喧服务端';
$lang->chat->listenIP = '监听IP';
$lang->chat->chatPort = '客户端通讯端口';
$lang->chat->uploadFileSize = '上传文件大小';
$lang->chat->downloadPackage = '下载完整包';
$lang->chat->downloadConfig = '只下载配置文件';
$lang->chat->zentaoIntegrate = '禅道集成';
$lang->chat->changeSetting = '修改配置';
$lang->chat->createBug = '创建 Bug';
$lang->chat->createDoc = '创建文档';
$lang->chat->createStory = '创建需求';
$lang->chat->createTask = '创建任务';
$lang->chat->createTodo = '创建待办';
$lang->chat->statusList[1] = '启用';
$lang->chat->statusList[0] = '不启用';
$lang->chat->info = "禅道客户端由易软天创旗下另外一款免费、开源、安全的IM产品<a href='https://xuan.im/' target='_blank'>喧喧</a>驱动,支持私有部署,跨平台操作,内置大量插件,功能丰富,在喧喧里,您甚至还可以为自己编写个性化的插件,<a href='https://xuan.im/' target='_blank'>点击查看</a>。";
$lang->chat->xxClientConfirm = '禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!点击界面右下角下载禅道客户端。';
$lang->chat->xxServerConfirm = '与禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!进入后台-集成-客户端集成进行下载配置。';
$lang->chat->xxdServerTip = '禅道服务器地址为完整的协议+地址+端口,示例:http://192.168.1.35 或 http://pms.zentao.com ,不能使用127.0.0.1。';
$lang->chat->xxdServerEmpty = '禅道服务器地址为空。';
$lang->chat->xxdServerError = '禅道服务器地址不能为 127.0.0.1。';
$lang->chat->xxdSchemeError = '服务器地址应该以<strong>http://</strong>或<strong>https://</strong>开头。';
$lang->chat->xxdPortError = '服务器地址应该包含有效的端口号,默认为<strong>11443</strong>。';
$lang->chat->zentaoClient = '新增禅道客户端!';
$lang->chat->xxClientConfirm = '与禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!点击界面右下角下载禅道客户端。';
$lang->chat->xxServerConfirm = '与禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!进入后台-集成-客户端集成进行下载配置。';
$lang->chat->info = "禅道客户端由易软天创旗下另外一款免费、开源、安全的IM产品<a href='https://xuan.im/' target='_blank'>喧喧</a>驱动,支持私有部署,跨平台操作,内置大量插件,功能丰富,在喧喧里,您甚至还可以为自己编写个性化的插件,<a href='https://xuan.im/' target='_blank'>点击查看</a>。";
$lang->chat->xxd = new stdclass();
$lang->chat->xxd->os = '操作系统';
$lang->chat->xxd->ip = '监听IP';
$lang->chat->xxd->chatPort = '客户端通讯端口';
$lang->chat->xxd->commonPort = '通用端口';
$lang->chat->xxd->isHttps = '启用https';
$lang->chat->xxd->uploadFileSize = '上传文件大小';
$lang->chat->xxd->maxOnlineUser = '最大在线人数';
$lang->chat->xxd->sslcrt = '证书内容';
$lang->chat->xxd->sslkey = '证书私钥';
$lang->chat->xxd->max = '最大';
$lang->chat->httpsOptions[1] = '启用';
$lang->chat->httpsOptions[0] = '不启用';
$lang->chat->placeholder = new stdclass();
$lang->chat->placeholder->xxd = new stdclass();
$lang->chat->placeholder->xxd->ip = '监听的服务器ip地址,没有特殊需要直接填写0.0.0.0';
$lang->chat->placeholder->xxd->chatPort = '与聊天客户端通讯的端口';
$lang->chat->placeholder->xxd->commonPort = '通用端口,该端口用于客户端登录时验证,以及文件上传下载使用';
$lang->chat->placeholder->xxd->isHttps = '启用https';
$lang->chat->placeholder->xxd->uploadFileSize = '上传文件的大小';
$lang->chat->placeholder->xxd->maxOnlineUser = '最大在线人数';
$lang->chat->placeholder->xxd->sslcrt = '请将证书内容复制到此处';
$lang->chat->placeholder->xxd->sslkey = '请将证书密钥复制到此处';
$lang->chat->osList['win_i386'] = 'Windows 32位';
$lang->chat->osList['win_x86_64'] = 'Windows 64位';
$lang->chat->osList['linux_i386'] = 'Linux 32位';
$lang->chat->osList['linux_x86_64'] = 'Linux 64位';
$lang->chat->osList['darwin_x86_64'] = 'macOS';
@@ -1,2 +0,0 @@
<?php
$lang->chat->common = '喧喧';
@@ -1,72 +1,10 @@
<?php
class xuanxuanChat extends chatModel
{
public function downloadXXD($setting, $type)
{
$data = new stdClass();
$data->uploadFileSize = $setting->uploadFileSize;
$data->isHttps = $setting->isHttps;
$data->sslcrt = $setting->sslcrt;
$data->sslkey = $setting->sslkey;
$data->ip = $setting->ip;
$data->chatPort = $setting->chatPort;
$data->commonPort = $setting->commonPort;
$data->maxOnlineUser = isset($setting->maxOnlineUser) ? $setting->maxOnlineUser : 0;
$data->key = $this->config->xuanxuan->key;
$data->os = $setting->os;
$data->version = $this->config->xuanxuan->version;
$data->downloadType = $type;
$server = $this->getServer();
$data->server = $server;
$data->host = trim($server, '/') . getWebRoot();
$url = "https://www.chanzhi.org/license-downloadxxd-zentao.html";
$result = common::http($url, $data);
if($type == 'config')
{
$this->sendDownHeader('xxd.conf', 'conf', $result, strlen($result));
}
else
{
header("Location: $result");
}
$this->loadModel('setting')->setItem('system.common.xxserver.installed', 1);
exit;
}
public function sendDownHeader($fileName, $fileType, $content, $fileSize = 0)
{
/* Set the downloading cookie, thus the export form page can use it to judge whether to close the window or not. */
setcookie('downloading', 1, 0, '', '', false, true);
/* Append the extension name auto. */
$extension = '.' . $fileType;
if(strpos($fileName, $extension) === false) $fileName .= $extension;
/* urlencode the fileName for ie. */
$isIE11 = (strpos($this->server->http_user_agent, 'Trident') !== false and strpos($this->server->http_user_agent, 'rv:11.0') !== false);
if(strpos($this->server->http_user_agent, 'MSIE') !== false or $isIE11) $fileName = urlencode($fileName);
/* Judge the content type. */
$mimes = $this->config->chat->mimes;
$contentType = isset($mimes[$fileType]) ? $mimes[$fileType] : $mimes['default'];
if(empty($fileSize) and $content) $fileSize = strlen($content);
header("Content-type: $contentType");
header("Content-Disposition: attachment; filename=\"$fileName\"");
header("Content-length: {$fileSize}");
header("Pragma: no-cache");
header("Expires: 0");
die($content);
}
public function getExtensionList($userID)
{
$entries = array();
$baseURL = $this->getServer();
$baseURL = $this->getServer('zentao');
$this->loadModel('user');
$user = $this->dao->select('*')->from(TABLE_USER)->where('id')->eq($userID)->fetch();
@@ -127,13 +65,4 @@ class xuanxuanChat extends chatModel
unset($_SESSION['user']);
return $entries;
}
public function getServer()
{
$this->app->loadConfig('mail');
$server = empty($this->config->mail->domain) ? commonModel::getSysURL() : $this->config->mail->domain;
if(!empty($this->config->xuanxuan->server)) $server = $this->config->xuanxuan->server;
return $server;
}
}
@@ -1,20 +1,5 @@
<?php
public function downloadXXD($setting, $type)
{
return $this->loadExtension('xuanxuan')->downloadXXD($setting, $type);
}
public function getExtensionList($userID)
{
return $this->loadExtension('xuanxuan')->getExtensionList($userID);
}
public function sendDownHeader($fileName, $fileType, $content, $fileSize = 0)
{
return $this->loadExtension('xuanxuan')->sendDownHeader($fileName, $fileType, $content, $fileSize);
}
public function getServer()
{
return $this->loadExtension('xuanxuan')->getServer();
}
@@ -1,76 +0,0 @@
<?php
/**
* The downloadxxd view file of chat module of Zentao.
*
* @copyright Copyright 2009-2010 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv11.html)
* @author Xiying Guan <guanxiying@xirangit.com>
* @package chart
* @version $Id$
* @link http://www.zentao.net
*/
?>
<form id='jaxForm' class='form-horizontal' action='<?php echo inlink('downloadxxd')?>' method='post' target='_blank'>
<table class='table table-form'>
<tr>
<th class='w-110px'><?php echo $lang->chat->xxd->os;?></th>
<td><?php echo html::select('os', $lang->chat->osList, zget($this->config->xxd, 'os', 'linux64'), "class='form-control chosen'");?></td>
</tr>
<tr>
<th class='w-110px'><?php echo $lang->chat->xxd->ip;?></th>
<td><?php echo html::input('ip', zget($this->config->xxd, 'ip', '0.0.0.0'), "class='form-control' placeholder='{$lang->chat->placeholder->xxd->ip}'");?></td>
</tr>
<tr>
<th><?php echo $lang->chat->xxd->chatPort;?></th>
<td><?php echo html::input('chatPort', zget($this->config->xxd, 'chatPort', 11444), "placeholder='{$lang->chat->placeholder->xxd->chatPort}' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->chat->xxd->commonPort;?></th>
<td><?php echo html::input('commonPort', zget($this->config->xxd, 'commonPort', 11443), "placeholder='{$lang->chat->placeholder->xxd->commonPort}' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->chat->xxd->isHttps;?></th>
<td><?php echo html::radio('isHttps', $lang->chat->httpsOptions, zget($this->config->xxd, 'isHttps', '1'), "class='checkbox'");?></td>
</tr>
<tr class='sslTR'>
<th><?php echo $lang->chat->xxd->sslcrt;?></th>
<td><?php echo html::textarea('sslcrt', zget($this->config->xxd, 'sslcrt', ''), "placeholder='{$lang->chat->placeholder->xxd->sslcrt}' class='form-control'");?></td>
</tr>
<tr class='sslTR'>
<th><?php echo $lang->chat->xxd->sslkey;?></th>
<td><?php echo html::textarea('sslkey', zget($this->config->xxd, 'sslkey', ''), "placeholder='{$lang->chat->placeholder->xxd->sslkey}' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->chat->xxd->uploadFileSize;?></th>
<td>
<div class='input-group'>
<?php echo html::input('uploadFileSize', zget($this->config->xxd, 'uploadFileSize', 20), "class='form-control' placeholder='{$lang->chat->placeholder->xxd->chatPort}' ");?>
<span class='input-group-addon'>M</span>
</div>
</td>
</tr>
<tr>
<th></th>
<td>
<?php echo html::a('javascript:;', $lang->chat->downloadConfig, '', "class='btn btn-primary btn-download' data-type='config'");?>
<?php echo html::a('javascript:;', $lang->chat->downloadPackage, '', "class='btn btn-primary btn-download' data-type='package'");?>
<?php echo html::hidden('downloadType', "config");?>
<?php echo html::submitButton('', '', "hide");?>
</td>
</tr>
</table>
</form>
<script>
$(function()
{
$('input[name^=isHttps]').change(function()
{
$('.sslTR').toggle();
})
$('.btn-download').click(function()
{
$('#downloadType').val($(this).data('type'));
$(this).parent().find('#submit').click();
});
})
</script>
+1 -1
View File
@@ -14,7 +14,7 @@ class entry extends control
if(RUN_MODE != 'xuanxuan') die();
$referer = !empty($_GET['referer']) ? $this->get->referer : $referer;
$server = $this->loadModel('chat')->getServer();
$server = $this->loadModel('chat')->getServer('zentao');
if(empty($referer)) $referer = $server . str_replace('/xuanxuan.php', '/index.php', $this->createLink('my', 'index', '', 'html'));
$output = new stdclass();
@@ -16,7 +16,7 @@ class xuanxuanMessage extends messageModel
$title = $this->app->user->realname . $this->lang->action->label->$actionType . $this->lang->action->objectTypes[$objectType];
$text = $title . ' ' . "[#{$objectID}::{$object->$field}]";
$server = $this->loadModel('chat')->getServer();
$server = $this->loadModel('chat')->getServer('zentao');
$onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : '';
unset($_GET['onlybody']);
$url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html');