From ef7f8bddb3f221887c4e5ce227ddc6c2e41dd373 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 14 Oct 2014 02:39:23 +0400 Subject: [PATCH] Small fixes --- dev/View/Popup/Domain.js | 87 +++++++++++-------- .../0.0.0/app/libraries/RainLoop/Actions.php | 2 - 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/dev/View/Popup/Domain.js b/dev/View/Popup/Domain.js index 1d9c1e578..f14c992e3 100644 --- a/dev/View/Popup/Domain.js +++ b/dev/View/Popup/Domain.js @@ -73,6 +73,8 @@ this.smtpAuth = ko.observable(true); this.whiteList = ko.observable(''); + this.enableSmartPorts = ko.observable(false); + this.headerText = ko.computed(function () { var sName = this.name(); return this.edit() ? 'Edit Domain "' + sName + '"' : @@ -157,48 +159,54 @@ }, this); this.imapSecure.subscribe(function (sValue) { - var iPort = Utils.pInt(this.imapPort()); - sValue = Utils.pString(sValue); - switch (sValue) + if (this.enableSmartPorts()) { - case '0': - if (993 === iPort) - { - this.imapPort('143'); - } - break; - case '1': - if (143 === iPort) - { - this.imapPort('993'); - } - break; + var iPort = Utils.pInt(this.imapPort()); + sValue = Utils.pString(sValue); + switch (sValue) + { + case '0': + if (993 === iPort) + { + this.imapPort('143'); + } + break; + case '1': + if (143 === iPort) + { + this.imapPort('993'); + } + break; + } } }, this); this.smtpSecure.subscribe(function (sValue) { - var iPort = Utils.pInt(this.smtpPort()); - sValue = Utils.pString(sValue); - switch (sValue) + if (this.enableSmartPorts()) { - case '0': - if (465 === iPort || 587 === iPort) - { - this.smtpPort('25'); - } - break; - case '1': - if (25 === iPort || 587 === iPort) - { - this.smtpPort('465'); - } - break; - case '2': - if (25 === iPort || 465 === iPort) - { - this.smtpPort('587'); - } - break; + var iPort = Utils.pInt(this.smtpPort()); + sValue = Utils.pString(sValue); + switch (sValue) + { + case '0': + if (465 === iPort || 587 === iPort) + { + this.smtpPort('25'); + } + break; + case '1': + if (25 === iPort || 587 === iPort) + { + this.smtpPort('465'); + } + break; + case '2': + if (25 === iPort || 465 === iPort) + { + this.smtpPort('587'); + } + break; + } } }, this); @@ -273,6 +281,8 @@ this.clearForm(); if (oDomain) { + this.enableSmartPorts(false); + this.edit(true); this.name(Utils.trim(oDomain.Name)); @@ -288,6 +298,8 @@ this.smtpShortLogin(!!oDomain.OutShortLogin); this.smtpAuth(!!oDomain.OutAuth); this.whiteList(Utils.trim(oDomain.WhiteList)); + + this.enableSmartPorts(true); } }; @@ -303,6 +315,7 @@ { this.edit(false); this.whiteListPage(false); + this.enableSmartPorts(false); this.savingError(''); @@ -321,6 +334,8 @@ this.smtpShortLogin(false); this.smtpAuth(true); this.whiteList(''); + + this.enableSmartPorts(true); }; module.exports = DomainPopupView; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index b1f3a3046..7e0c5186b 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -7482,8 +7482,6 @@ class Actions $mResult['Plain'] = $sPlain; // $mResult['Plain'] = 0 === \strlen($sPlain) ? '' : \MailSo\Base\HtmlUtils::ConvertPlainToHtml($sPlain); - $this->Logger()->WriteDump($mResult['Html']); - $mResult['TextHash'] = \md5($mResult['Html'].$mResult['Plain']); $mResult['TextPartIsTrimmed'] = $mResponse->TextPartIsTrimmed();