pre release commit (1.9.0.325)

This commit is contained in:
RainLoop Team 2015-05-09 16:09:08 +04:00
parent 1fb553e77e
commit 5b6c90aea9
7 changed files with 80 additions and 28 deletions

View file

@ -5103,7 +5103,6 @@ class Actions
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
$aSystemFolders = array();
$this->recFoldersTypes($oAccount, $oFolderCollection, $aSystemFolders);
$oFolderCollection->SystemFolders = $aSystemFolders;
@ -9495,7 +9494,8 @@ class Actions
'FoldersHash' => isset($mResponse->FoldersHash) ? $mResponse->FoldersHash : '',
'IsThreadsSupported' => $mResponse->IsThreadsSupported,
'Optimized' => $mResponse->Optimized,
'SystemFolders' => isset($mResponse->SystemFolders) && \is_array($mResponse->SystemFolders) ? $mResponse->SystemFolders : array()
'SystemFolders' => isset($mResponse->SystemFolders) && \is_array($mResponse->SystemFolders) ?
$mResponse->SystemFolders : array()
));
}
else if ($mResponse instanceof \MailSo\Base\Collection)

View file

@ -188,10 +188,10 @@ class PdoAddressBook
$this->oLogger->Write($sCmd.' '.$sUrl.(('PUT' === $sCmd || 'POST' === $sCmd) && null !== $mData ? ' ('.\strlen($mData).')' : ''),
\MailSo\Log\Enumerations\Type::INFO, 'DAV');
if ('PUT' === $sCmd || 'POST' === $sCmd)
{
$this->oLogger->Write($mData, \MailSo\Log\Enumerations\Type::INFO, 'DAV');
}
// if ('PUT' === $sCmd || 'POST' === $sCmd)
// {
// $this->oLogger->Write($mData, \MailSo\Log\Enumerations\Type::INFO, 'DAV');
// }
$oResponse = false;
try
@ -265,7 +265,7 @@ class PdoAddressBook
$sCurrentUserPrincipal = '';
$sAddressbookHomeSet = '';
// [{DAV:}current-user-principal] => /cloud/remote.php/carddav/principals/admin/
// [{urn:ietf:params:xml:ns:carddav}addressbook-home-set] => /cloud/remote.php/carddav/addressbooks/admin/
@ -297,14 +297,20 @@ class PdoAddressBook
if (!empty($sKey))
{
$sFirstNextPath = $sKey;
$oResourceType = isset($aItem['{DAV:}resourcetype']) ? $aItem['{DAV:}resourcetype'] : null;
/* @var $oResourceType \SabreForRainLoop\DAV\Property\ResourceType */
if ($oResourceType && $oResourceType->is('{DAV:}collection'))
if (empty($sFirstNextPath))
{
$sNextPath = $sKey;
continue;
$sFirstNextPath = $sKey;
}
if (empty($sNextPath))
{
$oResourceType = isset($aItem['{DAV:}resourcetype']) ? $aItem['{DAV:}resourcetype'] : null;
/* @var $oResourceType \SabreForRainLoop\DAV\Property\ResourceType */
if ($oResourceType && $oResourceType->is('{DAV:}collection'))
{
$sNextPath = $sKey;
continue;
}
}
}
}
@ -562,6 +568,17 @@ class PdoAddressBook
return false;
}
$aMatch = array();
$sUserAddressBookNameName = '';
if (\preg_match('/\|(.+)$/', $sUrl, $aMatch) && !empty($aMatch[1]))
{
$sUserAddressBookNameName = \trim($aMatch[1]);
$sUserAddressBookNameName = \MailSo\Base\Utils::StrToLowerIfAscii($sUserAddressBookNameName);
$sUrl = \preg_replace('/\|(.+)$/', '', $sUrl);
}
$oClient = $this->getDavClientFromUrl($sUrl, $sUser, $sPassword, $sProxy);
if (!$oClient)
{
@ -583,12 +600,30 @@ class PdoAddressBook
{
if (1 < \count($aPaths))
{
foreach ($aPaths as $sKey => $sValue)
if ('' !== $sUserAddressBookNameName)
{
if (\in_array(\strtolower($sValue), array('contacts', 'default', 'addressbook', 'address book')))
foreach ($aPaths as $sKey => $sValue)
{
$sNewPath = $sKey;
break;
$sValue = \MailSo\Base\Utils::StrToLowerIfAscii(\trim($sValue));
if ($sValue === $sUserAddressBookNameName)
{
$sNewPath = $sKey;
break;
}
}
}
if (empty($sNewPath))
{
foreach ($aPaths as $sKey => $sValue)
{
$sValue = \MailSo\Base\Utils::StrToLowerIfAscii($sValue);
if (\in_array($sValue, array('contacts', 'default', 'addressbook', 'address book')))
{
$sNewPath = $sKey;
break;
}
}
}
}