Small fixes

This commit is contained in:
RainLoop Team 2015-11-27 19:52:19 +03:00
parent 3887073016
commit d844938ee3
6 changed files with 34 additions and 8 deletions

View file

@ -8923,6 +8923,14 @@ class Actions
$sDefault = $sDefault.'_'.$sDefault;
}
$sLanguage = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) {
return \strtoupper($aData[0]);
}, $sLanguage);
$sDefault = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) {
return \strtoupper($aData[0]);
}, $sDefault);
if (\in_array($sLanguage, $aLang))
{
$sResult = $sLanguage;
@ -8935,8 +8943,8 @@ class Actions
if (empty($sResult) && !$bAllowEmptyResult)
{
$sResult = $this->Config()->Get('webmail', $bAdmin ? 'language_admin' : 'language', 'en_us');
$sResult = \in_array($sResult, $aLang) ? $sResult : 'en_us';
$sResult = $this->Config()->Get('webmail', $bAdmin ? 'language_admin' : 'language', 'en_US');
$sResult = \in_array($sResult, $aLang) ? $sResult : 'en_US';
}
}
@ -9063,7 +9071,7 @@ class Actions
{
if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4))
{
$sLang = \strtolower(\substr($sFile, 0, -4));
$sLang = \substr($sFile, 0, -4);
if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang)
{
\array_push($aList, $sLang);
@ -9482,11 +9490,13 @@ class Actions
if (null === $aLang)
{
$sLang = $this->ValidateLanguage($sLang, 'en');
$aLang = array();
// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/i18n/langs.ini', $aLang);
// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'langs/'.$sLang.'.ini', $aLang);
\RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aLang);
\RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.ini', $aLang);
\RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.yml', $aLang);
$this->Plugins()->ReadLang($sLang, $aLang);
}

View file

@ -226,6 +226,8 @@ class ServiceActions
*/
public function ServiceOwnCloudAuth()
{
$this->oHttp->ServerNoCache();
if (!\RainLoop\Utils::IsOwnCloud() ||
!isset($_ENV['___rainloop_owncloud_email']) ||
!isset($_ENV['___rainloop_owncloud_password']) ||
@ -840,6 +842,8 @@ class ServiceActions
*/
public function ServiceMailto()
{
$this->oHttp->ServerNoCache();
$sTo = \trim($this->oHttp->GetQuery('to', ''));
if (!empty($sTo) && \preg_match('/^mailto:/i', $sTo))
{
@ -859,6 +863,8 @@ class ServiceActions
*/
public function ServicePing()
{
$this->oHttp->ServerNoCache();
@\header('Content-Type: text/plain; charset=utf-8');
$this->oActions->Logger()->Write('Pong', \MailSo\Log\Enumerations\Type::INFO, 'PING');
return 'Pong';
@ -869,6 +875,8 @@ class ServiceActions
*/
public function ServiceInfo()
{
$this->oHttp->ServerNoCache();
if ($this->oActions->IsAdminLoggined(false))
{
@\header('Content-Type: text/html; charset=utf-8');
@ -881,6 +889,8 @@ class ServiceActions
*/
public function ServiceSso()
{
$this->oHttp->ServerNoCache();
$oException = null;
$oAccount = null;
$bLogout = true;
@ -997,6 +1007,8 @@ class ServiceActions
*/
public function ServiceExternalLogin()
{
$this->oHttp->ServerNoCache();
$oException = null;
$oAccount = null;
$bLogout = true;
@ -1063,6 +1075,8 @@ class ServiceActions
*/
public function ServiceExternalSso()
{
$this->oHttp->ServerNoCache();
$sResult = '';
$bLogout = true;
$sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', '');
@ -1104,6 +1118,8 @@ class ServiceActions
*/
public function ServiceChange()
{
$this->oHttp->ServerNoCache();
$oAccount = $this->oActions->GetAccount();
if ($oAccount && $this->oActions->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount))