diff --git a/dev/Boots/RainLoopApp.js b/dev/Boots/RainLoopApp.js index 5139d07f4..cc96eda45 100644 --- a/dev/Boots/RainLoopApp.js +++ b/dev/Boots/RainLoopApp.js @@ -567,7 +567,7 @@ RainLoopApp.prototype.bootstart = function () bTwitter = this.settingsGet('AllowTwitterSocial') ; - if (!this.settingsGet('RemoteChangePassword')) + if (!this.settingsGet('AllowChangePassword')) { Utils.removeSettingsViewModel(SettingsChangePasswordScreen); } diff --git a/dev/Storages/WebMailData.js b/dev/Storages/WebMailData.js index c36b8edb8..96c43494a 100644 --- a/dev/Storages/WebMailData.js +++ b/dev/Storages/WebMailData.js @@ -34,14 +34,14 @@ function WebMailDataStorage() this.devPassword = ''; this.accountEmail = ko.observable(''); - this.accountLogin = ko.observable(''); + this.accountIncLogin = ko.observable(''); + this.accountOutLogin = ko.observable(''); this.projectHash = ko.observable(''); this.threading = ko.observable(false); this.lastFoldersHash = ''; this.remoteSuggestions = false; - this.remoteChangePassword = false; // system folders this.sentFolder = ko.observable(''); @@ -389,7 +389,8 @@ WebMailDataStorage.prototype.populateDataOnStart = function() AbstractData.prototype.populateDataOnStart.call(this); this.accountEmail(RL.settingsGet('Email')); - this.accountLogin(RL.settingsGet('Login')); + this.accountIncLogin(RL.settingsGet('IncLogin')); + this.accountOutLogin(RL.settingsGet('OutLogin')); this.projectHash(RL.settingsGet('ProjectHash')); this.displayName(RL.settingsGet('DisplayName')); @@ -399,7 +400,6 @@ WebMailDataStorage.prototype.populateDataOnStart = function() this.lastFoldersHash = RL.local().get(Enums.ClientSideKeyName.FoldersLashHash) || ''; this.remoteSuggestions = !!RL.settingsGet('RemoteSuggestions'); - this.remoteChangePassword = !!RL.settingsGet('RemoteChangePassword'); this.devEmail = RL.settingsGet('DevEmail'); this.devLogin = RL.settingsGet('DevLogin'); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Account.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Account.php index 04d1ce09d..90a57f9d6 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Account.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Account.php @@ -93,12 +93,40 @@ class Account return 0 < \strlen($this->sParentEmail) ? $this->sParentEmail : $this->sEmail; } + /** + * @return string + */ + public function IncLogin() + { + $sLogin = $this->sLogin; + if ($this->oDomain->IncShortLogin()) + { + $sLogin = \MailSo\Base\Utils::GetAccountNameFromEmail($this->sLogin); + } + + return $sLogin; + } + + /** + * @return string + */ + public function OutLogin() + { + $sLogin = $this->sLogin; + if ($this->oDomain->OutShortLogin()) + { + $sLogin = \MailSo\Base\Utils::GetAccountNameFromEmail($this->sLogin); + } + + return $sLogin; + } + /** * @return string */ public function Login() { - return $this->sLogin; + return $this->IncLogin(); } /** 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 e27344771..819a73ccf 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -291,7 +291,7 @@ class Actions if ($oAccount) { $sFileName = \str_replace('{user:email}', \strtolower($oAccount->Email()), $sFileName); - $sFileName = \str_replace('{user:login}', $oAccount->Login(), $sFileName); + $sFileName = \str_replace('{user:login}', $oAccount->IncLogin(), $sFileName); $sFileName = \str_replace('{user:domain}', \strtolower($oAccount->Domain()->Name()), $sFileName); } @@ -876,7 +876,7 @@ class Actions 'AllowThemes' => (bool) $oConfig->Get('webmail', 'allow_themes', true), 'AllowCustomTheme' => (bool) $oConfig->Get('webmail', 'allow_custom_theme', true), 'SuggestionsLimit' => (int) $oConfig->Get('labs', 'suggestions_limit', 50), - 'RemoteChangePassword' => false, + 'AllowChangePassword' => false, 'ContactsIsSupported' => (bool) $this->ContactsProvider()->IsSupported(), 'ContactsIsAllowed' => (bool) $this->ContactsProvider()->IsActive(), 'JsHash' => \md5(\RainLoop\Utils::GetConnectionToken()), @@ -898,11 +898,12 @@ class Actions $oAccount = $this->getAccountFromToken(false); if ($oAccount instanceof \RainLoop\Account) { - $aResult['Email'] = $oAccount->Email(); - $aResult['Login'] = $oAccount->Login(); $aResult['Auth'] = true; + $aResult['Email'] = $oAccount->Email(); + $aResult['IncLogin'] = $oAccount->IncLogin(); + $aResult['OutLogin'] = $oAccount->OutLogin(); $aResult['AccountHash'] = $oAccount->Hash(); - $aResult['RemoteChangePassword'] = $this->ChangePasswordProvider()->PasswordChangePossibility($oAccount); + $aResult['AllowChangePassword'] = $this->ChangePasswordProvider()->PasswordChangePossibility($oAccount); $oSettings = $this->SettingsProvider()->Load($oAccount); } @@ -1198,15 +1199,9 @@ class Actions try { - $sLogin = $oAccount->Login(); - if ($oAccount->Domain()->IncShortLogin()) - { - $sLogin = \MailSo\Base\Utils::GetAccountNameFromEmail($sLogin); - } - $this->MailClient() ->Connect($oAccount->Domain()->IncHost(), $oAccount->Domain()->IncPort(), $oAccount->Domain()->IncSecure()) - ->Login($sLogin, $oAccount->Password()) + ->Login($oAccount->IncLogin(), $oAccount->Password()) ; } catch (\RainLoop\Exceptions\ClientException $oException) @@ -3724,9 +3719,8 @@ class Actions 'Secure' => $oAccount->Domain()->OutSecure(), 'UseAuth' => $oAccount->Domain()->OutAuth(), 'From' => empty($sFrom) ? $oAccount->Email() : $sFrom, - 'Login' => $oAccount->Login(), + 'Login' => $oAccount->OutLogin(), 'Password' => $oAccount->Password(), - 'UseShortLogin' => $oAccount->Domain()->OutShortLogin(), 'HiddenRcpt' => array() ); @@ -3747,13 +3741,7 @@ class Actions { if ($aSmtpCredentials['UseAuth']) { - $sLogin = $aSmtpCredentials['Login']; - if ($aSmtpCredentials['UseShortLogin']) - { - $sLogin = \MailSo\Base\Utils::GetAccountNameFromEmail($sLogin); - } - - $oSmtpClient->Login($sLogin, $aSmtpCredentials['Password']); + $oSmtpClient->Login($aSmtpCredentials['Login'], $aSmtpCredentials['Password']); } } @@ -4973,7 +4961,7 @@ class Actions { $this->MailClient() ->Connect($oAccount->Domain()->IncHost(), $oAccount->Domain()->IncPort(), $oAccount->Domain()->IncSecure()) - ->Login($oAccount->Login(), $oAccount->Password(), !!$this->Config()->Get('labs', 'use_imap_auth_plain')) + ->Login($oAccount->IncLogin(), $oAccount->Password(), !!$this->Config()->Get('labs', 'use_imap_auth_plain')) ; } catch (\MailSo\Net\Exceptions\ConnectionException $oException) diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php index 1781c8bdf..dff1e7971 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php @@ -377,7 +377,7 @@ class Social { $aUserData = array( 'Email' => $oAccount->Email(), - 'Login' => $oAccount->Login(), + 'Login' => $oAccount->IncLogin(), 'Password' => $oAccount->Password() ); @@ -489,7 +489,7 @@ class Social { $aUserData = array( 'Email' => $oAccount->Email(), - 'Login' => $oAccount->Login(), + 'Login' => $oAccount->IncLogin(), 'Password' => $oAccount->Password() ); @@ -652,7 +652,7 @@ class Social $aUserData = array( 'Email' => $oAccount->Email(), - 'Login' => $oAccount->Login(), + 'Login' => $oAccount->IncLogin(), 'Password' => $oAccount->Password() ); diff --git a/rainloop/v/0.0.0/static/js/app.js b/rainloop/v/0.0.0/static/js/app.js index a82b01f6f..9fd1d32b0 100644 --- a/rainloop/v/0.0.0/static/js/app.js +++ b/rainloop/v/0.0.0/static/js/app.js @@ -12449,14 +12449,14 @@ function WebMailDataStorage() this.devPassword = ''; this.accountEmail = ko.observable(''); - this.accountLogin = ko.observable(''); + this.accountIncLogin = ko.observable(''); + this.accountOutLogin = ko.observable(''); this.projectHash = ko.observable(''); this.threading = ko.observable(false); this.lastFoldersHash = ''; this.remoteSuggestions = false; - this.remoteChangePassword = false; // system folders this.sentFolder = ko.observable(''); @@ -12804,7 +12804,8 @@ WebMailDataStorage.prototype.populateDataOnStart = function() AbstractData.prototype.populateDataOnStart.call(this); this.accountEmail(RL.settingsGet('Email')); - this.accountLogin(RL.settingsGet('Login')); + this.accountIncLogin(RL.settingsGet('IncLogin')); + this.accountOutLogin(RL.settingsGet('OutLogin')); this.projectHash(RL.settingsGet('ProjectHash')); this.displayName(RL.settingsGet('DisplayName')); @@ -12814,7 +12815,6 @@ WebMailDataStorage.prototype.populateDataOnStart = function() this.lastFoldersHash = RL.local().get(Enums.ClientSideKeyName.FoldersLashHash) || ''; this.remoteSuggestions = !!RL.settingsGet('RemoteSuggestions'); - this.remoteChangePassword = !!RL.settingsGet('RemoteChangePassword'); this.devEmail = RL.settingsGet('DevEmail'); this.devLogin = RL.settingsGet('DevLogin'); @@ -15792,7 +15792,7 @@ RainLoopApp.prototype.bootstart = function () bTwitter = this.settingsGet('AllowTwitterSocial') ; - if (!this.settingsGet('RemoteChangePassword')) + if (!this.settingsGet('AllowChangePassword')) { Utils.removeSettingsViewModel(SettingsChangePasswordScreen); } diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index 4d1b96222..b2962dbb5 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -1,8 +1,8 @@ /*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ -!function(a,b,c,d,e,f,g,h){"use strict";function i(){this.sBase="#/",this.sCdnStaticDomain=zb.settingsGet("CdnStaticDomain"),this.sVersion=zb.settingsGet("Version"),this.sSpecSuffix=zb.settingsGet("AuthAccountHash")||"0",this.sServer=(zb.settingsGet("IndexFile")||"./")+"?",this.sCdnStaticDomain=""===this.sCdnStaticDomain?this.sCdnStaticDomain:"/"===this.sCdnStaticDomain.substr(-1)?this.sCdnStaticDomain:this.sCdnStaticDomain+"/"}function j(a,c,d,e){var f={DisableHtml:!1,onSwitch:!1,LangSwitcherConferm:"EDITOR_TEXT_SWITCHER_CONFIRM",LangSwitcherTextLabel:"EDITOR_SWITCHER_TEXT_LABEL",LangSwitcherHtmlLabel:"EDITOR_SWITCHER_HTML_LABEL"};this.bIe=!!/msie/.test(navigator.userAgent.toLowerCase()),e=b.extend(f,nb.isUnd(e)?{}:e),this.oOptions=e,this.bOnlyPlain=!!this.oOptions.DisableHtml,this.fOnSwitch=this.oOptions.onSwitch,this.textarea=b(a).empty().addClass("editorTextArea"),this.htmlarea=b(c).empty().addClass("editorHtmlArea").prop("contentEditable","true"),this.toolbar=b(d).empty().addClass("editorToolbar"),j.htmlInitEditor.apply(this),j.htmlInitToolbar.apply(this),j.htmlAttachEditorEvents.apply(this),this.bOnlyPlain&&this.toolbar.hide()}function k(a,b,c,d,e){this.list=a,this.selectedItem=b,this.selectedItem.extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]}),this.oContentVisible=null,this.oContentScrollable=null,this.sItemSelector=c,this.sItemSelectedSelector=d,this.sItemCheckedSelector=e,this.sLastUid="",this.oCallbacks={},this.iSelectTimer=0,this.bUseKeyboard=!0,this.emptyFunction=function(){},this.useItemSelectCallback=!0,this.throttleSelection=!1,this.selectedItem.subscribe(function(a){this.useItemSelectCallback&&(this.throttleSelection?(this.throttleSelection=!1,this.selectItemCallbacksThrottle(a)):this.selectItemCallbacks(a))},this);var f=this,g=[],i=null;this.list.subscribe(function(){var a=this,b=this.list();nb.isArray(b)&&h.each(b,function(b){b.checked()&&g.push(a.getItemUid(b)),null===i&&b.selected()&&(i=a.getItemUid(b))})},this,"beforeChange"),this.list.subscribe(function(a){if(this.useItemSelectCallback=!1,this.selectedItem(null),nb.isArray(a)){var b=this,c=g.length;h.each(a,function(a){c>0&&-1b?b:a))},this),this.body=null,this.isRtl=c.observable(!1),this.isHtml=c.observable(!1),this.hasImages=c.observable(!1),this.attachments=c.observableArray([]),this.priority=c.observable(lb.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=c.observable(0),this.threads=c.observableArray([]),this.threadsLen=c.observable(0),this.hasUnseenSubMessage=c.observable(!1),this.hasFlaggedSubMessage=c.observable(!1),this.lastInCollapsedThread=c.observable(!1),this.lastInCollapsedThreadLoading=c.observable(!1),this.threadsLenResult=c.computed(function(){var a=this.threadsLen();return 0===this.parentUid()&&a>0?a+1:""},this)}function x(){this.name=c.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.selectable=!1,this.existen=!0,this.isNamespaceFolder=!1,this.isGmailFolder=!1,this.isUnpaddigFolder=!1,this.type=c.observable(lb.FolderType.User),this.selected=c.observable(!1),this.edited=c.observable(!1),this.collapsed=c.observable(!0),this.subScribed=c.observable(!0),this.subFolders=c.observableArray([]),this.deleteAccess=c.observable(!1),this.actionBlink=c.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=c.observable(""),this.name.subscribe(function(a){this.nameForEdit(a)},this),this.edited.subscribe(function(a){a&&this.nameForEdit(this.name())},this),this.canBeEdited=c.computed(function(){return lb.FolderType.User===this.type()},this),this.privateMessageCountAll=c.observable(0),this.privateMessageCountUnread=c.observable(0),this.collapsedPrivate=c.observable(!0)}function y(a,b){this.email=a,this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(b)}function z(a,b,d){this.id=a,this.email=c.observable(b),this.name=c.observable(""),this.replyTo=c.observable(""),this.bcc=c.observable(""),this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(d)}function A(){p.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=c.observable(null),this.clearingProcess=c.observable(!1),this.clearingError=c.observable(""),this.folderFullNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.printableFullName():""},this),this.folderNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.localName():""},this),this.dangerDescHtml=c.computed(function(){return nb.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=nb.createCommand(this,function(){var a=this,b=this.selectedFolder();b&&(zb.data().message(null),zb.data().messageList([]),this.clearingProcess(!0),zb.cache().setFolderHash(b.fullNameRaw,""),zb.remote().folderClear(function(b,c){a.clearingProcess(!1),lb.StorageResultType.Success===b&&c&&c.Result?(zb.reloadMessageList(!0),a.cancelCommand()):c&&c.ErrorCode?a.clearingError(nb.getNotification(c.ErrorCode)):a.clearingError(nb.getNotification(lb.Notification.MailServerError))},b.fullNameRaw))},function(){var a=this.selectedFolder(),b=this.clearingProcess();return!b&&null!==a})}function B(){p.call(this,"Popups","PopupsFolderCreate"),nb.initOnStartOrLangChange(function(){this.sNoParentText=nb.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=c.observable(""),this.focusTrigger=c.observable(!1),this.selectedParentValue=c.observable(kb.Values.UnuseOptionValue),this.parentFolderSelectList=c.computed(function(){var a=zb.data(),b=[],c=null,d=null,e=a.folderList(),f=function(a){return a?a.isSystemFolder()?a.name()+" "+a.manageFolderSystemName():a.name():""};return b.push(["",this.sNoParentText]),""!==a.namespace&&(c=function(b){return a.namespace!==b.fullNameRaw.substr(0,a.namespace.length)}),zb.folderListOptionsBuilder([],e,[],b,null,c,d,f)},this),this.createFolder=nb.createCommand(this,function(){var a=zb.data(),b=this.selectedParentValue();""===b&&1b;b++)d.push(a[b].toLine(!1));return d.join(", ")},e=function(a){!1===this.showCcAndBcc()&&01||g>0&&f>g){for(f>g?(h(g),b=g,c=g):((3>=f||f>=g-2)&&(d+=2),h(f),b=f,c=f);d>0;)if(b-=1,c+=1,b>0&&(h(b,!1),d--),g>=c)h(c,!0),d--;else if(0>=b)break;3===b?h(2,!1):b>3&&h(Math.round((b-1)/2),!1,"..."),g-2===c?h(g-1,!0):g-2>c&&h(Math.round((g+c)/2),!0,"..."),b>1&&h(1,!1),g>c&&h(g,!0)}return e},this),this.checkAll=c.computed({read:function(){return 00&&b>0&&a>b},this),this.hasMessages=c.computed(function(){return 0'),e.after(f),e.remove()),f&&f[0]&&f.attr("data-href",g).attr("data-theme",a[0]).text(a[1]),d.themeTrigger(lb.SaveSettingsStep.TrueResult))}).always(function(){d.iTimer=a.setTimeout(function(){d.themeTrigger(lb.SaveSettingsStep.Idle)},1e3),d.oLastAjax=null})),zb.remote().saveSettings(null,{Theme:c})},this)}function $(){nb.initDataConstructorBySettings(this)}function _(){$.call(this);var a=function(a){return function(){var b=zb.cache().getFolderFromCacheList(a());b&&b.type(lb.FolderType.User)}},d=function(a){return function(b){var c=zb.cache().getFolderFromCacheList(b);c&&c.type(a)}};this.devEmail="",this.devLogin="",this.devPassword="",this.accountEmail=c.observable(""),this.accountLogin=c.observable(""),this.projectHash=c.observable(""),this.threading=c.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.remoteChangePassword=!1,this.sentFolder=c.observable(""),this.draftFolder=c.observable(""),this.spamFolder=c.observable(""),this.trashFolder=c.observable(""),this.sentFolder.subscribe(a(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(a(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(a(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(a(this.trashFolder),this,"beforeChange"),this.sentFolder.subscribe(d(lb.FolderType.SentItems),this),this.draftFolder.subscribe(d(lb.FolderType.Draft),this),this.spamFolder.subscribe(d(lb.FolderType.Spam),this),this.trashFolder.subscribe(d(lb.FolderType.Trash),this),this.draftFolderNotEnabled=c.computed(function(){return""===this.draftFolder()||kb.Values.UnuseOptionValue===this.draftFolder()},this),this.displayName=c.observable(""),this.signature=c.observable(""),this.replyTo=c.observable(""),this.accounts=c.observableArray([]),this.accountsLoading=c.observable(!1).extend({throttle:100}),this.identities=c.observableArray([]),this.identitiesLoading=c.observable(!1).extend({throttle:100}),this.namespace="",this.folderList=c.observableArray([]),this.foldersListError=c.observable(""),this.foldersLoading=c.observable(!1),this.foldersCreating=c.observable(!1),this.foldersDeleting=c.observable(!1),this.foldersRenaming=c.observable(!1),this.currentFolder=c.observable(null).extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]}),this.currentFolderFullNameRaw=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=c.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=c.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=c.computed(function(){var a=["INBOX"],b=this.folderList(),c=this.sentFolder(),d=this.draftFolder(),e=this.spamFolder(),f=this.trashFolder();return nb.isArray(b)&&00?Math.ceil(b/a*100):0},this),this.useKeyboardShortcuts=c.observable(!0),this.googleActions=c.observable(!1),this.googleLoggined=c.observable(!1),this.googleUserName=c.observable(""),this.facebookActions=c.observable(!1),this.facebookLoggined=c.observable(!1),this.facebookUserName=c.observable(""),this.twitterActions=c.observable(!1),this.twitterLoggined=c.observable(!1),this.twitterUserName=c.observable(""),this.customThemeType=c.observable(lb.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=h.throttle(this.purgeMessageBodyCache,3e4)}function ab(){this.oRequests={}}function bb(){ab.call(this),this.oRequests={}}function cb(){this.oEmailsPicsHashes={},this.oServices={}}function db(){cb.call(this),this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={}}function eb(a){q.call(this,"settings",a),this.menu=c.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}function fb(){q.call(this,"login",[J])}function gb(){q.call(this,"mailbox",[L,N,O,P]),this.oLastRoute={}}function hb(){eb.call(this,[M,Q,R]),nb.initOnStartOrLangChange(function(){this.sSettingsTitle=nb.i18n("TITLES/SETTINGS")},this,function(){zb.setTitle(this.sSettingsTitle)})}function ib(){o.call(this),this.oSettings=null,this.oPlugins=null,this.oLink=null,this.oLocal=null,this.isLocalAutocomplete=!0,this.popupVisibility=c.observable(!1),this.iframe=b('