Add additional logging for OpenPGP

Remove enforcing lower case for email addresses
Small fixes
This commit is contained in:
RainLoop Team 2015-08-26 21:04:50 +03:00
parent 436e54891e
commit 3498700f61
11 changed files with 89 additions and 17 deletions

View file

@ -550,6 +550,22 @@ END;
return \MailSo\Base\Utils::IsAscii($sValue) ? \strtoupper($sValue) : $sValue;
}
/**
* @param string $sValue
*
* @return string
*/
public static function StrMailDomainToLowerIfAscii($sValue)
{
$aParts = \explode('@', $sValue, 2);
if (!empty($aParts[1]))
{
$aParts[1] = \MailSo\Base\Utils::IsAscii($aParts[1]) ? \strtolower($aParts[1]) : $aParts[1];
}
return \implode('@', $aParts);
}
/**
* @param string $sValue
*
@ -2415,7 +2431,7 @@ END;
catch (\Exception $oException) {}
}
return $bLowerIfAscii ? \MailSo\Base\Utils::StrToLowerIfAscii($sStr) : $sStr;
return $bLowerIfAscii ? \MailSo\Base\Utils::StrMailDomainToLowerIfAscii($sStr) : $sStr;
}
/**
@ -2426,7 +2442,7 @@ END;
*/
public static function IdnToAscii($sStr, $bLowerIfAscii = false)
{
$sStr = $bLowerIfAscii ? \MailSo\Base\Utils::StrToLowerIfAscii($sStr) : $sStr;
$sStr = $bLowerIfAscii ? \MailSo\Base\Utils::StrMailDomainToLowerIfAscii($sStr) : $sStr;
$sUser = '';
$sDomain = $sStr;

View file

@ -213,12 +213,31 @@ class Actions
{
$this->oConfig = new \RainLoop\Config\Application();
// $bSave = defined('APP_INSTALLED_START');
// if (!$this->oConfig->Load())
// {
// $bSave = true;
// }
// else if (!$bSave)
// {
// $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current');
// }
$bSave = defined('APP_INSTALLED_START');
if (!$this->oConfig->Load())
$bLoaded = $this->oConfig->Load();
if (!$bLoaded && !$bSave)
{
usleep(10000); // TODO
$bLoaded = $this->oConfig->Load();
}
if (!$bLoaded && !$this->oConfig->IsFileExists())
{
$bSave = true;
}
else if (!$bSave)
if ($bLoaded && !$bSave)
{
$bSave = APP_VERSION !== $this->oConfig->Get('version', 'current');
}
@ -1996,8 +2015,7 @@ class Actions
{
$this->Plugins()->RunHook('filter.login-credentials.step-1', array(&$sEmail, &$sPassword));
$sEmail = \MailSo\Base\Utils::StrToLowerIfAscii(
\MailSo\Base\Utils::Trim($sEmail));
$sEmail = \MailSo\Base\Utils::StrToLowerIfAscii(\MailSo\Base\Utils::Trim($sEmail));
if (false === \strpos($sEmail, '@'))
{

View file

@ -202,6 +202,14 @@ abstract class AbstractConfig
return false;
}
/**
* @return bool
*/
public function IsFileExists()
{
return \file_exists($this->sFile);
}
/**
* @return bool
*/

View file

@ -141,7 +141,7 @@ class Property
// lower
if ($this->IsEmail())
{
$this->Value = \MailSo\Base\Utils::StrToLowerIfAscii($this->Value);
$this->Value = \MailSo\Base\Utils::StrMailDomainToLowerIfAscii($this->Value);
}
if ($this->IsName())