mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Bugfix: Export contacts failed
This commit is contained in:
parent
33f0e6febf
commit
01e5916bf3
2 changed files with 32 additions and 25 deletions
|
|
@ -297,10 +297,11 @@ trait Contacts
|
|||
\header('Accept-Ranges: none');
|
||||
\header('Content-Transfer-Encoding: binary');
|
||||
|
||||
$this->oHttp->ServerNoCache();
|
||||
$this->Http()->ServerNoCache();
|
||||
|
||||
return $this->AddressBookProvider($oAccount)->IsActive() ?
|
||||
$this->AddressBookProvider($oAccount)->Export($this->GetMainEmail($oAccount), 'vcf') : false;
|
||||
$oAddressBookProvider = $this->AddressBookProvider($oAccount);
|
||||
return $oAddressBookProvider->IsActive() ?
|
||||
$oAddressBookProvider->Export($this->GetMainEmail($oAccount), 'vcf') : false;
|
||||
}
|
||||
|
||||
public function RawContactsCsv() : bool
|
||||
|
|
@ -312,10 +313,11 @@ trait Contacts
|
|||
\header('Accept-Ranges: none');
|
||||
\header('Content-Transfer-Encoding: binary');
|
||||
|
||||
$this->oHttp->ServerNoCache();
|
||||
$this->Http()->ServerNoCache();
|
||||
|
||||
return $this->AddressBookProvider($oAccount)->IsActive() ?
|
||||
$this->AddressBookProvider($oAccount)->Export($this->GetMainEmail($oAccount), 'csv') : false;
|
||||
$oAddressBookProvider = $this->AddressBookProvider($oAccount);
|
||||
return $oAddressBookProvider->IsActive() ?
|
||||
$oAddressBookProvider->Export($this->GetMainEmail($oAccount), 'csv') : false;
|
||||
}
|
||||
|
||||
private function importContactsFromVcfFile(\RainLoop\Model\Account $oAccount, /*resource*/ $rFile): int
|
||||
|
|
|
|||
|
|
@ -394,28 +394,33 @@ class ServiceActions
|
|||
try
|
||||
{
|
||||
$sRawError = 'Invalid action';
|
||||
if (0 !== \strlen($sAction))
|
||||
if (\strlen($sAction))
|
||||
{
|
||||
$sMethodName = 'Raw'.$sAction;
|
||||
if (\method_exists($this->oActions, $sMethodName))
|
||||
{
|
||||
\header('X-Raw-Action: '.$sMethodName);
|
||||
\header('Content-Security-Policy: script-src \'none\'; child-src \'none\'');
|
||||
|
||||
$sRawError = '';
|
||||
$this->oActions->SetActionParams(array(
|
||||
'RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3],
|
||||
'Params' => $this->aPaths
|
||||
), $sMethodName);
|
||||
|
||||
if (!$this->oActions->{$sMethodName}())
|
||||
try {
|
||||
$sMethodName = 'Raw'.$sAction;
|
||||
if (\method_exists($this->oActions, $sMethodName))
|
||||
{
|
||||
$sRawError = 'False result';
|
||||
\header('X-Raw-Action: '.$sMethodName);
|
||||
\header('Content-Security-Policy: script-src \'none\'; child-src \'none\'');
|
||||
|
||||
$sRawError = '';
|
||||
$this->oActions->SetActionParams(array(
|
||||
'RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3],
|
||||
'Params' => $this->aPaths
|
||||
), $sMethodName);
|
||||
|
||||
if (!$this->oActions->{$sMethodName}())
|
||||
{
|
||||
$sRawError = 'False result';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sRawError = 'Unknown action "'.$sAction.'"';
|
||||
else
|
||||
{
|
||||
$sRawError = 'Unknown action "'.$sAction.'"';
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// error_log(print_r($e,1));
|
||||
$sRawError = $e->getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue