From 4f3dc53cb63829ef631cf10674b0b34da708523b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 20 May 2011 17:50:51 +0000 Subject: [PATCH] Make addressbook_merge respect addressbook's extra export limit --- addressbook/inc/class.addressbook_merge.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addressbook/inc/class.addressbook_merge.inc.php b/addressbook/inc/class.addressbook_merge.inc.php index 6955d92bdb..cbf116b776 100644 --- a/addressbook/inc/class.addressbook_merge.inc.php +++ b/addressbook/inc/class.addressbook_merge.inc.php @@ -22,6 +22,12 @@ class addressbook_merge extends bo_merge */ var $public_functions = array('show_replacements' => true); + /** + * Addressbook defines its own export limit, which should take precidence over + * global limit. + */ + private $exported = 0; + /** * Constructor * @@ -30,6 +36,7 @@ class addressbook_merge extends bo_merge function __construct() { parent::__construct(); + $GLOBALS['egw_info']['server']['contact_export_limit']; } /** @@ -41,6 +48,11 @@ class addressbook_merge extends bo_merge */ protected function get_replacements($id,&$content=null) { + if($GLOBALS['egw_info']['server']['contact_export_limit'] && !$GLOBALS['egw_info']['user']['apps']['admin']) + { + if($GLOBALS['egw_info']['server']['contact_export_limit'] == 'no') return false; + if($this->exported > $GLOBALS['egw_info']['server']['contact_export_limit']) return false; + } if (!($replacements = $this->contact_replacements($id))) { return false; @@ -49,6 +61,7 @@ class addressbook_merge extends bo_merge { $replacements += $this->calendar_replacements($id,!(strpos($content,'$$calendar/-1/') === false)); } + $this->exported++; return $replacements; }