From 608257fdb0f36dfbed3a38df8ae054017b89fb30 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 17 Jan 2019 10:30:18 +0800 Subject: [PATCH] * Delete some file which move to xuanxuan. --- .../module/admin/ext/control/downloadxxd.php | 4 +- .../module/admin/ext/control/xuanxuan.php | 2 +- xuanxuan/module/chat/ext/lang/en/xuanxuan.php | 73 +++--------------- .../module/chat/ext/lang/zh-cn/xuanxuan.php | 64 ++-------------- .../module/chat/ext/lang/zh-tw/xuanxuan.php | 2 - .../chat/ext/model/class/xuanxuan.class.php | 73 +----------------- xuanxuan/module/chat/ext/model/xuanxuan.php | 15 ---- .../module/chat/ext/view/downloadxxd.html.php | 76 ------------------- xuanxuan/module/entry/ext/control/visit.php | 2 +- .../ext/model/class/xuanxuan.class.php | 2 +- 10 files changed, 24 insertions(+), 289 deletions(-) delete mode 100644 xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php delete mode 100644 xuanxuan/module/chat/ext/view/downloadxxd.html.php diff --git a/xuanxuan/module/admin/ext/control/downloadxxd.php b/xuanxuan/module/admin/ext/control/downloadxxd.php index 4a7ee6c908..c3c605ce4e 100644 --- a/xuanxuan/module/admin/ext/control/downloadxxd.php +++ b/xuanxuan/module/admin/ext/control/downloadxxd.php @@ -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."); } diff --git a/xuanxuan/module/admin/ext/control/xuanxuan.php b/xuanxuan/module/admin/ext/control/xuanxuan.php index fade5a15ff..c342ef46c0 100644 --- a/xuanxuan/module/admin/ext/control/xuanxuan.php +++ b/xuanxuan/module/admin/ext/control/xuanxuan.php @@ -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(); diff --git a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php index e4675a6808..a58182e5a0 100644 --- a/xuanxuan/module/chat/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/en/xuanxuan.php @@ -1,72 +1,21 @@ 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 Xuan, 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 HERE 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 port,such 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 11443.'; -$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 Xuan, 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 HERE 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'; diff --git a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php index a7f2ade892..07d368f73d 100644 --- a/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/chat/ext/lang/zh-cn/xuanxuan.php @@ -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产品喧喧驱动,支持私有部署,跨平台操作,内置大量插件,功能丰富,在喧喧里,您甚至还可以为自己编写个性化的插件,点击查看。"; +$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 = '服务器地址应该以http://https://开头。'; -$lang->chat->xxdPortError = '服务器地址应该包含有效的端口号,默认为11443。'; -$lang->chat->zentaoClient = '新增禅道客户端!'; -$lang->chat->xxClientConfirm = '与禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!点击界面右下角下载禅道客户端。'; -$lang->chat->xxServerConfirm = '与禅道深度集成,支持成员沟通,小组讨论,文件传输,任务指派,更加方便的项目管理,更加流畅的团队协作!进入后台-集成-客户端集成进行下载配置。'; -$lang->chat->info = "禅道客户端由易软天创旗下另外一款免费、开源、安全的IM产品喧喧驱动,支持私有部署,跨平台操作,内置大量插件,功能丰富,在喧喧里,您甚至还可以为自己编写个性化的插件,点击查看。"; - -$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'; diff --git a/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php b/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php deleted file mode 100644 index 182a73f176..0000000000 --- a/xuanxuan/module/chat/ext/lang/zh-tw/xuanxuan.php +++ /dev/null @@ -1,2 +0,0 @@ -chat->common = '喧喧'; diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index f2b66442d3..04d2de620b 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -1,72 +1,10 @@ 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; - } } diff --git a/xuanxuan/module/chat/ext/model/xuanxuan.php b/xuanxuan/module/chat/ext/model/xuanxuan.php index 25a659fbb1..dd3683e8b5 100644 --- a/xuanxuan/module/chat/ext/model/xuanxuan.php +++ b/xuanxuan/module/chat/ext/model/xuanxuan.php @@ -1,20 +1,5 @@ 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(); -} diff --git a/xuanxuan/module/chat/ext/view/downloadxxd.html.php b/xuanxuan/module/chat/ext/view/downloadxxd.html.php deleted file mode 100644 index 4a7d5d1b29..0000000000 --- a/xuanxuan/module/chat/ext/view/downloadxxd.html.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @package chart - * @version $Id$ - * @link http://www.zentao.net - */ -?> -
' method='post' target='_blank'> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
chat->xxd->os;?>chat->osList, zget($this->config->xxd, 'os', 'linux64'), "class='form-control chosen'");?>
chat->xxd->ip;?>config->xxd, 'ip', '0.0.0.0'), "class='form-control' placeholder='{$lang->chat->placeholder->xxd->ip}'");?>
chat->xxd->chatPort;?>config->xxd, 'chatPort', 11444), "placeholder='{$lang->chat->placeholder->xxd->chatPort}' class='form-control'");?>
chat->xxd->commonPort;?>config->xxd, 'commonPort', 11443), "placeholder='{$lang->chat->placeholder->xxd->commonPort}' class='form-control'");?>
chat->xxd->isHttps;?>chat->httpsOptions, zget($this->config->xxd, 'isHttps', '1'), "class='checkbox'");?>
chat->xxd->sslcrt;?>config->xxd, 'sslcrt', ''), "placeholder='{$lang->chat->placeholder->xxd->sslcrt}' class='form-control'");?>
chat->xxd->sslkey;?>config->xxd, 'sslkey', ''), "placeholder='{$lang->chat->placeholder->xxd->sslkey}' class='form-control'");?>
chat->xxd->uploadFileSize;?> -
- config->xxd, 'uploadFileSize', 20), "class='form-control' placeholder='{$lang->chat->placeholder->xxd->chatPort}' ");?> - M -
-
- chat->downloadConfig, '', "class='btn btn-primary btn-download' data-type='config'");?> - chat->downloadPackage, '', "class='btn btn-primary btn-download' data-type='package'");?> - - -
-
- diff --git a/xuanxuan/module/entry/ext/control/visit.php b/xuanxuan/module/entry/ext/control/visit.php index 15f93f9145..608bf4e307 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; - $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(); diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php index acf0b7aeef..298029e3bc 100644 --- a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -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');