mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 15:37:03 +03:00
Added [labs]forse_https settins
This commit is contained in:
parent
74b09e93df
commit
1a1be5c63a
3 changed files with 15 additions and 8 deletions
|
|
@ -49,7 +49,7 @@ class Api
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::Config()->Get('labs', 'disable_iconv_if_mbstring_supported') &&
|
if (self::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
|
||||||
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
||||||
{
|
{
|
||||||
\MailSo\Capa::$ICONV = false;
|
\MailSo\Capa::$ICONV = false;
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@ Enables caching in the system'),
|
||||||
'curl_proxy' => array(''),
|
'curl_proxy' => array(''),
|
||||||
'curl_proxy_auth' => array(''),
|
'curl_proxy_auth' => array(''),
|
||||||
'in_iframe' => array(false),
|
'in_iframe' => array(false),
|
||||||
|
'forse_https' => array(false),
|
||||||
'custom_login_link' => array(''),
|
'custom_login_link' => array(''),
|
||||||
'custom_logout_link' => array(''),
|
'custom_logout_link' => array(''),
|
||||||
'allow_external_login' => array(false),
|
'allow_external_login' => array(false),
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class Service
|
||||||
$this->oActions = Actions::NewInstance();
|
$this->oActions = Actions::NewInstance();
|
||||||
|
|
||||||
\set_error_handler(array(&$this, 'LogPhpErrorHandler'));
|
\set_error_handler(array(&$this, 'LogPhpErrorHandler'));
|
||||||
|
|
||||||
$this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions);
|
$this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions);
|
||||||
|
|
||||||
if ($this->oActions->Config()->Get('debug', 'enable', false))
|
if ($this->oActions->Config()->Get('debug', 'enable', false))
|
||||||
|
|
@ -37,7 +37,7 @@ class Service
|
||||||
\ini_set('display_errors', 1);
|
\ini_set('display_errors', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->oActions->Config()->Get('labs', 'disable_iconv_if_mbstring_supported') &&
|
if ($this->oActions->Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
|
||||||
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
||||||
{
|
{
|
||||||
\MailSo\Capa::$ICONV = false;
|
\MailSo\Capa::$ICONV = false;
|
||||||
|
|
@ -48,6 +48,12 @@ class Service
|
||||||
{
|
{
|
||||||
@\header('Server: '.$sServer, true);
|
@\header('Server: '.$sServer, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->oActions->Config()->Get('labs', 'forse_https', false) && !$this->oHttp->IsSecure())
|
||||||
|
{
|
||||||
|
@\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,7 +69,7 @@ class Service
|
||||||
* @param string $sErrStr
|
* @param string $sErrStr
|
||||||
* @param string $sErrFile
|
* @param string $sErrFile
|
||||||
* @param int $iErrLine
|
* @param int $iErrLine
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function LogPhpErrorHandler($iErrNo, $sErrStr, $sErrFile, $iErrLine)
|
public function LogPhpErrorHandler($iErrNo, $sErrStr, $sErrFile, $iErrLine)
|
||||||
|
|
@ -84,7 +90,7 @@ class Service
|
||||||
$this->oActions->Logger()->Write($sErrFile.' [line:'.$iErrLine.', code:'.$iErrNo.']', $iType, 'PHP');
|
$this->oActions->Logger()->Write($sErrFile.' [line:'.$iErrLine.', code:'.$iErrNo.']', $iType, 'PHP');
|
||||||
$this->oActions->Logger()->Write('Error: '.$sErrStr, $iType, 'PHP');
|
$this->oActions->Logger()->Write('Error: '.$sErrStr, $iType, 'PHP');
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +103,7 @@ class Service
|
||||||
{
|
{
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oActions->ParseQueryAuthString();
|
$this->oActions->ParseQueryAuthString();
|
||||||
|
|
||||||
if (defined('APP_INSTALLED_START') && defined('APP_INSTALLED_VERSION') &&
|
if (defined('APP_INSTALLED_START') && defined('APP_INSTALLED_VERSION') &&
|
||||||
|
|
@ -115,7 +121,7 @@ class Service
|
||||||
{
|
{
|
||||||
$sQuery = \substr($sQuery, 0, $iPos);
|
$sQuery = \substr($sQuery, 0, $iPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oActions->Plugins()->RunHook('filter.http-query', array(&$sQuery));
|
$this->oActions->Plugins()->RunHook('filter.http-query', array(&$sQuery));
|
||||||
$aPaths = \explode('/', $sQuery);
|
$aPaths = \explode('/', $sQuery);
|
||||||
$this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths));
|
$this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths));
|
||||||
|
|
@ -136,7 +142,7 @@ class Service
|
||||||
{
|
{
|
||||||
echo $this->oActions->ErrorTemplates('Access Denied.',
|
echo $this->oActions->ErrorTemplates('Access Denied.',
|
||||||
'Access to the RainLoop Webmail Admin Panel is not allowed!', true);
|
'Access to the RainLoop Webmail Admin Panel is not allowed!', true);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue