From b9036ad829ffe3b29059204ff36e1ad529185140 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Fri, 28 Oct 2022 15:04:37 +0800 Subject: [PATCH 1/4] update Chinese translation --- plugins/kolab/langs/zh-CN.json | 2 +- plugins/nextcloud/langs/zh-CN.ini | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 plugins/nextcloud/langs/zh-CN.ini diff --git a/plugins/kolab/langs/zh-CN.json b/plugins/kolab/langs/zh-CN.json index 39fe71e65..25cbc5656 100644 --- a/plugins/kolab/langs/zh-CN.json +++ b/plugins/kolab/langs/zh-CN.json @@ -1,5 +1,5 @@ { "KOLAB": { - "CONTACTS_FOLDER": "Contacts Folder" + "CONTACTS_FOLDER": "联系人文件夹" } } diff --git a/plugins/nextcloud/langs/zh-CN.ini b/plugins/nextcloud/langs/zh-CN.ini new file mode 100644 index 000000000..de916b306 --- /dev/null +++ b/plugins/nextcloud/langs/zh-CN.ini @@ -0,0 +1,8 @@ +[NEXTCLOUD] +SAVE_ATTACHMENTS = "保存到 Nextcloud" +SAVE_EML = "以 .eml 文件保存到 Nextcloud" +SAVE_ICS = "添加到日历" +SELECT_FOLDER = "选择文件夹" +SELECT_FILES = "选择文件" +ATTACH_FILES = "添加 Nextcloud 文件" +SELECT_CALENDAR = "选择日历" From f05dcb69653d41c5e7ade0f279dffa95ec4cef01 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Fri, 28 Oct 2022 19:47:29 +0800 Subject: [PATCH 2/4] urldecode the file/folder name in webdav response --- plugins/nextcloud/js/webdav.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index 682465f1d..9cdd22583 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -73,8 +73,8 @@ const const e = responseList.item(i), elem = { - name: getDavElementByTagName(e, 'href').textContent - .replace(pathRegex, '').replace(/\/$/, ''), + name: decodeURIComponent(getDavElementByTagName(e, 'href').textContent + .replace(pathRegex, '').replace(/\/$/, '')), isFile: false }; if (getDavElementsByTagName(getDavElementByTagName(e, 'resourcetype'), 'collection').length) { From 8406bd4c9fbc4fa5d72557386c5a1c3431d2c033 Mon Sep 17 00:00:00 2001 From: the-djmaze <3752035+the-djmaze@users.noreply.github.com> Date: Fri, 28 Oct 2022 19:10:17 +0200 Subject: [PATCH 3/4] Update Http.php Cleanup a bit --- snappymail/v/0.0.0/app/libraries/MailSo/Base/Http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Base/Http.php b/snappymail/v/0.0.0/app/libraries/MailSo/Base/Http.php index 1e5973b40..16ee13cfe 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Base/Http.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Base/Http.php @@ -129,7 +129,7 @@ class Http public function GetHost(bool $bWithRemoteUserData = false, bool $bWithoutWWW = true, bool $bWithoutPort = false) : string { $sHost = $this->GetServer('HTTP_HOST', ''); - if (0 === \strlen($sHost)) + if (!\strlen($sHost)) { $sName = $this->GetServer('SERVER_NAME'); $iPort = (int) $this->GetServer('SERVER_PORT', 80); @@ -150,7 +150,7 @@ class Http if ($bWithoutPort) { - $sHost = \preg_replace('/:[\d]+$/', '', $sHost); + $sHost = \preg_replace('/:\d+$/', '', $sHost); } return $sHost; From cd0f71bdcecad0e0c51f12fd35ff646aff93df43 Mon Sep 17 00:00:00 2001 From: the-djmaze <3752035+the-djmaze@users.noreply.github.com> Date: Fri, 28 Oct 2022 19:22:58 +0200 Subject: [PATCH 4/4] Update UserAuth.php Cleanup a bit through smartphone --- .../libraries/RainLoop/Actions/UserAuth.php | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 82e811ac3..7948bdc0a 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -35,18 +35,18 @@ trait UserAuth if (!\str_contains($sEmail, '@')) { $this->Logger()->Write('The email address "' . $sEmail . '" is not complete', \LOG_INFO, 'LOGIN'); + $bAdded = false; + if ($this->Config()->Get('login', 'determine_user_domain', false)) { $sUserHost = \trim($this->Http()->GetHost(false, true, true)); $this->Logger()->Write('Determined user domain: ' . $sUserHost, \LOG_INFO, 'LOGIN'); - $bAdded = false; - - $iLimit = 14; $aDomainParts = \explode('.', $sUserHost); + $iLimit = \min(\count($aDomainParts), 14); $oDomainProvider = $this->DomainProvider(); - while (\count($aDomainParts) && 0 < $iLimit) { - $sLine = \trim(\implode('.', $aDomainParts), '. '); + while (0 < $iLimit--) { + $sLine = \implode('.', $aDomainParts); $oDomain = $oDomainProvider->Load($sLine, false); if ($oDomain) { @@ -61,20 +61,18 @@ trait UserAuth } \array_shift($aDomainParts); - $iLimit--; } if (!$bAdded) { - $sLine = $sUserHost; - $oDomain = $oDomainProvider->Load($sLine, true); - if ($oDomain && $oDomain) { + $oDomain = $oDomainProvider->Load($sUserHost, true); + if ($oDomain) { $bAdded = true; - $this->Logger()->Write('Check "' . $sLine . '" with wildcard: OK (' . $sEmail . ' > ' . $sEmail . '@' . $sLine . ')', + $this->Logger()->Write('Check "' . $sUserHost . '" with wildcard: OK (' . $sEmail . ' > ' . $sEmail . '@' . $sUserHost . ')', \LOG_INFO, 'LOGIN'); - $sEmail .= '@' . $sLine; + $sEmail .= '@' . $sUserHost; } else { - $this->Logger()->Write('Check "' . $sLine . '" with wildcard: NO', \LOG_INFO, 'LOGIN'); + $this->Logger()->Write('Check "' . $sUserHost . '" with wildcard: NO', \LOG_INFO, 'LOGIN'); } } @@ -83,7 +81,7 @@ trait UserAuth } } - if (!\str_contains($sEmail, '@')) { + if (!$bAdded) { $sDefDomain = \trim($this->Config()->Get('login', 'default_domain', '')); if (\strlen($sDefDomain)) { if ('HTTP_HOST' === $sDefDomain || 'SERVER_NAME' === $sDefDomain) {