mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Small fixes (Release commit)
This commit is contained in:
parent
8747ea59ac
commit
eb30a1fe27
16 changed files with 155 additions and 55 deletions
|
|
@ -63,7 +63,7 @@ class FolderCollection extends \MailSo\Base\Collection
|
|||
*
|
||||
* @return \MailSo\Mail\Folder|null
|
||||
*/
|
||||
public function &GetByFullNameRaw($sFullNameRaw)
|
||||
public function GetByFullNameRaw($sFullNameRaw)
|
||||
{
|
||||
$mResult = null;
|
||||
foreach ($this->aItems as /* @var $oFolder \MailSo\Mail\Folder */ $oFolder)
|
||||
|
|
@ -73,6 +73,18 @@ class FolderCollection extends \MailSo\Base\Collection
|
|||
$mResult = $oFolder;
|
||||
break;
|
||||
}
|
||||
else if ($oFolder->HasSubFolders())
|
||||
{
|
||||
$mResult = $oFolder->SubFolders(true)->GetByFullNameRaw($sFullNameRaw);
|
||||
if ($mResult)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mResult = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $mResult;
|
||||
|
|
@ -97,7 +109,7 @@ class FolderCollection extends \MailSo\Base\Collection
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $aUnsortedMailFolders
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2095,41 +2095,45 @@ class MailClient
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sFolderNameInUtf
|
||||
* @param string $sFolderNameInUtf8
|
||||
* @param string $sFolderParentFullNameRaw = ''
|
||||
* @param bool $bSubscribeOnCreation = true
|
||||
* @param string $sDelimiter = ''
|
||||
*
|
||||
* @return \MailSo\Mail\MailClient
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function FolderCreate($sFolderNameInUtf, $sFolderParentFullNameRaw = '', $bSubscribeOnCreation = true)
|
||||
public function FolderCreate($sFolderNameInUtf8, $sFolderParentFullNameRaw = '', $bSubscribeOnCreation = true, $sDelimiter = '')
|
||||
{
|
||||
if (!\MailSo\Base\Validator::NotEmptyString($sFolderNameInUtf, true) ||
|
||||
if (!\MailSo\Base\Validator::NotEmptyString($sFolderNameInUtf8, true) ||
|
||||
!\is_string($sFolderParentFullNameRaw))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||
}
|
||||
|
||||
$sFolderNameInUtf = trim($sFolderNameInUtf);
|
||||
$sFolderNameInUtf8 = \trim($sFolderNameInUtf8);
|
||||
|
||||
$aFolders = $this->oImapClient->FolderList('', 0 === \strlen(\trim($sFolderParentFullNameRaw)) ? 'INBOX' : $sFolderParentFullNameRaw);
|
||||
if (!\is_array($aFolders) || !isset($aFolders[0]))
|
||||
if (0 === \strlen($sDelimiter) || 0 < \strlen(\trim($sFolderParentFullNameRaw)))
|
||||
{
|
||||
// TODO
|
||||
throw new \MailSo\Mail\Exceptions\RuntimeException(
|
||||
0 === \strlen(trim($sFolderParentFullNameRaw))
|
||||
? 'Cannot get folder delimiter'
|
||||
: 'Cannot create folder in non-existen parent folder');
|
||||
$aFolders = $this->oImapClient->FolderList('', 0 === \strlen(\trim($sFolderParentFullNameRaw)) ? 'INBOX' : $sFolderParentFullNameRaw);
|
||||
if (!\is_array($aFolders) || !isset($aFolders[0]))
|
||||
{
|
||||
// TODO
|
||||
throw new \MailSo\Mail\Exceptions\RuntimeException(
|
||||
0 === \strlen(trim($sFolderParentFullNameRaw))
|
||||
? 'Cannot get folder delimiter'
|
||||
: 'Cannot create folder in non-existen parent folder');
|
||||
}
|
||||
|
||||
$sDelimiter = $aFolders[0]->Delimiter();
|
||||
if (0 < \strlen($sDelimiter) && 0 < \strlen(\trim($sFolderParentFullNameRaw)))
|
||||
{
|
||||
$sFolderParentFullNameRaw .= $sDelimiter;
|
||||
}
|
||||
}
|
||||
|
||||
$sDelimiter = $aFolders[0]->Delimiter();
|
||||
if (0 < \strlen($sDelimiter) && 0 < \strlen(\trim($sFolderParentFullNameRaw)))
|
||||
{
|
||||
$sFolderParentFullNameRaw .= $sDelimiter;
|
||||
}
|
||||
|
||||
$sFullNameRawToCreate = \MailSo\Base\Utils::ConvertEncoding($sFolderNameInUtf,
|
||||
$sFullNameRawToCreate = \MailSo\Base\Utils::ConvertEncoding($sFolderNameInUtf8,
|
||||
\MailSo\Base\Enumerations\Charset::UTF_8,
|
||||
\MailSo\Base\Enumerations\Charset::UTF_7_IMAP);
|
||||
|
||||
|
|
|
|||
|
|
@ -326,8 +326,11 @@ class Actions
|
|||
|
||||
$sQuery = \trim(\trim($sQuery), ' /');
|
||||
|
||||
$sSubQuerty = \trim(\trim($this->Http()->GetQuery('/s/', '')), ' /');
|
||||
$sSubQuerty = \trim(\trim($this->Http()->GetQuery('s', '')), ' /');
|
||||
$sSubSubQuerty = \trim(\trim($this->Http()->GetQuery('ss', '')), ' /');
|
||||
|
||||
$sQuery .= 0 < \strlen($sSubQuerty) ? '/'.$sSubQuerty : '';
|
||||
$sQuery .= 0 < \strlen($sSubSubQuerty) ? '/'.$sSubSubQuerty : '';
|
||||
|
||||
if ('' === $this->GetSpecAuthToken())
|
||||
{
|
||||
|
|
@ -773,16 +776,22 @@ class Actions
|
|||
$oHttp = $this->Http();
|
||||
|
||||
$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(
|
||||
'[APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off').']'.
|
||||
'[MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off').']'.
|
||||
'[PDO:'.(\class_exists('PDO') ? \implode(',', \PDO::getAvailableDrivers()) : 'off').']'.
|
||||
'['.\implode(',', \stream_get_transports()).']'
|
||||
$oHttp->GetClientIp().'][PID:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('getmypid') ? \getmypid() : 'unknown').']['.
|
||||
$oHttp->GetServer('SERVER_SOFTWARE', '~').']['.
|
||||
(\MailSo\Base\Utils::FunctionExistsAndEnabled('php_sapi_name') ? \php_sapi_name() : '~' ).']'
|
||||
);
|
||||
|
||||
$sPdo = (\class_exists('PDO') ? \implode(',', \PDO::getAvailableDrivers()) : 'off');
|
||||
$sPdo = empty($sPdo) ? '~' : $sPdo;
|
||||
|
||||
$this->oLogger->Write('['.
|
||||
'Suhosin:'.(\extension_loaded('suhosin') || @\ini_get('suhosin.get.max_value_length') ? 'on' : 'off').
|
||||
'][APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off').
|
||||
'][MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off').
|
||||
'][PDO:'.$sPdo.
|
||||
'][Streams:'.\implode(',', \stream_get_transports()).
|
||||
']');
|
||||
|
||||
$this->oLogger->Write(
|
||||
'['.$oHttp->GetMethod().'] '.$oHttp->GetScheme().'://'.$oHttp->GetHost(false, false).$oHttp->GetServer('REQUEST_URI', ''),
|
||||
\MailSo\Log\Enumerations\Type::NOTE, 'REQUEST');
|
||||
|
|
@ -977,7 +986,7 @@ class Actions
|
|||
static $bResult = null;
|
||||
if (null === $bResult)
|
||||
{
|
||||
$bResult = $this->licenseParser($this->licenseHelper(false, true));
|
||||
// $bResult = $this->licenseParser($this->licenseHelper(false, true));
|
||||
$bResult = true;
|
||||
}
|
||||
|
||||
|
|
@ -4009,7 +4018,7 @@ class Actions
|
|||
$aFolders =& $oFolders->GetAsArray();
|
||||
if (\is_array($aFolders) && 0 < \count($aFolders))
|
||||
{
|
||||
if ($bListFolderTypes && false)
|
||||
if ($bListFolderTypes)
|
||||
{
|
||||
foreach ($aFolders as $oFolder)
|
||||
{
|
||||
|
|
@ -4042,7 +4051,7 @@ class Actions
|
|||
$sName = $oFolder->Name();
|
||||
$sFullName = $oFolder->FullName();
|
||||
|
||||
if (isset($aMap[$sName], $aMap[$sFullName]))
|
||||
if (isset($aMap[$sName]) || isset($aMap[$sFullName]))
|
||||
{
|
||||
$iFolderType = isset($aMap[$sName]) ? $aMap[$sName] : $aMap[$sFullName];
|
||||
if (!isset($aResult[$iFolderType]) && \in_array($iFolderType, array(
|
||||
|
|
@ -4159,16 +4168,27 @@ class Actions
|
|||
}
|
||||
}
|
||||
|
||||
try
|
||||
$sFullNameToCheck = \MailSo\Base\Utils::ConvertEncoding($mFolderNameToCreate,
|
||||
\MailSo\Base\Enumerations\Charset::UTF_8, \MailSo\Base\Enumerations\Charset::UTF_7_IMAP);
|
||||
|
||||
if (0 < \strlen(\trim($sParent)))
|
||||
{
|
||||
if ($this->MailClient()->FolderCreate($mFolderNameToCreate, $sParent))
|
||||
{
|
||||
$bDoItAgain = true;
|
||||
}
|
||||
$sFullNameToCheck = $sParent.$sDelimiter.$sFullNameToCheck;
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
|
||||
if (!$oFolderCollection->GetByFullNameRaw($sFullNameToCheck))
|
||||
{
|
||||
$this->Logger()->WriteException($oException);
|
||||
try
|
||||
{
|
||||
if ($this->MailClient()->FolderCreate($mFolderNameToCreate, $sParent, true, $sDelimiter))
|
||||
{
|
||||
$bDoItAgain = true;
|
||||
}
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
$this->Logger()->WriteException($oException);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6492,8 +6512,9 @@ class Actions
|
|||
$aParams[2] = 'View';
|
||||
|
||||
\array_shift($aParams);
|
||||
$sLast = \array_pop($aParams);
|
||||
|
||||
$sUrl = $this->Http()->GetFullUrl().'?/Raw/&/s/=/'.implode('/', $aParams);
|
||||
$sUrl = $this->Http()->GetFullUrl().'?/Raw/&s=/'.implode('/', $aParams).'/&ss=/'.$sLast;
|
||||
$sFullUrl = 'http://docs.google.com/viewer?embedded=true&url='.urlencode($sUrl);
|
||||
|
||||
@\header('Content-Type: text/html; charset=utf-8');
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
protected function defaultValues()
|
||||
{
|
||||
return array(
|
||||
|
||||
'webmail' => array(
|
||||
|
||||
'title' => array('RainLoop Webmail', 'Text displayed as page title'),
|
||||
|
|
@ -188,9 +189,9 @@ Examples:
|
|||
),
|
||||
|
||||
'social' => array(
|
||||
'google_enable' => array(false, 'Google'),
|
||||
'google_enable_auth' => array(true),
|
||||
'google_enable_drive' => array(true),
|
||||
'google_enable' => array(true, 'Google'),
|
||||
'google_enable_auth' => array(false),
|
||||
'google_enable_drive' => array(false),
|
||||
'google_enable_preview' => array(true),
|
||||
'google_client_id' => array(''),
|
||||
'google_client_secret' => array(''),
|
||||
|
|
|
|||
|
|
@ -408,6 +408,14 @@ class ServiceActions
|
|||
$sRawError = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sRawError = 'Unknown action "'.$sAction.'"';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sRawError = 'Empty action';
|
||||
}
|
||||
}
|
||||
catch (\RainLoop\Exceptions\ClientException $oException)
|
||||
|
|
@ -428,6 +436,7 @@ class ServiceActions
|
|||
if (0 < \strlen($sRawError))
|
||||
{
|
||||
$this->oActions->Logger()->Write($sRawError, \MailSo\Log\Enumerations\Type::ERROR);
|
||||
$this->oActions->Logger()->WriteDump($this->aPaths, \MailSo\Log\Enumerations\Type::ERROR, 'PATHS');
|
||||
}
|
||||
|
||||
if ($oException)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <div class="e-powered thm-powered" data-bind="visible: logoPowered">
|
||||
Powered by <a href="http://rainloop.net" target="_blank">RainLoop</a>
|
||||
</div>-->
|
||||
</center>
|
||||
</div>
|
||||
<div class="loginAfter"></div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<label class="e-component e-checkbox" data-bind="css: {'inline': inline, 'disabled': disable() || !enable() }">
|
||||
<input type="checkbox" data-bind="checked: value, disable: disable() || !enable()" />
|
||||
<!-- ko if: labeled -->
|
||||
|
||||
<span class="sub-label i18n" data-bind="attr: {'data-i18n-text': label}"></span>
|
||||
<!-- /ko -->
|
||||
</label>
|
||||
|
|
@ -84,9 +84,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="e-powered thm-powered" data-bind="visible: logoPowered">
|
||||
<!-- <div class="e-powered thm-powered" data-bind="visible: logoPowered">
|
||||
Powered by <a href="http://rainloop.net" target="_blank">RainLoop</a>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="e-languages thm-languages" data-bind="visible: allowLanguagesOnLogin() && socialLoginEnabled()">
|
||||
<label class="flag-selector">
|
||||
<i data-bind="css: langRequest() ? 'icon-spinner animated' : 'icon-world'"></i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue