diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php index a8a635fca..727a55c38 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php @@ -259,4 +259,34 @@ trait Contacts return $mResult; } + public function RawContactsVcf() : bool + { + $oAccount = $this->getAccountFromToken(); + + \header('Content-Type: text/x-vcard; charset=UTF-8'); + \header('Content-Disposition: attachment; filename="contacts.vcf"', true); + \header('Accept-Ranges: none', true); + \header('Content-Transfer-Encoding: binary'); + + $this->oHttp->ServerNoCache(); + + return $this->AddressBookProvider($oAccount)->IsActive() ? + $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'vcf') : false; + } + + public function RawContactsCsv() : bool + { + $oAccount = $this->getAccountFromToken(); + + \header('Content-Type: text/csv; charset=UTF-8'); + \header('Content-Disposition: attachment; filename="contacts.csv"', true); + \header('Accept-Ranges: none', true); + \header('Content-Transfer-Encoding: binary'); + + $this->oHttp->ServerNoCache(); + + return $this->AddressBookProvider($oAccount)->IsActive() ? + $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'csv') : false; + } + } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php index 1bd539b97..6a2b7ccdb 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php @@ -112,36 +112,6 @@ trait Raw return false; } - public function RawContactsVcf() : bool - { - $oAccount = $this->getAccountFromToken(); - - \header('Content-Type: text/x-vcard; charset=UTF-8'); - \header('Content-Disposition: attachment; filename="contacts.vcf"', true); - \header('Accept-Ranges: none', true); - \header('Content-Transfer-Encoding: binary'); - - $this->oHttp->ServerNoCache(); - - return $this->AddressBookProvider($oAccount)->IsActive() ? - $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'vcf') : false; - } - - public function RawContactsCsv() : bool - { - $oAccount = $this->getAccountFromToken(); - - \header('Content-Type: text/csv; charset=UTF-8'); - \header('Content-Disposition: attachment; filename="contacts.csv"', true); - \header('Accept-Ranges: none', true); - \header('Content-Transfer-Encoding: binary'); - - $this->oHttp->ServerNoCache(); - - return $this->AddressBookProvider($oAccount)->IsActive() ? - $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'csv') : false; - } - private function rawSmart(bool $bDownload, bool $bThumbnail = false) : bool { $sRawKey = (string) $this->GetActionParam('RawKey', '');