mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 17:07:03 +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('Accept-Ranges: none');
|
||||||
\header('Content-Transfer-Encoding: binary');
|
\header('Content-Transfer-Encoding: binary');
|
||||||
|
|
||||||
$this->oHttp->ServerNoCache();
|
$this->Http()->ServerNoCache();
|
||||||
|
|
||||||
return $this->AddressBookProvider($oAccount)->IsActive() ?
|
$oAddressBookProvider = $this->AddressBookProvider($oAccount);
|
||||||
$this->AddressBookProvider($oAccount)->Export($this->GetMainEmail($oAccount), 'vcf') : false;
|
return $oAddressBookProvider->IsActive() ?
|
||||||
|
$oAddressBookProvider->Export($this->GetMainEmail($oAccount), 'vcf') : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RawContactsCsv() : bool
|
public function RawContactsCsv() : bool
|
||||||
|
|
@ -312,10 +313,11 @@ trait Contacts
|
||||||
\header('Accept-Ranges: none');
|
\header('Accept-Ranges: none');
|
||||||
\header('Content-Transfer-Encoding: binary');
|
\header('Content-Transfer-Encoding: binary');
|
||||||
|
|
||||||
$this->oHttp->ServerNoCache();
|
$this->Http()->ServerNoCache();
|
||||||
|
|
||||||
return $this->AddressBookProvider($oAccount)->IsActive() ?
|
$oAddressBookProvider = $this->AddressBookProvider($oAccount);
|
||||||
$this->AddressBookProvider($oAccount)->Export($this->GetMainEmail($oAccount), 'csv') : false;
|
return $oAddressBookProvider->IsActive() ?
|
||||||
|
$oAddressBookProvider->Export($this->GetMainEmail($oAccount), 'csv') : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function importContactsFromVcfFile(\RainLoop\Model\Account $oAccount, /*resource*/ $rFile): int
|
private function importContactsFromVcfFile(\RainLoop\Model\Account $oAccount, /*resource*/ $rFile): int
|
||||||
|
|
|
||||||
|
|
@ -394,8 +394,9 @@ class ServiceActions
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$sRawError = 'Invalid action';
|
$sRawError = 'Invalid action';
|
||||||
if (0 !== \strlen($sAction))
|
if (\strlen($sAction))
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$sMethodName = 'Raw'.$sAction;
|
$sMethodName = 'Raw'.$sAction;
|
||||||
if (\method_exists($this->oActions, $sMethodName))
|
if (\method_exists($this->oActions, $sMethodName))
|
||||||
{
|
{
|
||||||
|
|
@ -417,6 +418,10 @@ class ServiceActions
|
||||||
{
|
{
|
||||||
$sRawError = 'Unknown action "'.$sAction.'"';
|
$sRawError = 'Unknown action "'.$sAction.'"';
|
||||||
}
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// error_log(print_r($e,1));
|
||||||
|
$sRawError = $e->getMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue