mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 15:37:03 +03:00
CRLF to LF
This commit is contained in:
parent
4468d5bd22
commit
6e0d0b3b6e
209 changed files with 23729 additions and 22109 deletions
|
|
@ -1,40 +1,40 @@
|
|||
<?php
|
||||
|
||||
class AddXOriginatingIpHeaderPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
public function Init()
|
||||
{
|
||||
$this->addHook('filter.build-message', 'FilterBuildMessage');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Message $oMessage
|
||||
*/
|
||||
public function FilterBuildMessage(&$oMessage)
|
||||
{
|
||||
if ($oMessage instanceof \MailSo\Mime\Message)
|
||||
{
|
||||
$sIP = $this->Manager()->Actions()->Http()->GetClientIp(
|
||||
!!$this->Config()->Get('plugin', 'check_proxy', false));
|
||||
|
||||
$oMessage->SetCustomHeader(
|
||||
\MailSo\Mime\Enumerations\Header::X_ORIGINATING_IP,
|
||||
$this->Manager()->Actions()->Http()->IsLocalhost($sIP) ? '127.0.0.1' : $sIP
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function configMapping()
|
||||
{
|
||||
return array(
|
||||
\RainLoop\Plugins\Property::NewInstance('check_proxy')
|
||||
->SetLabel('Сheck User Proxy')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
|
||||
->SetDescription('Enable, if you need to check proxy header')
|
||||
->SetDefaultValue(false)
|
||||
);
|
||||
}
|
||||
<?php
|
||||
|
||||
class AddXOriginatingIpHeaderPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
public function Init()
|
||||
{
|
||||
$this->addHook('filter.build-message', 'FilterBuildMessage');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \MailSo\Mime\Message $oMessage
|
||||
*/
|
||||
public function FilterBuildMessage(&$oMessage)
|
||||
{
|
||||
if ($oMessage instanceof \MailSo\Mime\Message)
|
||||
{
|
||||
$sIP = $this->Manager()->Actions()->Http()->GetClientIp(
|
||||
!!$this->Config()->Get('plugin', 'check_proxy', false));
|
||||
|
||||
$oMessage->SetCustomHeader(
|
||||
\MailSo\Mime\Enumerations\Header::X_ORIGINATING_IP,
|
||||
$this->Manager()->Actions()->Http()->IsLocalhost($sIP) ? '127.0.0.1' : $sIP
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function configMapping()
|
||||
{
|
||||
return array(
|
||||
\RainLoop\Plugins\Property::NewInstance('check_proxy')
|
||||
->SetLabel('Сheck User Proxy')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
|
||||
->SetDescription('Enable, if you need to check proxy header')
|
||||
->SetDefaultValue(false)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue