mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 12:32:40 +08:00
Improved logging
Small fixes
This commit is contained in:
parent
187e44607d
commit
6c28b24aaf
11 changed files with 301 additions and 246 deletions
|
@ -951,64 +951,67 @@ class Utils
|
|||
\str_replace($aJsonReplaces[0], $aJsonReplaces[1], $sText));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aInput
|
||||
*/
|
||||
public static function ClearArrayUtf8Values(&$aInput)
|
||||
{
|
||||
if (\is_array($aInput))
|
||||
{
|
||||
foreach ($aInput as $mKey => $mItem)
|
||||
{
|
||||
if (\is_string($mItem))
|
||||
{
|
||||
$aInput[$mKey] = \MailSo\Base\Utils::Utf8Clear($mItem);
|
||||
}
|
||||
else if (\is_array($mItem))
|
||||
{
|
||||
\MailSo\Base\Utils::ClearArrayUtf8Values($mItem);
|
||||
$aInput[$mKey] = $mItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $mInput
|
||||
* @param \MailSo\Log\Logger|null $oLogger = null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function Php2js($mInput)
|
||||
public static function Php2js($mInput, $oLogger = null)
|
||||
{
|
||||
return \json_encode($mInput, \defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0);
|
||||
static $iOpt = null;
|
||||
if (null === $iOpt)
|
||||
{
|
||||
$iOpt = \defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0;
|
||||
}
|
||||
|
||||
// if (\is_null($mInput))
|
||||
// {
|
||||
// return 'null';
|
||||
// }
|
||||
// else if ($mInput === false)
|
||||
// {
|
||||
// return 'false';
|
||||
// }
|
||||
// else if ($mInput === true)
|
||||
// {
|
||||
// return 'true';
|
||||
// }
|
||||
// else if (\is_scalar($mInput))
|
||||
// {
|
||||
// if (\is_float($mInput))
|
||||
// {
|
||||
// $mInput = \str_replace(',', '.', \strval($mInput));
|
||||
// }
|
||||
//
|
||||
// return '"'.\MailSo\Base\Utils::InlineRebuildStringToJsString($mInput).'"';
|
||||
// }
|
||||
//
|
||||
// $bIsList = true;
|
||||
// for ($iIndex = 0, \reset($mInput), $iLen = \count($mInput); $iIndex < $iLen; $iIndex++, \next($mInput))
|
||||
// {
|
||||
// if (\key($mInput) !== $iIndex)
|
||||
// {
|
||||
// $bIsList = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $aResult = array();
|
||||
// if ($bIsList)
|
||||
// {
|
||||
// foreach ($mInput as $mValue)
|
||||
// {
|
||||
// $aResult[] = \MailSo\Base\Utils::Php2js($mValue);
|
||||
// }
|
||||
// return '['.\join(',', $aResult).']';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// foreach ($mInput as $sKey => $mValue)
|
||||
// {
|
||||
// $aResult[] = \MailSo\Base\Utils::Php2js($sKey).':'.\MailSo\Base\Utils::Php2js($mValue);
|
||||
// }
|
||||
// return '{'.\join(',', $aResult).'}';
|
||||
// }
|
||||
$sResult = @\json_encode($mInput, $iOpt);
|
||||
if (!\is_string($sResult) || '' === $sResult)
|
||||
{
|
||||
if ($oLogger instanceof \MailSo\Log\Logger)
|
||||
{
|
||||
$oLogger->Write('json_encode: '.\trim(
|
||||
(\MailSo\Base\Utils::FunctionExistsAndEnabled('json_last_error') ? ' [Error Code: '.\json_last_error().']' : '').
|
||||
(\MailSo\Base\Utils::FunctionExistsAndEnabled('json_last_error_msg') ? ' [Error Message: '.\json_last_error_msg().']' : '')
|
||||
), \MailSo\Log\Enumerations\Type::WARNING, 'JSON'
|
||||
);
|
||||
}
|
||||
|
||||
if (\is_array($mInput))
|
||||
{
|
||||
if ($oLogger instanceof \MailSo\Log\Logger)
|
||||
{
|
||||
$oLogger->Write('Try to clear Utf8 before json_encode', \MailSo\Log\Enumerations\Type::INFO, 'JSON');
|
||||
}
|
||||
|
||||
\MailSo\Base\Utils::ClearArrayUtf8Values($mInput);
|
||||
$sResult = @\json_encode($mInput, $iOpt);
|
||||
}
|
||||
}
|
||||
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -357,8 +357,8 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$this->aCapabilityItems = $this->Capability();
|
||||
}
|
||||
|
||||
return $bResult && is_array($this->aCapabilityItems) &&
|
||||
in_array(strtoupper($sExtentionName), $this->aCapabilityItems);
|
||||
return $bResult && \is_array($this->aCapabilityItems) &&
|
||||
\in_array(\strtoupper($sExtentionName), $this->aCapabilityItems);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -498,14 +498,14 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
$aReturn = array();
|
||||
|
||||
if (is_array($aResult))
|
||||
if (\is_array($aResult))
|
||||
{
|
||||
$oImapResponse = null;
|
||||
foreach ($aResult as /* @var $oImapResponse \MailSo\Imap\Response */ $oImapResponse)
|
||||
{
|
||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType &&
|
||||
'STATUS' === $oImapResponse->StatusOrIndex && isset($oImapResponse->ResponseList[3]) &&
|
||||
is_array($oImapResponse->ResponseList[3]))
|
||||
\is_array($oImapResponse->ResponseList[3]))
|
||||
{
|
||||
$sName = null;
|
||||
foreach ($oImapResponse->ResponseList[3] as $sArrayItem)
|
||||
|
@ -540,7 +540,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
public function FolderStatus($sFolderName, array $aStatusItems)
|
||||
{
|
||||
$aResult = false;
|
||||
if (count($aStatusItems) > 0)
|
||||
if (\count($aStatusItems) > 0)
|
||||
{
|
||||
$this->SendRequest('STATUS',
|
||||
array($this->EscapeString($sFolderName), $aStatusItems));
|
||||
|
@ -735,7 +735,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
protected function initCurrentFolderInformation($aResult, $sFolderName, $bIsWritable)
|
||||
{
|
||||
if (is_array($aResult))
|
||||
if (\is_array($aResult))
|
||||
{
|
||||
$oImapResponse = null;
|
||||
$oResult = FolderInformation::NewInstance($sFolderName, $bIsWritable);
|
||||
|
@ -744,13 +744,13 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType)
|
||||
{
|
||||
if (count($oImapResponse->ResponseList) > 2 &&
|
||||
'FLAGS' === $oImapResponse->ResponseList[1] && is_array($oImapResponse->ResponseList[2]))
|
||||
if (\count($oImapResponse->ResponseList) > 2 &&
|
||||
'FLAGS' === $oImapResponse->ResponseList[1] && \is_array($oImapResponse->ResponseList[2]))
|
||||
{
|
||||
$oResult->Flags = $oImapResponse->ResponseList[2];
|
||||
}
|
||||
|
||||
if (is_array($oImapResponse->OptionalResponse) && count($oImapResponse->OptionalResponse) > 1)
|
||||
if (is_array($oImapResponse->OptionalResponse) && \count($oImapResponse->OptionalResponse) > 1)
|
||||
{
|
||||
if ('PERMANENTFLAGS' === $oImapResponse->OptionalResponse[0] &&
|
||||
is_array($oImapResponse->OptionalResponse[1]))
|
||||
|
@ -775,9 +775,9 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
}
|
||||
}
|
||||
|
||||
if (count($oImapResponse->ResponseList) > 2 &&
|
||||
is_string($oImapResponse->ResponseList[2]) &&
|
||||
is_numeric($oImapResponse->ResponseList[1]))
|
||||
if (\count($oImapResponse->ResponseList) > 2 &&
|
||||
\is_string($oImapResponse->ResponseList[2]) &&
|
||||
\is_numeric($oImapResponse->ResponseList[1]))
|
||||
{
|
||||
switch($oImapResponse->ResponseList[2])
|
||||
{
|
||||
|
@ -889,7 +889,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$aFetchItems = \MailSo\Imap\Enumerations\FetchType::ChangeFetchItemsBefourRequest($aInputFetchItems);
|
||||
foreach ($aFetchItems as $sName => $mItem)
|
||||
{
|
||||
if (0 < strlen($sName) && '' !== $mItem)
|
||||
if (0 < \strlen($sName) && '' !== $mItem)
|
||||
{
|
||||
if (null === $this->aFetchCallbacks)
|
||||
{
|
||||
|
@ -900,7 +900,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
}
|
||||
}
|
||||
|
||||
$this->SendRequest((($bIndexIsUid) ? 'UID ' : '').'FETCH', array($sIndexRange, array_keys($aFetchItems)));
|
||||
$this->SendRequest((($bIndexIsUid) ? 'UID ' : '').'FETCH', array($sIndexRange, \array_keys($aFetchItems)));
|
||||
$aResult = $this->validateResponse($this->parseResponse());
|
||||
$this->aFetchCallbacks = null;
|
||||
|
||||
|
@ -938,13 +938,13 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType
|
||||
&& 'QUOTA' === $oImapResponse->StatusOrIndex
|
||||
&& is_array($oImapResponse->ResponseList)
|
||||
&& \is_array($oImapResponse->ResponseList)
|
||||
&& isset($oImapResponse->ResponseList[3])
|
||||
&& is_array($oImapResponse->ResponseList[3])
|
||||
&& 2 < count($oImapResponse->ResponseList[3])
|
||||
&& 'STORAGE' === strtoupper($oImapResponse->ResponseList[3][0])
|
||||
&& is_numeric($oImapResponse->ResponseList[3][1])
|
||||
&& is_numeric($oImapResponse->ResponseList[3][2])
|
||||
&& \is_array($oImapResponse->ResponseList[3])
|
||||
&& 2 < \count($oImapResponse->ResponseList[3])
|
||||
&& 'STORAGE' === \strtoupper($oImapResponse->ResponseList[3][0])
|
||||
&& \is_numeric($oImapResponse->ResponseList[3][1])
|
||||
&& \is_numeric($oImapResponse->ResponseList[3][2])
|
||||
)
|
||||
{
|
||||
$aReturn = array(
|
||||
|
@ -954,10 +954,10 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
0
|
||||
);
|
||||
|
||||
if (5 < count($oImapResponse->ResponseList[3])
|
||||
&& 'MESSAGE' === strtoupper($oImapResponse->ResponseList[3][3])
|
||||
&& is_numeric($oImapResponse->ResponseList[3][4])
|
||||
&& is_numeric($oImapResponse->ResponseList[3][5])
|
||||
if (5 < \count($oImapResponse->ResponseList[3])
|
||||
&& 'MESSAGE' === \strtoupper($oImapResponse->ResponseList[3][3])
|
||||
&& \is_numeric($oImapResponse->ResponseList[3][4])
|
||||
&& \is_numeric($oImapResponse->ResponseList[3][5])
|
||||
)
|
||||
{
|
||||
$aReturn[2] = (int) $oImapResponse->ResponseList[3][4];
|
||||
|
@ -987,7 +987,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$sSearchCriterias = !\MailSo\Base\Validator::NotEmptyString($sSearchCriterias, true) || '*' === $sSearchCriterias
|
||||
? 'ALL' : $sSearchCriterias;
|
||||
|
||||
if (!is_array($aSortTypes) || 0 === count($aSortTypes))
|
||||
if (!\is_array($aSortTypes) || 0 === \count($aSortTypes))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new \MailSo\Base\Exceptions\InvalidArgumentException(),
|
||||
|
@ -1018,8 +1018,8 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
&& ($sCmd === $oImapResponse->StatusOrIndex ||
|
||||
($bReturnUid && 'UID' === $oImapResponse->StatusOrIndex) && !empty($oImapResponse->ResponseList[2]) &&
|
||||
$sCmd === $oImapResponse->ResponseList[2])
|
||||
&& is_array($oImapResponse->ResponseList)
|
||||
&& 2 < count($oImapResponse->ResponseList))
|
||||
&& \is_array($oImapResponse->ResponseList)
|
||||
&& 2 < \count($oImapResponse->ResponseList))
|
||||
{
|
||||
$iStart = 2;
|
||||
if ($bReturnUid && 'UID' === $oImapResponse->StatusOrIndex &&
|
||||
|
@ -1029,7 +1029,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$iStart = 3;
|
||||
}
|
||||
|
||||
for ($iIndex = $iStart, $iLen = count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
for ($iIndex = $iStart, $iLen = \count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
{
|
||||
$aReturn[] = (int) $oImapResponse->ResponseList[$iIndex];
|
||||
}
|
||||
|
@ -1203,14 +1203,14 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
public function MessageSimpleSearch($sSearchCriterias = 'ALL', $bReturnUid = true, $sCharset = '')
|
||||
{
|
||||
$sCommandPrefix = ($bReturnUid) ? 'UID ' : '';
|
||||
$sSearchCriterias = 0 === strlen($sSearchCriterias) || '*' === $sSearchCriterias
|
||||
$sSearchCriterias = 0 === \strlen($sSearchCriterias) || '*' === $sSearchCriterias
|
||||
? 'ALL' : $sSearchCriterias;
|
||||
|
||||
$aRequest = array();
|
||||
if (0 < strlen($sCharset))
|
||||
if (0 < \strlen($sCharset))
|
||||
{
|
||||
$aRequest[] = 'CHARSET';
|
||||
$aRequest[] = strtoupper($sCharset);
|
||||
$aRequest[] = \strtoupper($sCharset);
|
||||
}
|
||||
|
||||
$aRequest[] = $sSearchCriterias;
|
||||
|
@ -1228,7 +1228,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
&& ($sCmd === $oImapResponse->StatusOrIndex ||
|
||||
($bReturnUid && 'UID' === $oImapResponse->StatusOrIndex) && !empty($oImapResponse->ResponseList[2]) &&
|
||||
$sCmd === $oImapResponse->ResponseList[2])
|
||||
&& is_array($oImapResponse->ResponseList)
|
||||
&& \is_array($oImapResponse->ResponseList)
|
||||
&& 2 < count($oImapResponse->ResponseList))
|
||||
{
|
||||
$iStart = 2;
|
||||
|
@ -1239,14 +1239,14 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$iStart = 3;
|
||||
}
|
||||
|
||||
for ($iIndex = $iStart, $iLen = count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
for ($iIndex = $iStart, $iLen = \count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
{
|
||||
$aReturn[] = (int) $oImapResponse->ResponseList[$iIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$aReturn = array_reverse($aReturn);
|
||||
$aReturn = \array_reverse($aReturn);
|
||||
return $aReturn;
|
||||
}
|
||||
|
||||
|
@ -1331,7 +1331,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
$aRequest = array();
|
||||
$aRequest[] = $sThreadType;
|
||||
$aRequest[] = strtoupper($sCharset);
|
||||
$aRequest[] = \strtoupper($sCharset);
|
||||
$aRequest[] = $sSearchCriterias;
|
||||
|
||||
$sCmd = 'THREAD';
|
||||
|
@ -1348,8 +1348,8 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
&& ($sCmd === $oImapResponse->StatusOrIndex ||
|
||||
($bReturnUid && 'UID' === $oImapResponse->StatusOrIndex) && !empty($oImapResponse->ResponseList[2]) &&
|
||||
$sCmd === $oImapResponse->ResponseList[2])
|
||||
&& is_array($oImapResponse->ResponseList)
|
||||
&& 2 < count($oImapResponse->ResponseList))
|
||||
&& \is_array($oImapResponse->ResponseList)
|
||||
&& 2 < \count($oImapResponse->ResponseList))
|
||||
{
|
||||
$iStart = 2;
|
||||
if ($bReturnUid && 'UID' === $oImapResponse->StatusOrIndex &&
|
||||
|
@ -1359,7 +1359,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$iStart = 3;
|
||||
}
|
||||
|
||||
for ($iIndex = $iStart, $iLen = count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
for ($iIndex = $iStart, $iLen = \count($oImapResponse->ResponseList); $iIndex < $iLen; $iIndex++)
|
||||
{
|
||||
$aNewValue = $this->validateThreadItem($oImapResponse->ResponseList[$iIndex]);
|
||||
if (false !== $aNewValue)
|
||||
|
@ -1386,7 +1386,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function MessageCopy($sToFolder, $sIndexRange, $bIndexIsUid)
|
||||
{
|
||||
if (0 === strlen($sIndexRange))
|
||||
if (0 === \strlen($sIndexRange))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new \MailSo\Base\Exceptions\InvalidArgumentException(),
|
||||
|
@ -1411,7 +1411,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function MessageMove($sToFolder, $sIndexRange, $bIndexIsUid)
|
||||
{
|
||||
if (0 === strlen($sIndexRange))
|
||||
if (0 === \strlen($sIndexRange))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new \MailSo\Base\Exceptions\InvalidArgumentException(),
|
||||
|
@ -1440,12 +1440,12 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function MessageExpunge($sUidRangeIfSupported = '', $bForceUidExpunge = false)
|
||||
{
|
||||
$sUidRangeIfSupported = trim($sUidRangeIfSupported);
|
||||
$sUidRangeIfSupported = \trim($sUidRangeIfSupported);
|
||||
|
||||
$sCmd = 'EXPUNGE';
|
||||
$aArguments = array();
|
||||
|
||||
if ($bForceUidExpunge && 0 < strlen($sUidRangeIfSupported) && $this->IsSupported('UIDPLUS'))
|
||||
if ($bForceUidExpunge && 0 < \strlen($sUidRangeIfSupported) && $this->IsSupported('UIDPLUS'))
|
||||
{
|
||||
$sCmd = 'UID '.$sCmd;
|
||||
$aArguments = array($sUidRangeIfSupported);
|
||||
|
@ -1470,14 +1470,13 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
if (!\MailSo\Base\Validator::NotEmptyString($sIndexRange, true) ||
|
||||
!\MailSo\Base\Validator::NotEmptyString($sStoreAction, true) ||
|
||||
0 === count($aInputStoreItems))
|
||||
0 === \count($aInputStoreItems))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$sCmd = ($bIndexIsUid) ? 'UID STORE' : 'STORE';
|
||||
return $this->SendRequestWithCheck($sCmd,
|
||||
array($sIndexRange, $sStoreAction, $aInputStoreItems));
|
||||
return $this->SendRequestWithCheck($sCmd, array($sIndexRange, $sStoreAction, $aInputStoreItems));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1517,15 +1516,15 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
if (null !== $iUid)
|
||||
{
|
||||
$aLastResponse = $this->GetLastResponse();
|
||||
if (is_array($aLastResponse) && 0 < count($aLastResponse) && $aLastResponse[count($aLastResponse) - 1])
|
||||
if (\is_array($aLastResponse) && 0 < \count($aLastResponse) && $aLastResponse[\count($aLastResponse) - 1])
|
||||
{
|
||||
$oLast = $aLastResponse[count($aLastResponse) - 1];
|
||||
if ($oLast && \MailSo\Imap\Enumerations\ResponseType::TAGGED === $oLast->ResponseType && is_array($oLast->OptionalResponse))
|
||||
if ($oLast && \MailSo\Imap\Enumerations\ResponseType::TAGGED === $oLast->ResponseType && \is_array($oLast->OptionalResponse))
|
||||
{
|
||||
if (0 < strlen($oLast->OptionalResponse[0]) &&
|
||||
0 < strlen($oLast->OptionalResponse[2]) &&
|
||||
if (0 < \strlen($oLast->OptionalResponse[0]) &&
|
||||
0 < \strlen($oLast->OptionalResponse[2]) &&
|
||||
'APPENDUID' === strtoupper($oLast->OptionalResponse[0]) &&
|
||||
is_numeric($oLast->OptionalResponse[2])
|
||||
\is_numeric($oLast->OptionalResponse[2])
|
||||
)
|
||||
{
|
||||
$iUid = (int) $oLast->OptionalResponse[2];
|
||||
|
@ -1556,7 +1555,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function SendRequest($sCommand, $aParams = array())
|
||||
{
|
||||
if (!\MailSo\Base\Validator::NotEmptyString($sCommand, true) || !is_array($aParams))
|
||||
if (!\MailSo\Base\Validator::NotEmptyString($sCommand, true) || !\is_array($aParams))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new \MailSo\Base\Exceptions\InvalidArgumentException(),
|
||||
|
@ -1567,7 +1566,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
$sTag = $this->getNewTag();
|
||||
|
||||
$sCommand = trim($sCommand);
|
||||
$sCommand = \trim($sCommand);
|
||||
$sRealCommand = $sTag.' '.$sCommand.$this->prepearParamLine($aParams);
|
||||
|
||||
$sFakeCommand = '';
|
||||
|
@ -1577,7 +1576,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$sFakeCommand = $sTag.' '.$sCommand.$this->prepearParamLine($aFakeParams);
|
||||
}
|
||||
|
||||
$this->aTagTimeouts[$sTag] = microtime(true);
|
||||
$this->aTagTimeouts[$sTag] = \microtime(true);
|
||||
$this->sendRaw($sRealCommand, true, $sFakeCommand);
|
||||
}
|
||||
|
||||
|
@ -1594,7 +1593,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
case 'LOGIN':
|
||||
$aResult = $aParams;
|
||||
if (is_array($aResult) && 2 === count($aResult))
|
||||
if (\is_array($aResult) && 2 === count($aResult))
|
||||
{
|
||||
$aResult[1] = '"*******"';
|
||||
}
|
||||
|
@ -1642,7 +1641,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
private function validateResponse($aResult)
|
||||
{
|
||||
if (!is_array($aResult) || 0 === $iCnt = count($aResult))
|
||||
if (!\is_array($aResult) || 0 === $iCnt = \count($aResult))
|
||||
{
|
||||
$this->writeLogException(
|
||||
new Exceptions\ResponseNotFoundException(),
|
||||
|
@ -1677,7 +1676,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
protected function parseResponse($sEndTag = null, $bFindCapa = false)
|
||||
{
|
||||
if (is_resource($this->rConnect))
|
||||
if (\is_resource($this->rConnect))
|
||||
{
|
||||
$oImapResponse = null;
|
||||
$sEndTag = (null === $sEndTag) ? $this->getCurrentTag() : $sEndTag;
|
||||
|
@ -1705,7 +1704,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
if (isset($this->aTagTimeouts[$sEndTag]))
|
||||
{
|
||||
$this->writeLog((microtime(true) - $this->aTagTimeouts[$sEndTag]).' ('.$sEndTag.')',
|
||||
$this->writeLog((\microtime(true) - $this->aTagTimeouts[$sEndTag]).' ('.$sEndTag.')',
|
||||
\MailSo\Log\Enumerations\Type::TIME);
|
||||
|
||||
unset($this->aTagTimeouts[$sEndTag]);
|
||||
|
@ -1749,24 +1748,24 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
private function initCapabilityImapResponse($oImapResponse)
|
||||
{
|
||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oImapResponse->ResponseType
|
||||
&& is_array($oImapResponse->ResponseList))
|
||||
&& \is_array($oImapResponse->ResponseList))
|
||||
{
|
||||
$aList = null;
|
||||
if (isset($oImapResponse->ResponseList[1]) && is_string($oImapResponse->ResponseList[1]) &&
|
||||
'CAPABILITY' === strtoupper($oImapResponse->ResponseList[1]))
|
||||
if (isset($oImapResponse->ResponseList[1]) && \is_string($oImapResponse->ResponseList[1]) &&
|
||||
'CAPABILITY' === \strtoupper($oImapResponse->ResponseList[1]))
|
||||
{
|
||||
$aList = array_slice($oImapResponse->ResponseList, 2);
|
||||
$aList = \array_slice($oImapResponse->ResponseList, 2);
|
||||
}
|
||||
else if ($oImapResponse->OptionalResponse && is_array($oImapResponse->OptionalResponse) &&
|
||||
1 < count($oImapResponse->OptionalResponse) && is_string($oImapResponse->OptionalResponse[0]) &&
|
||||
'CAPABILITY' === strtoupper($oImapResponse->OptionalResponse[0]))
|
||||
else if ($oImapResponse->OptionalResponse && \is_array($oImapResponse->OptionalResponse) &&
|
||||
1 < \count($oImapResponse->OptionalResponse) && \is_string($oImapResponse->OptionalResponse[0]) &&
|
||||
'CAPABILITY' === \strtoupper($oImapResponse->OptionalResponse[0]))
|
||||
{
|
||||
$aList = array_slice($oImapResponse->OptionalResponse, 1);
|
||||
$aList = \array_slice($oImapResponse->OptionalResponse, 1);
|
||||
}
|
||||
|
||||
if (is_array($aList) && 0 < count($aList))
|
||||
if (\is_array($aList) && 0 < \count($aList))
|
||||
{
|
||||
$this->aCapabilityItems = array_map('strtoupper', $aList);
|
||||
$this->aCapabilityItems = \array_map('strtoupper', $aList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2115,13 +2114,13 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$sAtomBuilder = '';
|
||||
}
|
||||
|
||||
$sAtomBuilder .= substr($this->sResponseBuffer, $iCharBlockStartPos, $iPos - $iCharBlockStartPos + 1);
|
||||
$sAtomBuilder .= \substr($this->sResponseBuffer, $iCharBlockStartPos, $iPos - $iCharBlockStartPos + 1);
|
||||
|
||||
$iPos++;
|
||||
$this->iResponseBufParsedPos = $iPos;
|
||||
|
||||
$sListBlock = $this->partialParseResponseBranch($mNull, $iStackIndex, true,
|
||||
null === $sPreviousAtomUpperCase ? '' : strtoupper($sPreviousAtomUpperCase));
|
||||
null === $sPreviousAtomUpperCase ? '' : \strtoupper($sPreviousAtomUpperCase));
|
||||
|
||||
if (null !== $sListBlock)
|
||||
{
|
||||
|
@ -2144,7 +2143,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
if ($iPos > $iCharBlockStartPos || null !== $sAtomBuilder)
|
||||
{
|
||||
$sLastCharBlock = substr($this->sResponseBuffer, $iCharBlockStartPos, $iPos - $iCharBlockStartPos);
|
||||
$sLastCharBlock = \substr($this->sResponseBuffer, $iCharBlockStartPos, $iPos - $iCharBlockStartPos);
|
||||
if (null === $sAtomBuilder)
|
||||
{
|
||||
$aList[] = $sLastCharBlock;
|
||||
|
@ -2164,9 +2163,9 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
if (null !== $oImapResponse)
|
||||
{
|
||||
// if (1 === count($aList))
|
||||
if (!$bCountOneInited && 1 === count($aList))
|
||||
// if (isset($aList[0]) && !isset($aList[1])) // fast 1 === count($aList)
|
||||
// if (1 === \count($aList))
|
||||
if (!$bCountOneInited && 1 === \count($aList))
|
||||
// if (isset($aList[0]) && !isset($aList[1])) // fast 1 === \count($aList)
|
||||
{
|
||||
$bCountOneInited = true;
|
||||
|
||||
|
@ -2188,9 +2187,9 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$oImapResponse->ResponseType = \MailSo\Imap\Enumerations\ResponseType::UNKNOWN;
|
||||
}
|
||||
}
|
||||
// else if (2 === count($aList))
|
||||
else if (!$bCountTwoInited && 2 === count($aList))
|
||||
// else if (isset($aList[1]) && !isset($aList[2])) // fast 2 === count($aList)
|
||||
// else if (2 === \count($aList))
|
||||
else if (!$bCountTwoInited && 2 === \count($aList))
|
||||
// else if (isset($aList[1]) && !isset($aList[2])) // fast 2 === \count($aList)
|
||||
{
|
||||
$bCountTwoInited = true;
|
||||
|
||||
|
@ -2244,19 +2243,19 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
private function partialResponseLiteralCallbackCallable($sParent, $sLiteralAtomUpperCase, $rImapStream, $iLiteralLen)
|
||||
{
|
||||
$sLiteralAtomUpperCasePeek = '';
|
||||
if (0 === strpos($sLiteralAtomUpperCase, 'BODY'))
|
||||
if (0 === \strpos($sLiteralAtomUpperCase, 'BODY'))
|
||||
{
|
||||
$sLiteralAtomUpperCasePeek = str_replace('BODY', 'BODY.PEEK', $sLiteralAtomUpperCase);
|
||||
$sLiteralAtomUpperCasePeek = \str_replace('BODY', 'BODY.PEEK', $sLiteralAtomUpperCase);
|
||||
}
|
||||
|
||||
$sFetchKey = '';
|
||||
if (is_array($this->aFetchCallbacks))
|
||||
if (\is_array($this->aFetchCallbacks))
|
||||
{
|
||||
if (0 < strlen($sLiteralAtomUpperCasePeek) && isset($this->aFetchCallbacks[$sLiteralAtomUpperCasePeek]))
|
||||
if (0 < \strlen($sLiteralAtomUpperCasePeek) && isset($this->aFetchCallbacks[$sLiteralAtomUpperCasePeek]))
|
||||
{
|
||||
$sFetchKey = $sLiteralAtomUpperCasePeek;
|
||||
}
|
||||
else if (0 < strlen($sLiteralAtomUpperCase) && isset($this->aFetchCallbacks[$sLiteralAtomUpperCase]))
|
||||
else if (0 < \strlen($sLiteralAtomUpperCase) && isset($this->aFetchCallbacks[$sLiteralAtomUpperCase]))
|
||||
{
|
||||
$sFetchKey = $sLiteralAtomUpperCase;
|
||||
}
|
||||
|
@ -2270,7 +2269,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
\MailSo\Base\StreamWrappers\Literal::CreateStream($rImapStream, $iLiteralLen);
|
||||
|
||||
$bResult = true;
|
||||
$this->writeLog('Callback for '.$sParent.' / '.$sLiteralAtomUpperCase.
|
||||
$this->writeLog('Start Callback for '.$sParent.' / '.$sLiteralAtomUpperCase.
|
||||
' - try to read '.$iLiteralLen.' bytes.', \MailSo\Log\Enumerations\Type::NOTE);
|
||||
|
||||
try
|
||||
|
@ -2284,31 +2283,53 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$this->writeLogException($oException);
|
||||
}
|
||||
|
||||
$iNotReadLiteralLen = 0;
|
||||
while (!\feof($rImapLiteralStream))
|
||||
if (\is_resource($rImapLiteralStream))
|
||||
{
|
||||
$sBuf = \fread($rImapLiteralStream, 8192);
|
||||
if (false !== $sBuf)
|
||||
{
|
||||
\MailSo\Base\Utils::ResetTimeLimit();
|
||||
$iNotReadLiteralLen += \strlen($sBuf);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$iNotReadLiteralLen = 0;
|
||||
|
||||
$bFeof = \feof($rImapLiteralStream);
|
||||
$this->writeLog('End Callback for '.$sParent.' / '.$sLiteralAtomUpperCase.
|
||||
' - feof = '.($bFeof ? 'good' : 'BAD'), $bFeof ?
|
||||
\MailSo\Log\Enumerations\Type::NOTE : \MailSo\Log\Enumerations\Type::WARNING);
|
||||
|
||||
if ($iNotReadLiteralLen > 0)
|
||||
if (!$bFeof)
|
||||
{
|
||||
while (!@\feof($rImapLiteralStream))
|
||||
{
|
||||
$sBuf = @\fread($rImapLiteralStream, 1024 * 1024);
|
||||
if (false === $sBuf || 0 === \strlen($sBuf) || null === $sBuf)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
\MailSo\Base\Utils::ResetTimeLimit();
|
||||
$iNotReadLiteralLen += \strlen($sBuf);
|
||||
}
|
||||
|
||||
if (\is_resource($rImapLiteralStream) && !@\feof($rImapLiteralStream))
|
||||
{
|
||||
@\stream_get_contents($rImapLiteralStream);
|
||||
}
|
||||
}
|
||||
|
||||
if (\is_resource($rImapLiteralStream))
|
||||
{
|
||||
@\fclose($rImapLiteralStream);
|
||||
}
|
||||
|
||||
if ($iNotReadLiteralLen > 0)
|
||||
{
|
||||
$this->writeLog('Not read literal size is '.$iNotReadLiteralLen.' bytes.',
|
||||
\MailSo\Log\Enumerations\Type::WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->writeLog('Not read literal size '.$iNotReadLiteralLen.' bytes.',
|
||||
$this->writeLog('Literal stream is not resource after callback.',
|
||||
\MailSo\Log\Enumerations\Type::WARNING);
|
||||
}
|
||||
|
||||
\MailSo\Base\Loader::IncStatistic('NetRead', $iLiteralLen);
|
||||
|
||||
if (\is_resource($rImapLiteralStream))
|
||||
{
|
||||
\fclose($rImapLiteralStream);
|
||||
}
|
||||
}
|
||||
|
||||
return $bResult;
|
||||
|
@ -2363,7 +2384,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function EscapeString($sStringForEscape)
|
||||
{
|
||||
return '"'.str_replace(array('\\', '"'), array('\\\\', '\\"'), $sStringForEscape).'"';
|
||||
return '"'.\str_replace(array('\\', '"'), array('\\\\', '\\"'), $sStringForEscape).'"';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,6 +23,11 @@ abstract class Driver
|
|||
*/
|
||||
protected $aPrefixes;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $bGuidPrefix;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
|
@ -62,6 +67,7 @@ abstract class Driver
|
|||
$this->sName = 'INFO';
|
||||
$this->bTimePrefix = true;
|
||||
$this->bTypedPrefix = true;
|
||||
$this->bGuidPrefix = true;
|
||||
|
||||
$this->iWriteOnTimeoutOnly = 0;
|
||||
$this->bWriteOnErrorOnly = false;
|
||||
|
@ -80,6 +86,15 @@ abstract class Driver
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \MailSo\Log\Driver
|
||||
*/
|
||||
public function DisableGuidPrefix()
|
||||
{
|
||||
$this->bGuidPrefix = false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \MailSo\Log\Driver
|
||||
*/
|
||||
|
@ -150,9 +165,11 @@ abstract class Driver
|
|||
protected function loggerLineImplementation($sTimePrefix, $sDesc,
|
||||
$iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '')
|
||||
{
|
||||
return ($this->bTimePrefix ? '['.$sTimePrefix.'] ' : '').
|
||||
($this->bTypedPrefix ? $this->getTypedPrefix($iType, $sName) : '').
|
||||
$sDesc;
|
||||
return \ltrim(
|
||||
($this->bTimePrefix ? '['.$sTimePrefix.']' : '').
|
||||
($this->bGuidPrefix ? '['.\MailSo\Log\Logger::Guid().']' : '').
|
||||
($this->bTypedPrefix ? ' '.$this->getTypedPrefix($iType, $sName) : '')
|
||||
).$sDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,6 +232,7 @@ abstract class Driver
|
|||
array_unshift($this->aCache, $sFlush);
|
||||
}
|
||||
|
||||
$this->aCache[] = '--- FlushLogCache: Trigger';
|
||||
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName);
|
||||
|
||||
$this->bFlushCache = true;
|
||||
|
@ -234,6 +252,7 @@ abstract class Driver
|
|||
array_unshift($this->aCache, $sFlush);
|
||||
}
|
||||
|
||||
$this->aCache[] = '--- FlushLogCache: Trigger';
|
||||
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName);
|
||||
|
||||
$this->bFlushCache = true;
|
||||
|
|
|
@ -61,6 +61,22 @@ class Logger extends \MailSo\Base\Collection
|
|||
return $oInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @staticvar string $sCache;
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function Guid()
|
||||
{
|
||||
static $sCache = null;
|
||||
if (null === $sCache)
|
||||
{
|
||||
$sCache = \substr(\md5(\microtime(true).\rand(10000, 99999)), -8);
|
||||
}
|
||||
|
||||
return $sCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
|
@ -792,12 +792,13 @@ class Actions
|
|||
$this->oLogger->WriteEmptyLine();
|
||||
|
||||
$oHttp = $this->Http();
|
||||
$this->oLogger->Write(
|
||||
$oHttp->GetMethod().': '.$oHttp->GetHost(false, false).$oHttp->GetServer('REQUEST_URI', ''),
|
||||
\MailSo\Log\Enumerations\Type::NOTE, 'REQUEST');
|
||||
$this->oLogger->Write('[DATE:'.\gmdate('d.m.y').'][RL:'.APP_VERSION.'][PHP:'.PHP_VERSION.'][IP:'.
|
||||
$oHttp->GetClientIp().'][PID:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('getmypid') ? \getmypid() : 'unknown').
|
||||
'][GUID:'.\MailSo\Log\Logger::Guid().']');
|
||||
|
||||
$this->oLogger->Write('[PHP:'.PHP_VERSION.'][RL:'.APP_VERSION.'][DATE:'.\gmdate('d.m.y').'][IP:'.
|
||||
$oHttp->GetClientIp().'][PID:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('getmypid') ? \getmypid() : 'unknown').']');
|
||||
$this->oLogger->Write(
|
||||
' ['.$oHttp->GetMethod().'] '.$oHttp->GetScheme().'://'.$oHttp->GetHost(false, false).$oHttp->GetServer('REQUEST_URI', ''),
|
||||
\MailSo\Log\Enumerations\Type::NOTE, 'REQUEST');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7287,7 +7288,7 @@ class Actions
|
|||
}
|
||||
else
|
||||
{
|
||||
$mResult = '['.\get_class($mResponse).']';
|
||||
$mResult = '["'.\get_class($mResponse).'"]';
|
||||
$bHook = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,8 @@ class ServiceActions
|
|||
break;
|
||||
}
|
||||
|
||||
$this->Logger()->Write(\MailSo\Base\Utils::Php2js($aPost), \MailSo\Log\Enumerations\Type::INFO, 'POST', true);
|
||||
$this->Logger()->Write(\MailSo\Base\Utils::Php2js($aPost, $this->Logger()),
|
||||
\MailSo\Log\Enumerations\Type::INFO, 'POST', true);
|
||||
}
|
||||
else if (3 < \count($this->aPaths) && $this->oHttp->IsGet())
|
||||
{
|
||||
|
@ -195,7 +196,7 @@ class ServiceActions
|
|||
$this->Plugins()->RunHook('filter.ajax-response', array($sAction, &$aResponseItem));
|
||||
|
||||
@\header('Content-Type: application/json; charset=utf-8');
|
||||
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem);
|
||||
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger());
|
||||
|
||||
$sObResult = @\ob_get_clean();
|
||||
|
||||
|
@ -299,7 +300,7 @@ class ServiceActions
|
|||
}
|
||||
|
||||
$this->Plugins()->RunHook('filter.upload-response', array(&$aResponseItem));
|
||||
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem);
|
||||
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger());
|
||||
|
||||
$sObResult = @\ob_get_clean();
|
||||
if (0 < \strlen($sObResult))
|
||||
|
@ -620,7 +621,7 @@ class ServiceActions
|
|||
}
|
||||
}
|
||||
|
||||
return $bJson ? \MailSo\Base\Utils::Php2js(array($sTheme, $sResult)) : $sResult;
|
||||
return $bJson ? \MailSo\Base\Utils::Php2js(array($sTheme, $sResult), $this->Logger()) : $sResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -886,7 +887,7 @@ class ServiceActions
|
|||
}
|
||||
}
|
||||
|
||||
return \MailSo\Base\Utils::Php2js($aResult);
|
||||
return \MailSo\Base\Utils::Php2js($aResult, $this->Logger());
|
||||
|
||||
case 'redirect':
|
||||
default:
|
||||
|
@ -925,7 +926,7 @@ class ServiceActions
|
|||
return \MailSo\Base\Utils::Php2js(array(
|
||||
'Action' => 'ExternalSso',
|
||||
'Result' => $sResult
|
||||
));
|
||||
), $this->Logger());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1038,7 +1039,7 @@ class ServiceActions
|
|||
\RainLoop\Utils::CompileTemplates(APP_VERSION_ROOT_PATH.'app/templates/Views/Common', $this->oActions).
|
||||
$this->oActions->Plugins()->CompileTemplate($bAdmin);
|
||||
|
||||
return 'window.rainloopTEMPLATES='.\MailSo\Base\Utils::Php2js(array($sHtml)).';';
|
||||
return 'window.rainloopTEMPLATES='.\MailSo\Base\Utils::Php2js(array($sHtml), $this->Logger()).';';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -637,7 +637,7 @@
|
|||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
|
||||
|
||||
/* =============================================================================
|
||||
|
@ -1142,7 +1142,7 @@ table {
|
|||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
@font-face {
|
||||
|
@ -1513,7 +1513,7 @@ table {
|
|||
.icon-resize-out:before {
|
||||
content: "\e06d";
|
||||
}
|
||||
|
||||
|
||||
/** initial setup **/
|
||||
.nano {
|
||||
/*
|
||||
|
@ -1630,7 +1630,7 @@ table {
|
|||
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
|
||||
/* Magnific Popup CSS */
|
||||
.mfp-bg {
|
||||
top: 0;
|
||||
|
@ -1995,7 +1995,7 @@ img.mfp-img {
|
|||
right: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
|
||||
|
||||
|
||||
/* overlay at start */
|
||||
.mfp-fade.mfp-bg {
|
||||
|
@ -2041,7 +2041,7 @@ img.mfp-img {
|
|||
-moz-transform: translateX(50px);
|
||||
transform: translateX(50px);
|
||||
}
|
||||
|
||||
|
||||
.simple-pace {
|
||||
-webkit-pointer-events: none;
|
||||
pointer-events: none;
|
||||
|
@ -2112,7 +2112,7 @@ img.mfp-img {
|
|||
@keyframes simple-pace-stripe-animation {
|
||||
0% { transform: none; transform: none; }
|
||||
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
|
||||
}
|
||||
}
|
||||
.inputosaurus-container {
|
||||
background-color:#fff;
|
||||
border:1px solid #bcbec0;
|
||||
|
@ -2180,7 +2180,7 @@ img.mfp-img {
|
|||
box-shadow:none;
|
||||
}
|
||||
.inputosaurus-input-hidden { display:none; }
|
||||
|
||||
|
||||
.flag-wrapper {
|
||||
width: 24px;
|
||||
height: 16px;
|
||||
|
@ -2224,7 +2224,7 @@ img.mfp-img {
|
|||
.flag.flag-pt-br {background-position: -192px -11px}
|
||||
|
||||
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
|
||||
|
||||
|
||||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
.clearfix {
|
||||
*zoom: 1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
(function (window, $, ko, crossroads, hasher, _) {
|
||||
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
(function (window, $, ko, crossroads, hasher, _) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -77,14 +77,14 @@ var
|
|||
$document = $(window.document),
|
||||
|
||||
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
|
||||
;
|
||||
;
|
||||
/*jshint onevar: false*/
|
||||
/**
|
||||
* @type {?AdminApp}
|
||||
*/
|
||||
var RL = null;
|
||||
/*jshint onevar: true*/
|
||||
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
|
@ -238,7 +238,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
|
|||
return oType && 'application/pdf' === oType.type;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Consts.Defaults = {};
|
||||
Consts.Values = {};
|
||||
Consts.DataImages = {};
|
||||
|
@ -356,7 +356,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
|
|||
* @type {string}
|
||||
*/
|
||||
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
|
@ -774,7 +774,7 @@ Enums.Notification = {
|
|||
'UnknownNotification': 999,
|
||||
'UnknownError': 999
|
||||
};
|
||||
|
||||
|
||||
Utils.trim = $.trim;
|
||||
Utils.inArray = $.inArray;
|
||||
Utils.isArray = _.isArray;
|
||||
|
@ -2524,7 +2524,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
|
|||
return oItem.hasClass('open');
|
||||
}));
|
||||
}, 50);
|
||||
|
||||
|
||||
// Base64 encode / decode
|
||||
// http://www.webtoolkit.info/
|
||||
|
||||
|
@ -2687,7 +2687,7 @@ Base64 = {
|
|||
}
|
||||
};
|
||||
|
||||
/*jslint bitwise: false*/
|
||||
/*jslint bitwise: false*/
|
||||
ko.bindingHandlers.tooltip = {
|
||||
'init': function (oElement, fValueAccessor) {
|
||||
if (!Globals.bMobileDevice)
|
||||
|
@ -3504,7 +3504,7 @@ ko.observable.fn.validateFunc = function (fFunc)
|
|||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -3826,7 +3826,7 @@ LinkBuilder.prototype.socialFacebook = function ()
|
|||
{
|
||||
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
|
@ -3920,7 +3920,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -3994,7 +3994,7 @@ CookieDriver.prototype.get = function (sKey)
|
|||
|
||||
return mResult;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -4065,7 +4065,7 @@ LocalStorageDriver.prototype.get = function (sKey)
|
|||
|
||||
return mResult;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -4108,7 +4108,7 @@ LocalStorage.prototype.get = function (iKey)
|
|||
{
|
||||
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -4121,7 +4121,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
|
|||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string=} sPosition = ''
|
||||
* @param {string=} sTemplate = ''
|
||||
|
@ -4214,7 +4214,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
|
|||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} sScreenName
|
||||
* @param {?=} aViewModels = []
|
||||
|
@ -4290,7 +4290,7 @@ KnoinAbstractScreen.prototype.__start = function ()
|
|||
this.oCross = oRoute;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -4695,7 +4695,7 @@ Knoin.prototype.bootstart = function ()
|
|||
};
|
||||
|
||||
kn = new Knoin();
|
||||
|
||||
|
||||
/**
|
||||
* @param {string=} sEmail
|
||||
* @param {string=} sName
|
||||
|
@ -5059,7 +5059,7 @@ EmailModel.prototype.inputoTagLine = function ()
|
|||
{
|
||||
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -5103,7 +5103,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
|
|||
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
|
||||
Utils.encodeHtml(this.name()) : this.name();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5398,7 +5398,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
|
|||
this.smtpAuth(true);
|
||||
this.whiteList('');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5535,7 +5535,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
|
|||
}
|
||||
}, this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5651,7 +5651,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
|
|||
{
|
||||
var sValue = this.key();
|
||||
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5711,7 +5711,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
|
|||
RL.data().mainLanguage(sLang);
|
||||
this.cancelCommand();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5817,7 +5817,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
|
|||
}, this));
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5904,7 +5904,7 @@ AdminLoginViewModel.prototype.onHide = function ()
|
|||
{
|
||||
this.loginFocus(false);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?} oScreen
|
||||
*
|
||||
|
@ -5928,7 +5928,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
|
|||
{
|
||||
return '#/' + sRoute;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
@ -5952,7 +5952,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
|
|||
RL.remote().adminLogout(function () {
|
||||
RL.loginAndLogoutReload();
|
||||
});
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6052,7 +6052,7 @@ AdminGeneral.prototype.selectLanguage = function ()
|
|||
{
|
||||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6104,7 +6104,7 @@ AdminLogin.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6173,7 +6173,7 @@ AdminBranding.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6393,7 +6393,7 @@ AdminContacts.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6482,7 +6482,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
|
|||
{
|
||||
RL.reloadDomainList();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6587,7 +6587,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
|
|||
{
|
||||
return RL.link().phpInfo();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6703,7 +6703,7 @@ AdminSocial.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6800,7 +6800,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
|
|||
|
||||
RL.reloadPluginList();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6898,7 +6898,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
|
|||
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -6953,7 +6953,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
|
|||
;
|
||||
|
||||
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -7028,7 +7028,7 @@ AdminAbout.prototype.updateCoreData = function ()
|
|||
RL.updateCoreData();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -7159,7 +7159,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
|
||||
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
|
@ -7210,7 +7210,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
|
|||
AdminDataStorage.prototype.populateDataOnStart = function()
|
||||
{
|
||||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -7484,7 +7484,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
|
|||
'Version': sVersion
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractAjaxRemoteStorage
|
||||
|
@ -7745,7 +7745,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
|
|||
{
|
||||
this.defaultRequest(fCallback, 'AdminPing');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -7829,7 +7829,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
|
|||
{
|
||||
this.oEmailsPicsHashes = oData;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractCacheStorage
|
||||
|
@ -7840,7 +7840,7 @@ function AdminCacheStorage()
|
|||
}
|
||||
|
||||
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array} aViewModels
|
||||
* @constructor
|
||||
|
@ -8020,7 +8020,7 @@ AbstractSettings.prototype.routes = function ()
|
|||
['', oRules]
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractScreen
|
||||
|
@ -8035,7 +8035,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
|
|||
AdminLoginScreen.prototype.onShow = function ()
|
||||
{
|
||||
RL.setTitle('');
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSettings
|
||||
|
@ -8053,7 +8053,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype);
|
|||
AdminSettingsScreen.prototype.onShow = function ()
|
||||
{
|
||||
RL.setTitle('');
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractBoot
|
||||
|
@ -8411,7 +8411,7 @@ AbstractApp.prototype.bootstart = function ()
|
|||
|
||||
ssm.ready();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractApp
|
||||
|
@ -8712,7 +8712,7 @@ AdminApp.prototype.bootstart = function ()
|
|||
* @type {AdminApp}
|
||||
*/
|
||||
RL = new AdminApp();
|
||||
|
||||
|
||||
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
|
||||
|
||||
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
|
||||
|
@ -8763,9 +8763,9 @@ window['__RLBOOT'] = function (fCall) {
|
|||
window['__RLBOOT'] = null;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
if (window.SimplePace) {
|
||||
window.SimplePace.add(10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}(window, jQuery, ko, crossroads, hasher, _));
|
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
10
rainloop/v/0.0.0/static/js/app.min.js
vendored
10
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue