diff --git a/dev/Settings/Admin/Licensing.js b/dev/Settings/Admin/Licensing.js index c763b7ab5..102057809 100644 --- a/dev/Settings/Admin/Licensing.js +++ b/dev/Settings/Admin/Licensing.js @@ -52,6 +52,14 @@ require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate')); }; + /** + * @returns {boolean} + */ + LicensingAdminSettings.prototype.licenseIsUnlim = function () + { + return 1898625600 === this.licenseExpired(); + }; + /** * @returns {string} */ @@ -62,7 +70,8 @@ oDate = moment.unix(iTime) ; - return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')'); + return this.licenseIsUnlim() ? 'Never' : + (iTime && (oDate.format('LL') + ' (' + oDate.from(moment()) + ')')); }; module.exports = LicensingAdminSettings; diff --git a/dev/Styles/AdminBranding.less b/dev/Styles/AdminBranding.less index a84715b25..8a8db695c 100644 --- a/dev/Styles/AdminBranding.less +++ b/dev/Styles/AdminBranding.less @@ -1,7 +1,7 @@ .b-admin-branding { .disabled-form { - opacity: 0.4; + opacity: 0.8; } } diff --git a/dev/View/Admin/Settings/Pane.js b/dev/View/Admin/Settings/Pane.js index 31fd3f7c6..6e93c9e91 100644 --- a/dev/View/Admin/Settings/Pane.js +++ b/dev/View/Admin/Settings/Pane.js @@ -28,7 +28,6 @@ this.adminManLoadingVisibility = Data.adminManLoadingVisibility; this.capa = !!Settings.settingsGet('PremType'); - this.capa = false; // TODO kn.constructorEnd(this); } diff --git a/dev/View/User/Login.js b/dev/View/User/Login.js index 77f81eafc..b4b338966 100644 --- a/dev/View/User/Login.js +++ b/dev/View/User/Login.js @@ -141,6 +141,11 @@ else if (oData.ErrorCode) { this.submitRequest(false); + if (-1 < Utils.inArray(oData.ErrorCode, [Enums.Notification.InvalidInputArgument])) + { + oData.ErrorCode = Enums.Notification.AuthError; + } + this.submitError(Utils.getNotification(oData.ErrorCode)); if ('' === this.submitError()) @@ -190,7 +195,7 @@ window.open(Links.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes'); - + return true; }, function () { diff --git a/package.json b/package.json index 180563857..44ecf9b90 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "RainLoop", "title": "RainLoop Webmail", - "version": "1.6.11", - "release": "192", + "version": "1.7.0", + "release": "200", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "gulpfile.js", diff --git a/plugins/change-password-example/ChangePasswordExampleDriver.php b/plugins/change-password-example/ChangePasswordExampleDriver.php index ed2845fe7..1ffd3f3a9 100644 --- a/plugins/change-password-example/ChangePasswordExampleDriver.php +++ b/plugins/change-password-example/ChangePasswordExampleDriver.php @@ -19,7 +19,7 @@ class ChangePasswordExampleDriver implements \RainLoop\Providers\ChangePassword\ } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -30,7 +30,7 @@ class ChangePasswordExampleDriver implements \RainLoop\Providers\ChangePassword\ } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/change-smtp-ehlo-message/index.php b/plugins/change-smtp-ehlo-message/index.php index 252db9000..696ea84b0 100644 --- a/plugins/change-smtp-ehlo-message/index.php +++ b/plugins/change-smtp-ehlo-message/index.php @@ -8,12 +8,12 @@ class ChangeSmtpEhloMessagePlugin extends \RainLoop\Plugins\AbstractPlugin } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param array $aSmtpCredentials */ public function FilterSmtpCredentials($oAccount, &$aSmtpCredentials) { - if ($oAccount instanceof \RainLoop\Account && \is_array($aSmtpCredentials)) + if ($oAccount instanceof \RainLoop\Model\Account && \is_array($aSmtpCredentials)) { // Default: // $aSmtpCredentials['Ehlo'] = \MailSo\Smtp\SmtpClient::EhloHelper(); diff --git a/plugins/cpanel-change-password/CpanelChangePasswordDriver.php b/plugins/cpanel-change-password/CpanelChangePasswordDriver.php index 08d4a6070..310dfe27a 100644 --- a/plugins/cpanel-change-password/CpanelChangePasswordDriver.php +++ b/plugins/cpanel-change-password/CpanelChangePasswordDriver.php @@ -84,7 +84,7 @@ class CpanelChangePasswordDriver implements \RainLoop\Providers\ChangePassword\C } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -95,7 +95,7 @@ class CpanelChangePasswordDriver implements \RainLoop\Providers\ChangePassword\C } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/custom-system-folders/index.php b/plugins/custom-system-folders/index.php index b9f6d2b97..92d69ecb5 100644 --- a/plugins/custom-system-folders/index.php +++ b/plugins/custom-system-folders/index.php @@ -40,7 +40,7 @@ class CustomSystemFoldersPlugin extends \RainLoop\Plugins\AbstractPlugin } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param array $aSystemTypes */ public function FilterFoldersSystemTypes($oAccount, &$aSystemTypes) @@ -88,7 +88,7 @@ class CustomSystemFoldersPlugin extends \RainLoop\Plugins\AbstractPlugin } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param array $aSystemFolderNames */ public function FilterSystemFoldersNames($oAccount, &$aSystemFolderNames) @@ -110,7 +110,7 @@ class CustomSystemFoldersPlugin extends \RainLoop\Plugins\AbstractPlugin $this->helperFolderType($this->sArchiveFolder, \MailSo\Imap\Enumerations\FolderType::ALL, $aPrepend, $aSystemFolderNames); - + if (0 < \count($aPrepend)) { $aSystemFolderNames = \array_merge($aPrepend, $aSystemFolderNames); diff --git a/plugins/hmailserver-change-password/HmailserverChangePasswordDriver.php b/plugins/hmailserver-change-password/HmailserverChangePasswordDriver.php index fece38a28..d03c9c615 100644 --- a/plugins/hmailserver-change-password/HmailserverChangePasswordDriver.php +++ b/plugins/hmailserver-change-password/HmailserverChangePasswordDriver.php @@ -63,7 +63,7 @@ class HmailserverChangePasswordDriver implements \RainLoop\Providers\ChangePassw } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -74,7 +74,7 @@ class HmailserverChangePasswordDriver implements \RainLoop\Providers\ChangePassw } /** - * @param \RainLoop\Account $oHmailAccount + * @param \RainLoop\Model\Account $oHmailAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/ispconfig-change-password/IspConfigChangePasswordDriver.php b/plugins/ispconfig-change-password/IspConfigChangePasswordDriver.php index 776bda038..40059247a 100644 --- a/plugins/ispconfig-change-password/IspConfigChangePasswordDriver.php +++ b/plugins/ispconfig-change-password/IspConfigChangePasswordDriver.php @@ -70,7 +70,7 @@ class IspConfigChangePasswordDriver implements \RainLoop\Providers\ChangePasswor } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -81,7 +81,7 @@ class IspConfigChangePasswordDriver implements \RainLoop\Providers\ChangePasswor } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/override-smtp-credentials/index.php b/plugins/override-smtp-credentials/index.php index bb7f6767c..ed26330c6 100644 --- a/plugins/override-smtp-credentials/index.php +++ b/plugins/override-smtp-credentials/index.php @@ -8,12 +8,12 @@ class OverrideSmtpCredentialsPlugin extends \RainLoop\Plugins\AbstractPlugin } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param array $aSmtpCredentials */ public function FilterSmtpCredentials($oAccount, &$aSmtpCredentials) { - if ($oAccount instanceof \RainLoop\Account && \is_array($aSmtpCredentials)) + if ($oAccount instanceof \RainLoop\Model\Account && \is_array($aSmtpCredentials)) { $sEmail = $oAccount->Email(); diff --git a/plugins/poppassd-change-password/ChangePasswordPoppassdDriver.php b/plugins/poppassd-change-password/ChangePasswordPoppassdDriver.php index 6f6f6d727..9cb2851c2 100644 --- a/plugins/poppassd-change-password/ChangePasswordPoppassdDriver.php +++ b/plugins/poppassd-change-password/ChangePasswordPoppassdDriver.php @@ -71,7 +71,7 @@ class ChangePasswordPoppassdDriver implements \RainLoop\Providers\ChangePassword } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -82,7 +82,7 @@ class ChangePasswordPoppassdDriver implements \RainLoop\Providers\ChangePassword } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php index 80ece64f5..ccd1dbf8a 100644 --- a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php +++ b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php @@ -135,7 +135,7 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * * @return bool */ @@ -146,7 +146,7 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass } /** - * @param \RainLoop\Account $oAccount + * @param \RainLoop\Model\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * diff --git a/plugins/proxyauth-login-example/index.php b/plugins/proxyauth-login-example/index.php index 3b8fd84b1..d33712f91 100644 --- a/plugins/proxyauth-login-example/index.php +++ b/plugins/proxyauth-login-example/index.php @@ -8,11 +8,20 @@ class ProxyauthLoginExamplePlugin extends \RainLoop\Plugins\AbstractPlugin } /** - * @param \RainLoop\Account $oAccount + * @param string $sLogin + * @param string $sPassword + */ + public function isValidAccount($sLogin, $sPassword) + { + return !empty($sLogin) && !empty($sPassword); + } + + /** + * @param \RainLoop\Model\Account $oAccount */ public function EventLoginPostLoginProvide(&$oAccount) { - if ($oAccount instanceof \RainLoop\Account) + if ($oAccount instanceof \RainLoop\Model\Account) { // Verify logic $bValid = isValidAccount($oAccount->Login(), $oAccount->Password()); @@ -23,10 +32,10 @@ class ProxyauthLoginExamplePlugin extends \RainLoop\Plugins\AbstractPlugin * $oAccount->Password(); // IMAP password * $oAccount->DomainIncHost(); // IMAP host * - * @see \RainLoo\Account for more + * @see \RainLoo\Model\Account for more */ - if ($bValid) // if verify failed + if (!$bValid) // if verify failed { // throw a Auth Error Exception throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php index e6cb3efe7..24e01d406 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php @@ -587,10 +587,10 @@ class Http if ($oLogger) { $oLogger->Write('cUrl: URL: '.$sUrl); - if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && 0 < \count($aOptions[CURLOPT_HTTPHEADER])) - { - $oLogger->Write('cUrl: Headers: '.\print_r($aOptions[CURLOPT_HTTPHEADER], true)); - } +// if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && 0 < \count($aOptions[CURLOPT_HTTPHEADER])) +// { +// $oLogger->Write('cUrl: Headers: '.\print_r($aOptions[CURLOPT_HTTPHEADER], true)); +// } } \MailSo\Base\Http::DetectAndHackFollowLocationUrl($sUrl, $aOptions, $oLogger); diff --git a/rainloop/v/0.0.0/app/src/RainLoop/Actions.php b/rainloop/v/0.0.0/app/src/RainLoop/Actions.php index e682b8f71..66ac0439d 100644 --- a/rainloop/v/0.0.0/app/src/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/src/RainLoop/Actions.php @@ -986,8 +986,7 @@ class Actions static $bResult = null; if (null === $bResult) { -// $bResult = $this->licenseParser($this->licenseHelper(false, true)); - $bResult = true; + $bResult = $this->licenseParser($this->licenseHelper(false, true)); } return $bResult; @@ -2645,7 +2644,7 @@ class Actions /** * @return string */ - public function licenseHelper($sForce = false, $bLongCache = false, $iFastCacheTimeInMin = 5, $iLongCacheTimeInDays = 2) + public function licenseHelper($sForce = false, $bLongCache = false, $iFastCacheTimeInMin = 10, $iLongCacheTimeInDays = 3) { $sDomain = APP_SITE; @@ -2713,16 +2712,17 @@ class Actions /** * @param string $sInput + * @param int $iExpired = 0 * * @return bool */ - public function licenseParser($sInput) + public function licenseParser($sInput, &$iExpired = 0) { $aMatch = array(); if (\preg_match('/^EXPIRED:([\d]+)$/', $sInput, $aMatch)) { - $iTime = (int) $aMatch[1]; - return \time() < $iTime; + $iExpired = (int) $aMatch[1]; + return \time() < $iExpired; } return false; @@ -2750,15 +2750,15 @@ class Actions \sleep(1); } - $aMatch = array(); - if (\preg_match('/^EXPIRED:([\d]+)$/', $sValue, $aMatch)) + $iExpired = 0; + if ($this->licenseParser($sValue, $iExpired)) { $mResult = array( 'Banned' => false, - 'Expired' => (int) $aMatch[1], + 'Expired' => $iExpired, ); } - else if ($sValue === 'NO') + else if ($sValue === 'NO' || \preg_match('/^EXPIRED:[\d]+$/', $sValue)) { $iErrorCode = -1; } diff --git a/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword.php b/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword.php index 177cf9065..b344b227c 100644 --- a/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword.php +++ b/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword.php @@ -34,24 +34,24 @@ class ChangePassword extends \RainLoop\Providers\AbstractProvider } /** - * @param \RainLoop\Model\Account $oAccount + * @param \RainLoop\Account $oAccount * * @return bool */ public function PasswordChangePossibility($oAccount) { return $this->IsActive() && - $oAccount instanceof \RainLoop\Model\Account && + $oAccount instanceof \RainLoop\Account && $this->oDriver && $this->oDriver->PasswordChangePossibility($oAccount) ; } /** - * @param \RainLoop\Model\Account $oAccount + * @param \RainLoop\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword */ - public function ChangePassword(\RainLoop\Model\Account $oAccount, $sPrevPassword, $sNewPassword) + public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword) { if ($this->oDriver instanceof \RainLoop\Providers\ChangePassword\ChangePasswordInterface && $this->PasswordChangePossibility($oAccount)) diff --git a/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword/ChangePasswordInterface.php b/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword/ChangePasswordInterface.php index d3a7f5318..faecf5707 100644 --- a/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword/ChangePasswordInterface.php +++ b/rainloop/v/0.0.0/app/src/RainLoop/Providers/ChangePassword/ChangePasswordInterface.php @@ -5,18 +5,18 @@ namespace RainLoop\Providers\ChangePassword; interface ChangePasswordInterface { /** - * @param \RainLoop\Model\Account $oAccount + * @param \RainLoop\Account $oAccount * * @return bool */ public function PasswordChangePossibility($oAccount); /** - * @param \RainLoop\Model\Account $oAccount + * @param \RainLoop\Account $oAccount * @param string $sPrevPassword * @param string $sNewPassword * * @return bool */ - public function ChangePassword(\RainLoop\Model\Account $oAccount, $sPrevPassword, $sNewPassword); + public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword); } diff --git a/rainloop/v/0.0.0/app/src/RainLoop/Providers/Suggestions.php b/rainloop/v/0.0.0/app/src/RainLoop/Providers/Suggestions.php index 1e55ab192..b436f2ca4 100644 --- a/rainloop/v/0.0.0/app/src/RainLoop/Providers/Suggestions.php +++ b/rainloop/v/0.0.0/app/src/RainLoop/Providers/Suggestions.php @@ -20,12 +20,12 @@ class Suggestions extends \RainLoop\Providers\AbstractProvider } /** - * @param \RainLoop\Model\Account $oAccount + * @param \RainLoop\Account $oAccount * @param string $sQuery * * @return array */ - public function Process(\RainLoop\Model\Account $oAccount, $sQuery) + public function Process(\RainLoop\Account $oAccount, $sQuery) { return $this->oDriver && $this->IsActive() && 0 < \strlen($sQuery) ? $this->oDriver->Process($oAccount, $sQuery) : array(); } diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html index b326a4021..c1e3cfc5d 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html @@ -33,9 +33,9 @@ - +
diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsBranding.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsBranding.html index a540dc8b0..05d554c4d 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsBranding.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsBranding.html @@ -1,7 +1,7 @@
- Full functionality available in Premium version only. + This functionality is available for Premium subscribers.
@@ -77,17 +77,18 @@ }">
- +
+
@@ -25,29 +26,49 @@
+
- This domain can't be licensed for commercial use. +

+ Basic +  (Unlim) +

+
+

+ This domain can't be licensed. +

+
-
+
   Checking…
-
- This domain isn't licensed for commercial use. +
+

+ Basic +

+
+

+ This domain isn't licensed for commercial use (with additional features). +

-
-

- This domain is licensed for commercial use -

-

+

+

+ Lifetime (Premium) + Premium +

+

Subscription expires:   diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsActivate.html b/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsActivate.html index 2204c63fe..79a14975a 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsActivate.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/PopupsActivate.html @@ -34,7 +34,7 @@

- After activation, commercial subscription for will be extended. + After activation, premium subscription for will be extended.
Note that subscription key can be activated for a single domain only.

diff --git a/rainloop/v/0.0.0/app/templates/Views/User/Login.html b/rainloop/v/0.0.0/app/templates/Views/User/Login.html index 1e43c6ff9..6e2369d89 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/Login.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/Login.html @@ -84,9 +84,9 @@
- +