mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Add Simplified Chinese language.
Update language popup. + Merge conflict origin/master
This commit is contained in:
commit
101f956fa8
25 changed files with 1055 additions and 458 deletions
|
|
@ -23,17 +23,17 @@ class FetchResponse
|
|||
*
|
||||
* @param \MailSo\Imap\Response $oImapResponse
|
||||
*/
|
||||
private function __construct(&$oImapResponse)
|
||||
private function __construct($oImapResponse)
|
||||
{
|
||||
$this->oImapResponse =& $oImapResponse;
|
||||
$this->oImapResponse = $oImapResponse;
|
||||
$this->aEnvelopeCache = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Imap\Response &$oImapResponse
|
||||
* @param \MailSo\Imap\Response $oImapResponse
|
||||
* @return \MailSo\Imap\FetchResponse
|
||||
*/
|
||||
public static function NewInstance(&$oImapResponse)
|
||||
public static function NewInstance($oImapResponse)
|
||||
{
|
||||
return new self($oImapResponse);
|
||||
}
|
||||
|
|
@ -133,22 +133,22 @@ class FetchResponse
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function &GetFetchValue($sFetchItemName)
|
||||
public function GetFetchValue($sFetchItemName)
|
||||
{
|
||||
$mReturn = null;
|
||||
$bNextIsValue = false;
|
||||
|
||||
if (Enumerations\FetchType::INDEX === $sFetchItemName)
|
||||
{
|
||||
$mReturn =& $this->oImapResponse->ResponseList[1];
|
||||
$mReturn = $this->oImapResponse->ResponseList[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($this->oImapResponse->ResponseList[3] as &$mItem)
|
||||
foreach ($this->oImapResponse->ResponseList[3] as $mItem)
|
||||
{
|
||||
if ($bNextIsValue)
|
||||
{
|
||||
$mReturn =& $mItem;
|
||||
$mReturn = $mItem;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ class FetchResponse
|
|||
|
||||
if (isset($this->oImapResponse->ResponseList[3]) && \is_array($this->oImapResponse->ResponseList[3]))
|
||||
{
|
||||
foreach ($this->oImapResponse->ResponseList[3] as &$mItem)
|
||||
foreach ($this->oImapResponse->ResponseList[3] as $mItem)
|
||||
{
|
||||
if ($bNextIsValue)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -898,7 +898,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
$aReturn = array();
|
||||
$oImapResponse = null;
|
||||
foreach ($aResult as &$oImapResponse)
|
||||
foreach ($aResult as $oImapResponse)
|
||||
{
|
||||
if (FetchResponse::IsValidFetchImapResponse($oImapResponse))
|
||||
{
|
||||
|
|
@ -1089,13 +1089,13 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
private function validateThreadItem($aValue)
|
||||
{
|
||||
$mResult = false;
|
||||
if (is_numeric($aValue))
|
||||
if (\is_numeric($aValue))
|
||||
{
|
||||
$mResult = (int) $aValue;
|
||||
}
|
||||
else if (is_array($aValue))
|
||||
else if (\is_array($aValue))
|
||||
{
|
||||
if (1 === count($aValue) && is_numeric($aValue[0]))
|
||||
if (1 === count($aValue) && \is_numeric($aValue[0]))
|
||||
{
|
||||
$mResult = (int) $aValue[0];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -1631,15 +1626,19 @@ class Actions
|
|||
*/
|
||||
public function DoAppDelayStart()
|
||||
{
|
||||
$this->Plugins()->RunHook('service.app-delay-start-begin');
|
||||
|
||||
\RainLoop\Utils::UpdateConnectionToken();
|
||||
|
||||
$bMainCache = false;
|
||||
$bFilesCache = false;
|
||||
$bActivity = false;
|
||||
$bPing = false;
|
||||
$bReHash = false;
|
||||
|
||||
$iOneDay1 = 60 * 60 * 23;
|
||||
$iOneDay2 = 60 * 60 * 25;
|
||||
$iOneDay3 = $iOneDay2 * 2;
|
||||
|
||||
$sTimers = $this->StorageProvider()->Get(null,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, 'Cache/Timers', '');
|
||||
|
|
@ -1650,6 +1649,7 @@ class Actions
|
|||
$iFilesCacheTime = !empty($aTimers[1]) && \is_numeric($aTimers[1]) ? (int) $aTimers[1] : 0;
|
||||
$iActivityTime = !empty($aTimers[2]) && \is_numeric($aTimers[2]) ? (int) $aTimers[2] : 0;
|
||||
$iPingTime = !empty($aTimers[3]) && \is_numeric($aTimers[3]) ? (int) $aTimers[3] : 0;
|
||||
$iReHashTime = !empty($aTimers[4]) && \is_numeric($aTimers[4]) ? (int) $aTimers[4] : 0;
|
||||
|
||||
if (0 === $iMainCacheTime || $iMainCacheTime + $iOneDay1 < \time())
|
||||
{
|
||||
|
|
@ -1675,13 +1675,19 @@ class Actions
|
|||
$iPingTime = \time();
|
||||
}
|
||||
|
||||
if ($bMainCache || $bFilesCache || $bActivity || $bPing)
|
||||
if (0 === $iReHashTime || $iReHashTime + $iOneDay3 < \time())
|
||||
{
|
||||
$bReHash = true;
|
||||
$iReHashTime = \time();
|
||||
}
|
||||
|
||||
if ($bMainCache || $bFilesCache || $bActivity || $bPing || $bReHash)
|
||||
{
|
||||
if (!$this->StorageProvider()->Put(null,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, 'Cache/Timers',
|
||||
\implode(',', array($iMainCacheTime, $iFilesCacheTime, $iActivityTime, $iPingTime))))
|
||||
{
|
||||
$bMainCache = $bFilesCache = $bActivity = $bPing = false;
|
||||
$bMainCache = $bFilesCache = $bActivity = $bPing = $bReHash = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1711,6 +1717,15 @@ class Actions
|
|||
$this->KeenIO('Ping');
|
||||
}
|
||||
|
||||
if ($bReHash)
|
||||
{
|
||||
$sHash = \RainLoop\Utils::PathMD5(APP_VERSION_ROOT_PATH);
|
||||
$this->Logger()->Write('App Hash: '.$sHash);
|
||||
@\file_put_contents(APP_DATA_FOLDER_PATH.'HASH', $sHash);
|
||||
}
|
||||
|
||||
$this->Plugins()->RunHook('service.app-delay-start-end');
|
||||
|
||||
return $this->TrueResponse(__FUNCTION__);
|
||||
}
|
||||
|
||||
|
|
@ -3704,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()
|
||||
);
|
||||
|
||||
|
|
@ -3727,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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4953,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)
|
||||
|
|
@ -5175,6 +5183,7 @@ class Actions
|
|||
private function setupInformation()
|
||||
{
|
||||
$aResult = array(
|
||||
'hash' => \file_exists(APP_DATA_FOLDER_PATH.'HASH') ? @\file_get_contents(APP_DATA_FOLDER_PATH.'HASH') : '',
|
||||
'version-full' => APP_VERSION,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -178,11 +178,18 @@ class Service
|
|||
$bCached = true;
|
||||
}
|
||||
|
||||
$sAppHash = '';
|
||||
if (\file_exists(APP_DATA_FOLDER_PATH.'HASH'))
|
||||
{
|
||||
$sAppHash = @\file_get_contents(APP_DATA_FOLDER_PATH.'HASH');
|
||||
}
|
||||
|
||||
$sResult .= '<!--';
|
||||
$sResult .= ' [version:'.APP_VERSION;
|
||||
$sResult .= '][time:'.substr(\microtime(true) - APP_START, 0, 6);
|
||||
$sResult .= '][cached:'.($bCached ? 'true' : 'false');
|
||||
$sResult .= '][session:'.md5(\RainLoop\Utils::GetShortToken());
|
||||
$sResult .= '][hash:'.$sAppHash;
|
||||
$sResult .= '] -->';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue