-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pu/ps/sentry/5786' into '2024.11'
tweak(Tinebase/Export): ignore acl when fetching user contact for twig See merge request tine20/tine20!6650
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<?php | ||
|
||
/** | ||
* Tinebase Abstract export class | ||
* | ||
* @package Tinebase | ||
* @subpackage Export | ||
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3 | ||
* @author Paul Mehrer <[email protected]> | ||
* @copyright Copyright (c) 2017-2024 Metaways Infosystems GmbH (http://www.metaways.de) | ||
* @copyright Copyright (c) 2017-2025 Metaways Infosystems GmbH (http://www.metaways.de) | ||
* | ||
*/ | ||
|
||
|
@@ -1590,8 +1591,10 @@ protected function _renderTwigTemplate($_record = null) | |
if (isset($twigResult[$key]) || array_key_exists($key, $twigResult)) { | ||
$value = $this->_convertToString($twigResult[$key]); | ||
} else { | ||
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . | ||
' twig mapping: ' . $key . ' ' . $twigKey . ' not found in twig result array'); | ||
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) { | ||
Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . | ||
' twig mapping: ' . $key . ' ' . $twigKey . ' not found in twig result array'); | ||
} | ||
$value = ''; | ||
} | ||
$this->_setValue($twigKey, $value); | ||
|
@@ -1605,6 +1608,11 @@ protected function _renderTwigTemplate($_record = null) | |
protected function _getTwigContext(array $context) | ||
{ | ||
if (null === $this->_baseContext) { | ||
$account = Tinebase_Core::getUser(); | ||
$contact = Addressbook_Controller_Contact::getInstance()->getContactByUserId( | ||
$account->getId(), | ||
true); | ||
|
||
$this->_baseContext = [ | ||
Addressbook_Config::INSTALLATION_REPRESENTATIVE => Addressbook_Config::getInstallationRepresentative(), | ||
'branding' => [ | ||
|
@@ -1616,8 +1624,8 @@ protected function _getTwigContext(array $context) | |
'export' => [ | ||
'config' => $this->_config->toArray(), | ||
'timestamp' => $this->_exportTimeStamp, | ||
'account' => Tinebase_Core::getUser(), | ||
'contact' => Addressbook_Controller_Contact::getInstance()->getContactByUserId(Tinebase_Core::getUser()->getId()), | ||
'account' => $account, | ||
'contact' => $contact, | ||
], | ||
'additionalRecords' => $this->_additionalRecords, | ||
]; | ||
|