diff --git a/dev/App/User.js b/dev/App/User.js index f544ae6be..29f08e4dc 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -1060,7 +1060,32 @@ oTop = null, oBottom = null, - fResizeFunction = function (oEvent, oObject) { + fResizeCreateFunction = function (oEvent) { + if (oEvent && oEvent.target) + { + var oResizableHandle = $(oEvent.target).find('.ui-resizable-handle'); + + oResizableHandle + .on('mousedown', function () { + Globals.$html.addClass('rl-resizer'); + }) + .on('mouseup', function () { + Globals.$html.removeClass('rl-resizer'); + }) + ; + } + }, + + fResizeStartFunction = function () { + Globals.$html.addClass('rl-resizer'); + }, + + fResizeResizeFunction = _.debounce(function () { + Globals.$html.addClass('rl-resizer'); + }, 500, true), + + fResizeStopFunction = function (oEvent, oObject) { + Globals.$html.removeClass('rl-resizer'); if (oObject && oObject.size && oObject.size.height) { Local.set(sClientSideKeyName, oObject.size.height); @@ -1076,7 +1101,10 @@ 'minHeight': iMinHeight, 'maxHeight': iMaxHeight, 'handles': 's', - 'stop': fResizeFunction + 'create': fResizeCreateFunction, + 'resize': fResizeResizeFunction, + 'start': fResizeStartFunction, + 'stop': fResizeStopFunction }, fSetHeight = function (iHeight) { @@ -1169,8 +1197,29 @@ fSetWidth(iWidth > iMinWidth ? iWidth : iMinWidth); } }, + fResizeCreateFunction = function (oEvent) { + if (oEvent && oEvent.target) + { + var oResizableHandle = $(oEvent.target).find('.ui-resizable-handle'); - fResizeFunction = function (oEvent, oObject) { + oResizableHandle + .on('mousedown', function () { + Globals.$html.addClass('rl-resizer'); + }) + .on('mouseup', function () { + Globals.$html.removeClass('rl-resizer'); + }) + ; + } + }, + fResizeResizeFunction = _.debounce(function () { + Globals.$html.addClass('rl-resizer'); + }, 500, true), + fResizeStartFunction = function () { + Globals.$html.addClass('rl-resizer'); + }, + fResizeStopFunction = function (oEvent, oObject) { + Globals.$html.removeClass('rl-resizer'); if (oObject && oObject.size && oObject.size.width) { Local.set(sClientSideKeyName, oObject.size.width); @@ -1192,7 +1241,10 @@ 'minWidth': iMinWidth, 'maxWidth': 350, 'handles': 'e', - 'stop': fResizeFunction + 'create': fResizeCreateFunction, + 'resize': fResizeResizeFunction, + 'start': fResizeStartFunction, + 'stop': fResizeStopFunction }); Events.sub('left-panel.off', function () { diff --git a/dev/Common/HtmlEditor.js b/dev/Common/HtmlEditor.js index b79f45209..0e64c420a 100644 --- a/dev/Common/HtmlEditor.js +++ b/dev/Common/HtmlEditor.js @@ -196,6 +196,8 @@ { this.modeToggle(true); + sHtml = sHtml.replace(/<[pP][^>]*><\/[pP]>/g, ''); + try { this.editor.setData(sHtml); } catch (e) {} diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index c42e635d8..0f0cb58ce 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -867,6 +867,7 @@ sText = sHtml .replace(/\u0002([\s\S]*)\u0002/gm, '\u200C$1\u200C') + .replace(/<[pP][^>]*><\/[pP]>/g, '') .replace(/]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre) .replace(/[\s]+/gm, ' ') .replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue) diff --git a/dev/Settings/Admin/Branding.js b/dev/Settings/Admin/Branding.js index b121ad261..0ce884e59 100644 --- a/dev/Settings/Admin/Branding.js +++ b/dev/Settings/Admin/Branding.js @@ -42,6 +42,9 @@ this.userLogoMessage = ko.observable(Settings.settingsGet('UserLogoMessage') || ''); this.userLogoMessage.trigger = ko.observable(Enums.SaveSettingsStep.Idle); + this.userIframeMessage = ko.observable(Settings.settingsGet('UserIframeMessage') || ''); + this.userIframeMessage.trigger = ko.observable(Enums.SaveSettingsStep.Idle); + this.userLogoTitle = ko.observable(Settings.settingsGet('UserLogoTitle') || ''); this.userLogoTitle.trigger = ko.observable(Enums.SaveSettingsStep.Idle); diff --git a/dev/Styles/MessageView.less b/dev/Styles/MessageView.less index 215a8e4b8..24d392852 100644 --- a/dev/Styles/MessageView.less +++ b/dev/Styles/MessageView.less @@ -69,6 +69,22 @@ html.rl-no-preview-pane { color: #DA4F49; } + .b-message-view-iframe { + } + + .b-message-view-iframe-backdrop { + display: none; + background: transparent; + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + right: 0px; + bottom: 0px; + opacity: .1; + } + .content { -webkit-overflow-scrolling: touch; } @@ -453,6 +469,10 @@ html.rl-no-preview-pane { } } +html.rl-resizer .b-message-view-iframe-backdrop { + display: block !important; +} + html.rl-no-preview-pane .messageView { .toolbar { padding-left: @rlMainBorderSize; diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index fef533f33..f7a3b1aa3 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -73,6 +73,7 @@ this.allowMessageListActions = !!Settings.capa(Enums.Capa.MessageListActions); this.logoImg = Utils.trim(Settings.settingsGet('UserLogoMessage')); + this.logoIframe = Utils.trim(Settings.settingsGet('UserIframeMessage')); this.attachmentsActions = AppStore.attachmentsActions; diff --git a/package.json b/package.json index 1ecdbaaf9..0847967c6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.9.1", - "release": "330", + "release": "333", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "gulpfile.js", @@ -40,7 +40,7 @@ "plugins" ], "readmeFilename": "README.md", - "ownCloudPackageVersion": "4.2", + "ownCloudPackageVersion": "4.3", "engines": { "node": ">= 0.10.0" }, diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php index 36b5395dd..0f3a10d56 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php @@ -730,6 +730,64 @@ END; return $sValue; } + /** + * @param string $sIncHeaders + * @param string $aHeadersToRemove = array() + * + * @return string + */ + public static function RemoveHeaderFromHeaders($sIncHeaders, $aHeadersToRemove = array()) + { + $sResultHeaders = $sIncHeaders; + + if (\is_array($aHeadersToRemove) && 0 < \count($aHeadersToRemove)) + { + $aHeadersToRemove = \array_map('strtolower', $aHeadersToRemove); + + $sIncHeaders = \preg_replace('/[\r\n]+/', "\n", $sIncHeaders); + $aHeaders = \explode("\n", $sIncHeaders); + + $bSkip = false; + $aResult = array(); + + foreach ($aHeaders as $sLine) + { + if (0 < \strlen($sLine)) + { + $sFirst = $sLine{1}; + if (' ' === $sFirst || "\t" === $sFirst) + { + if (!$bSkip) + { + $aResult[] = $sLine; + } + } + else + { + $bSkip = false; + $aParts = \explode(':', $sLine, 2); + + if (!empty($aParts) && !empty($aParts[0])) + { + if (\in_array(\strtolower(\trim($aParts[0])), $aHeadersToRemove)) + { + $bSkip = true; + } + else + { + $aResult[] = $sLine; + } + } + } + } + } + + $sResultHeaders = \implode("\r\n", $aResult); + } + + return $sResultHeaders; + } + /** * @param string $sEncodeType * @param string $sValue diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index 5a587efb0..e290b0a83 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -716,7 +716,8 @@ class MailClient $sHighestModSeq = isset($aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ]) ? (string) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ] : ''; - if ($this->IsGmail()) + if ($this->IsGmail() && + ('INBOX' === $sFolderName || '[gmail]' === \strtolower(\substr($sFolderName, 0, 7)))) { $oFolder = $this->oImapClient->FolderCurrentInformation(); if ($oFolder && null !== $oFolder->Exists && $oFolder->FolderName === $sFolderName) @@ -846,7 +847,8 @@ class MailClient $aFlags = array(); $bSelect = false; - if ($this->IsGmail()) + if ($this->IsGmail() && + ('INBOX' === $sFolderName || '[gmail]' === \strtolower(\substr($sFolderName, 0, 7)))) { $this->oImapClient->FolderSelect($sFolderName); $bSelect = true; @@ -1336,10 +1338,7 @@ class MailClient $aCriteriasResult[] = \gmdate('j-M-Y', $iTimeFilter > $iDateStampFrom ? $iTimeFilter : $iDateStampFrom); - if (0 < $iTimeFilter && $iTimeFilter > $iDateStampFrom) - { - $iTimeFilter = 0; - } + $iTimeFilter = 0; } if (0 < $iDateStampTo) 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 c0beae908..d60264ccc 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1447,7 +1447,6 @@ class Actions } $oSettings = null; - $oSettingsLocal = null; if (!$bAdmin) { @@ -1504,7 +1503,7 @@ class Actions } $oSettings = $this->SettingsProvider()->Load($oAccount); - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); + if (!$oAccount->IsAdditionalAccount() && !empty($aResult['WelcomePageUrl']) && ('once' === $aResult['WelcomePageDisplay'] || 'always' === $aResult['WelcomePageDisplay'])) @@ -1616,15 +1615,15 @@ class Actions $aResult['Auth'] = $this->IsAdminLoggined(false); if ($aResult['Auth']) { - $aResult['AdminLogin'] = $oConfig->Get('security', 'admin_login', ''); $aResult['AdminDomain'] = APP_SITE; + $aResult['AdminLogin'] = (string) $oConfig->Get('security', 'admin_login', ''); $aResult['UseTokenProtection'] = (bool) $oConfig->Get('security', 'csrf_protection', true); $aResult['EnabledPlugins'] = (bool) $oConfig->Get('plugins', 'enable', false); - $aResult['VerifySslCertificate'] = !!$oConfig->Get('ssl', 'verify_certificate', false); - $aResult['AllowSelfSigned'] = !!$oConfig->Get('ssl', 'allow_self_signed', true); + $aResult['VerifySslCertificate'] = (bool) $oConfig->Get('ssl', 'verify_certificate', false); + $aResult['AllowSelfSigned'] = (bool) $oConfig->Get('ssl', 'allow_self_signed', true); - $aDrivers = \class_exists('PDO') ? \PDO::getAvailableDrivers() : array(); + $aDrivers = \class_exists('PDO') ? \PDO::getAvailableDrivers() : null; $aResult['MySqlIsSupported'] = \is_array($aDrivers) ? \in_array('mysql', $aDrivers) : false; $aResult['SQLiteIsSupported'] = \is_array($aDrivers) ? \in_array('sqlite', $aDrivers) : false; $aResult['PostgreSqlIsSupported'] = \is_array($aDrivers) ? \in_array('pgsql', $aDrivers) : false; @@ -1632,11 +1631,11 @@ class Actions $aResult['ContactsEnable'] = (bool) $oConfig->Get('contacts', 'enable', false); $aResult['ContactsSharing'] = (bool) $oConfig->Get('contacts', 'allow_sharing', false); $aResult['ContactsSync'] = (bool) $oConfig->Get('contacts', 'allow_sync', false); - $aResult['ContactsPdoType'] = $this->ValidateContactPdoType(\trim($this->Config()->Get('contacts', 'type', 'sqlite'))); + $aResult['ContactsPdoType'] = (string) $this->ValidateContactPdoType(\trim($this->Config()->Get('contacts', 'type', 'sqlite'))); $aResult['ContactsPdoDsn'] = (string) $oConfig->Get('contacts', 'pdo_dsn', ''); $aResult['ContactsPdoType'] = (string) $oConfig->Get('contacts', 'type', ''); $aResult['ContactsPdoUser'] = (string) $oConfig->Get('contacts', 'pdo_user', ''); - $aResult['ContactsPdoPassword'] = APP_DUMMY; + $aResult['ContactsPdoPassword'] = (string) APP_DUMMY; $aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false); $aResult['AllowGoogleSocialAuth'] = (bool) $oConfig->Get('social', 'google_enable_auth', true); @@ -1658,11 +1657,11 @@ class Actions $aResult['AllowDropboxSocial'] = (bool) $oConfig->Get('social', 'dropbox_enable', false); $aResult['DropboxApiKey'] = (string) $oConfig->Get('social', 'dropbox_api_key', ''); - $aResult['SubscriptionEnabled'] = \MailSo\Base\Utils::ValidateDomain($aResult['AdminDomain']); + $aResult['SubscriptionEnabled'] = (bool) \MailSo\Base\Utils::ValidateDomain($aResult['AdminDomain']); // || \MailSo\Base\Utils::ValidateIP($aResult['AdminDomain']); - $aResult['WeakPassword'] = $oConfig->ValidatePassword('12345'); - $aResult['CoreAccess'] = $this->rainLoopCoreAccess(); + $aResult['WeakPassword'] = (bool) $oConfig->ValidatePassword('12345'); + $aResult['CoreAccess'] = (bool) $this->rainLoopCoreAccess(); $aResult['PhpUploadSizes'] = array( 'upload_max_filesize' => \ini_get('upload_max_filesize'), @@ -1690,6 +1689,7 @@ class Actions $aResult['Themes'] = $this->GetThemes(); $aResult['Languages'] = $this->GetLanguages(false); $aResult['LanguagesAdmin'] = $this->GetLanguages(true); + $aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true); $aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true); $aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024; @@ -1714,59 +1714,73 @@ class Actions $aResult['UserBackgroundName'] = ''; $aResult['UserBackgroundHash'] = ''; - if (!$bAdmin && $oSettings instanceof \RainLoop\Settings && - $oSettingsLocal instanceof \RainLoop\Settings && - $oAccount) + if (!$bAdmin && $oAccount instanceof \RainLoop\Model\Account) { - if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) - { - $sLanguage = $oSettings->GetConf('Language', $sLanguage); - } - - if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)) - { - $sTheme = $oSettingsLocal->GetConf('Theme', $sTheme); - } - - $aResult['SentFolder'] = $oSettingsLocal->GetConf('SentFolder', ''); - $aResult['DraftFolder'] = $oSettingsLocal->GetConf('DraftFolder', ''); - $aResult['SpamFolder'] = $oSettingsLocal->GetConf('SpamFolder', ''); - $aResult['TrashFolder'] = $oSettingsLocal->GetConf('TrashFolder', ''); - $aResult['ArchiveFolder'] = $oSettingsLocal->GetConf('ArchiveFolder', ''); - $aResult['NullFolder'] = $oSettingsLocal->GetConf('NullFolder', ''); - - $aResult['EditorDefaultType'] = $oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); - $aResult['ShowImages'] = (bool) $oSettings->GetConf('ShowImages', $aResult['ShowImages']); - $aResult['ContactsAutosave'] = (bool) $oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); - $aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']); - $aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']); - $aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']); - $aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']); - $aResult['AutoLogout'] = (int) $oSettings->GetConf('AutoLogout', $aResult['AutoLogout']); - $aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']); - - $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); - $aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); - - if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::AUTOLOGOUT, $oAccount)) - { - $aResult['AutoLogout'] = 0; - } - - if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) - { - $aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); - $aResult['UserBackgroundHash'] = (string) $oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); -// if (!empty($aResult['UserBackgroundName']) && !empty($aResult['UserBackgroundHash'])) -// { -// $aResult['IncludeBackground'] = './?/Raw/&q[]=/{{USER}}/UserBackground/&q[]=/'. -// $aResult['UserBackgroundHash'].'/'; -// } - } - - $aResult['EnableTwoFactor'] = !!$oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']); - $aResult['ParentEmail'] = $oAccount->ParentEmail(); + + $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); + + if ($oSettingsLocal instanceof \RainLoop\Settings) + { + // if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) + + $aResult['SentFolder'] = (string) $oSettingsLocal->GetConf('SentFolder', ''); + $aResult['DraftFolder'] = (string) $oSettingsLocal->GetConf('DraftFolder', ''); + $aResult['SpamFolder'] = (string) $oSettingsLocal->GetConf('SpamFolder', ''); + $aResult['TrashFolder'] = (string) $oSettingsLocal->GetConf('TrashFolder', ''); + $aResult['ArchiveFolder'] = (string) $oSettingsLocal->GetConf('ArchiveFolder', ''); + $aResult['NullFolder'] = (string) $oSettingsLocal->GetConf('NullFolder', ''); + } + + if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)) + { + if ($oSettings instanceof \RainLoop\Settings) + { + if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) + { + $sLanguage = (string) $oSettings->GetConf('Language', $sLanguage); + } + + $aResult['EditorDefaultType'] = (string) $oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); + $aResult['ShowImages'] = (bool) $oSettings->GetConf('ShowImages', $aResult['ShowImages']); + $aResult['ContactsAutosave'] = (bool) $oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); + $aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']); + $aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']); + $aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']); + $aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']); + $aResult['AutoLogout'] = (int) $oSettings->GetConf('AutoLogout', $aResult['AutoLogout']); + $aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']); + + if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::AUTOLOGOUT, $oAccount)) + { + $aResult['AutoLogout'] = 0; + } + + if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) + { + $aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); + $aResult['UserBackgroundHash'] = (string) $oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); + // if (!empty($aResult['UserBackgroundName']) && !empty($aResult['UserBackgroundHash'])) + // { + // $aResult['IncludeBackground'] = './?/Raw/&q[]=/{{USER}}/UserBackground/&q[]=/'. + // $aResult['UserBackgroundHash'].'/'; + // } + } + + $aResult['EnableTwoFactor'] = (bool) $oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']); + } + + if ($oSettingsLocal instanceof \RainLoop\Settings) + { + $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); + $aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); + + if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)) + { + $sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme); + } + } + } } $sStaticCache = \md5(APP_VERSION.$this->Plugins()->Hash()); @@ -1833,7 +1847,7 @@ class Actions if (false !== \strpos($sAcceptLang, ',')) { $aParts = \explode(',', $sAcceptLang, 2); - $sLang = !empty($aParts[0]) ? \trim(\strtolower($aParts[0])) : ''; + $sLang = empty($aParts[0]) ? '' : \trim(\strtolower($aParts[0])); } return $sLang; @@ -2398,12 +2412,14 @@ class Actions /** * @param \RainLoop\Model\Account $oAccount - * @param bool $bAllowIdentities = false * * @return array */ - public function GetIdentities($oAccount, $bAllowIdentities = false) + public function GetIdentities($oAccount) { + $bAllowIdentities = $this->GetCapa(false, + \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount); + $aIdentities = array(); if ($oAccount) { @@ -2491,6 +2507,7 @@ class Actions public function GetIdentityByID($oAccount, $sID, $bFirstOnEmpty = false) { $aIdentities = $this->GetIdentities($oAccount); + if (\is_array($aIdentities)) { foreach ($aIdentities as $oIdentity) @@ -2544,12 +2561,13 @@ class Actions /** * @param \RainLoop\Model\Account $oAccount * @param array $aIdentities = array() - * @param bool $bAllowIdentities = false * * @return array */ - public function SetIdentities($oAccount, $aIdentities = array(), $bAllowIdentities = false) + public function SetIdentities($oAccount, $aIdentities = array()) { + $bAllowIdentities = $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount); + $aResult = array(); foreach ($aIdentities as $oItem) { @@ -2966,8 +2984,7 @@ class Actions throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidInputArgument); } - $aIdentities = $this->GetIdentities($oAccount, - $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount)); + $aIdentities = $this->GetIdentities($oAccount); $bAdded = false; $aIdentitiesForSave = array(); @@ -2992,8 +3009,7 @@ class Actions $aIdentitiesForSave[] = $oIdentity; } - return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aIdentitiesForSave, - $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount))); + return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aIdentitiesForSave)); } /** @@ -3017,7 +3033,8 @@ class Actions } $aNew = array(); - $aIdentities = $this->GetIdentities($oAccount, $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount)); + $aIdentities = $this->GetIdentities($oAccount); + foreach ($aIdentities as $oItem) { if ($oItem && $sId !== $oItem->Id()) @@ -3026,8 +3043,7 @@ class Actions } } - return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aNew, - $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount))); + return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aNew)); } /** @@ -3191,8 +3207,7 @@ class Actions return $this->DefaultResponse(__FUNCTION__, array( 'Accounts' => $mAccounts, - 'Identities' => $this->GetIdentities($oAccount, - $this->GetCapa(false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount)) + 'Identities' => $this->GetIdentities($oAccount) )); } @@ -4791,11 +4806,15 @@ class Actions */ public function DoSettingsUpdate() { + $oAccount = $this->getAccountFromToken(); + if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)) + { + return $this->FalseResponse(__FUNCTION__); + } + $self = $this; $oConfig = $this->Config(); - $oAccount = $this->getAccountFromToken(); - $oSettings = $this->SettingsProvider()->Load($oAccount); $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); @@ -6038,11 +6057,26 @@ class Actions list($sMailHeaders, $sMailBody) = \explode("\r\n\r\n", $sRawBody, 2); unset($sRawBody); -// $this->Logger()->WriteDump(array( -// $sMailTo, $sMailSubject, $sMailBody, $sMailHeaders -// )); + if ($this->Config()->Get('labs', 'mail_func_clear_headers', true)) + { + $sMailHeaders = \MailSo\Base\Utils::RemoveHeaderFromHeaders($sMailHeaders, array( + \MailSo\Mime\Enumerations\Header::TO_, + \MailSo\Mime\Enumerations\Header::SUBJECT + )); + } - if (!\mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders/*, '-f'.$oFrom->GetEmail()*/)) + if ($this->Config()->Get('debug', 'enable', false)) + { + $this->Logger()->WriteDump(array( + $sMailTo, $sMailSubject, $sMailBody, $sMailHeaders + )); + } + + $bR = $this->Config()->Get('labs', 'mail_func_additional_parameters', false) ? + \mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders, '-f'.$oFrom->GetEmail()) : + \mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders); + + if (!$bR) { throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage); } @@ -7906,30 +7940,6 @@ class Actions $aResult = array(); - if ($oConfig->Get('capa', 'filters', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::FILTERS; - if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) - { - $aResult[] = \RainLoop\Enumerations\Capa::SIEVE; - } - } - - if ($oConfig->Get('capa', 'x-templates', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::TEMPLATES; - } - - if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS; - } - - if ($oConfig->Get('webmail', 'allow_additional_identities', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::IDENTITIES; - } - if ($oConfig->Get('capa', 'folders', true)) { $aResult[] = \RainLoop\Enumerations\Capa::FOLDERS; @@ -7953,6 +7963,57 @@ class Actions if ($oConfig->Get('capa', 'settings', true)) { $aResult[] = \RainLoop\Enumerations\Capa::SETTINGS; + + if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS; + } + + if ($oConfig->Get('webmail', 'allow_additional_identities', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::IDENTITIES; + } + + if ($oConfig->Get('capa', 'x-templates', true)) + { + $aResult[] = \RainLoop\Enumerations\Capa::TEMPLATES; + } + + if ($oConfig->Get('webmail', 'allow_themes', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::THEMES; + } + + if ($oConfig->Get('webmail', 'allow_user_background', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::USER_BACKGROUND; + } + + if ($oConfig->Get('security', 'openpgp', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP; + } + + if ($oConfig->Get('capa', 'filters', false)) + { + $aResult[] = \RainLoop\Enumerations\Capa::FILTERS; + if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) + { + $aResult[] = \RainLoop\Enumerations\Capa::SIEVE; + } + } + } + + if ($oConfig->Get('security', 'allow_two_factor_auth', false) && + ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) + { + $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR; + + if ($oConfig->Get('security', 'force_two_factor_auth', false) && + ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) + { + $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE; + } } if ($oConfig->Get('capa', 'help', true)) @@ -7990,18 +8051,6 @@ class Actions } } - if ($oConfig->Get('security', 'allow_two_factor_auth', false) && - ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) - { - $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR; - - if ($oConfig->Get('security', 'force_two_factor_auth', false) && - ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) - { - $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE; - } - } - if ($oConfig->Get('labs', 'allow_gravatar', false)) { $aResult[] = \RainLoop\Enumerations\Capa::GRAVATAR; @@ -8017,21 +8066,6 @@ class Actions $aResult[] = \RainLoop\Enumerations\Capa::PREFETCH; } - if ($oConfig->Get('webmail', 'allow_themes', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::THEMES; - } - - if ($oConfig->Get('webmail', 'allow_user_background', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::USER_BACKGROUND; - } - - if ($oConfig->Get('security', 'openpgp', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP; - } - if (!\RainLoop\Utils::IsOwnCloud()) { $aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT; diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php index 05020a6a6..0edf2ea53 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -89,10 +89,13 @@ class Application extends \RainLoop\Config\AbstractConfig 'login_desc' => array(''), 'login_css' => array(''), 'login_powered' => array(true), + + 'user_css' => array(''), 'user_logo' => array(''), 'user_logo_title' => array(''), 'user_logo_message' => array(''), - 'user_css' => array(''), + 'user_iframe_message' => array(''), + 'welcome_page_url' => array(''), 'welcome_page_display' => array('none') ), @@ -318,6 +321,8 @@ Enables caching in the system'), 'smtp_show_server_errors' => array(false), 'sieve_allow_raw_script' => array(false), 'sieve_utf8_folder_name' => array(true), + 'mail_func_clear_headers ' => array(true), + 'mail_func_additional_parameters ' => array(false), 'folders_spec_limit' => array(50), 'owncloud_save_folder' => array('Attachments'), 'curl_proxy' => array(''), diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php index 70e76b9d8..5f2c47814 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Service.php @@ -193,18 +193,23 @@ class Service $sResult .= ''; + $sResult .= '] //-->'; } // Output result diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsLicensing.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsLicensing.html index 89a42be7e..c1f914a9e 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsLicensing.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsLicensing.html @@ -20,7 +20,7 @@
-

+

Basic


diff --git a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html index 3a04db13d..033339663 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html @@ -43,21 +43,32 @@
-
+
-
- -
- -
+
+
-
- +
+ +
+ +
+ +
+
+ +
+ +
+
+
@@ -211,6 +222,7 @@
+