domain short login configuration fix

This commit is contained in:
RainLoop Team 2013-11-19 19:42:52 +04:00
parent 6f258f2c60
commit 803217d5d5
7 changed files with 57 additions and 41 deletions

View file

@ -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();
}
/**

View file

@ -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)

View file

@ -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()
);