More useful "auth_logging_format" setting

This commit is contained in:
RainLoop Team 2015-05-18 21:23:48 +04:00
parent 0035505659
commit 9cfb6a9452
5 changed files with 26 additions and 10 deletions

View file

@ -40,7 +40,7 @@
"plugins" "plugins"
], ],
"readmeFilename": "README.md", "readmeFilename": "README.md",
"ownCloudPackageVersion": "4.1", "ownCloudPackageVersion": "4.2",
"engines": { "engines": {
"node": ">= 0.10.0" "node": ">= 0.10.0"
}, },

View file

@ -94,6 +94,11 @@ class Folder
if (0 < \strlen($this->sDelimiter)) if (0 < \strlen($this->sDelimiter))
{ {
$aNames = \explode($this->sDelimiter, $this->sFullNameRaw); $aNames = \explode($this->sDelimiter, $this->sFullNameRaw);
if (false !== \array_search('', $aNames))
{
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
}
$this->sNameRaw = \end($aNames); $this->sNameRaw = \end($aNames);
} }
} }

View file

@ -189,10 +189,17 @@ class FolderCollection extends \MailSo\Base\Collection
? $sDelimiter.$sFolderExplodeItem : $sFolderExplodeItem; ? $sDelimiter.$sFolderExplodeItem : $sFolderExplodeItem;
if (!isset($aSortedByLenImapFolders[$sNonExistenFolderFullNameRaw])) if (!isset($aSortedByLenImapFolders[$sNonExistenFolderFullNameRaw]))
{
try
{ {
$aAddedFolders[$sNonExistenFolderFullNameRaw] = $aAddedFolders[$sNonExistenFolderFullNameRaw] =
Folder::NewNonExistenInstance($sNonExistenFolderFullNameRaw, $sDelimiter); Folder::NewNonExistenInstance($sNonExistenFolderFullNameRaw, $sDelimiter);
} }
catch (\Exception $oExc)
{
unset($oExc);
}
}
} }
} }
} }

View file

@ -1077,9 +1077,13 @@ class Actions
$this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME); $this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME);
$this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME_DELTA); $this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME_DELTA);
$this->oLoggerAuth->Add( $oDriver = \MailSo\Log\Drivers\File::NewInstance($sAuthLogFileFullPath);
\MailSo\Log\Drivers\File::NewInstance($sAuthLogFileFullPath)
); $oDriver->DisableTimePrefix();
$oDriver->DisableGuidPrefix();
$oDriver->DisableTypedPrefix();
$this->oLoggerAuth->Add($oDriver);
} }
} }

View file

@ -221,7 +221,7 @@ Examples:
'auth_logging' => array(false, 'Enable auth logging in a separate file (for fail2ban)'), 'auth_logging' => array(false, 'Enable auth logging in a separate file (for fail2ban)'),
'auth_logging_filename' => array('fail2ban/auth-{date:Y-m-d}.txt'), 'auth_logging_filename' => array('fail2ban/auth-{date:Y-m-d}.txt'),
'auth_logging_format' => array('Auth failed: ip={request:ip} user={imap:login} host={imap:host} port={imap:port}') 'auth_logging_format' => array('[{date:Y-m-d H:i:s}] Auth failed: ip={request:ip} user={imap:login} host={imap:host} port={imap:port}')
), ),
'debug' => array( 'debug' => array(