From cff19cb7be8258a6a905ea6c3326ce5e269fec61 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 23 Mar 2022 13:52:06 +0800 Subject: [PATCH 1/2] * disable web chat when xxd is offline, and prevent web client from guessing urls, task #50925, bug #18927. --- .../xuan/index/ext/view/index.xuanxuan.html.hook.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php index a10a4022be..deffb230b1 100644 --- a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php +++ b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php @@ -33,8 +33,8 @@ $(document).on('hideapp', function(e, app) loadModel('im'); - -if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon) +$xxdStatus = $this->im->getXxdStatus(); +if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon && $xxdStatus == 'online') { $xuanConfig = new stdclass(); $token = $this->im->userGetAuthToken($this->app->user->id, 'zentaoweb'); @@ -42,7 +42,7 @@ if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon) $backendUrl = $this->im->getServer('zentao'); $xuanConfig->clientUrl = $clientUrl; - $xuanConfig->server = parse_url($backendUrl, PHP_URL_HOST); + $xuanConfig->server = ($this->config->xuanxuan->https == 'on' ? 'https' : 'http') . '://' . parse_url($backendUrl, PHP_URL_HOST) . $this->config->xuanxuan->commonPort; $xuanConfig->account = $this->app->user->account; $xuanConfig->authKey = $token->token; $xuanConfig->debug = $this->config->debug; From 921037fda2540e91af156ea23c21f87934cba8d0 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 23 Mar 2022 13:54:46 +0800 Subject: [PATCH 2/2] * fix no colon before port. --- .../extension/xuan/index/ext/view/index.xuanxuan.html.hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php index deffb230b1..9fdc05f312 100644 --- a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php +++ b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php @@ -42,7 +42,7 @@ if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon && $backendUrl = $this->im->getServer('zentao'); $xuanConfig->clientUrl = $clientUrl; - $xuanConfig->server = ($this->config->xuanxuan->https == 'on' ? 'https' : 'http') . '://' . parse_url($backendUrl, PHP_URL_HOST) . $this->config->xuanxuan->commonPort; + $xuanConfig->server = ($this->config->xuanxuan->https == 'on' ? 'https' : 'http') . '://' . parse_url($backendUrl, PHP_URL_HOST) . ':' . $this->config->xuanxuan->commonPort; $xuanConfig->account = $this->app->user->account; $xuanConfig->authKey = $token->token; $xuanConfig->debug = $this->config->debug;