diff --git a/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php b/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php index a8cc91a43f..4286fb9b5b 100644 --- a/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php +++ b/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php @@ -38,8 +38,7 @@ class importexport_admin_prefs_sidebox_hooks ), ); $config = config::read('phpgwapi'); - $limit_exception = count(@array_intersect(array($GLOBALS['egw_info']['user']['account_id']) + $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'],true), unserialize($GLOBALS['egw_info']['server']['export_limit_excepted']))) > 0; - if($GLOBALS['egw_info']['user']['apps']['admin'] || $limit_exception || $config['export_limit'] !== 'no') + if($GLOBALS['egw_info']['user']['apps']['admin'] || bo_merge::is_export_limit_excepted() || $config['export_limit'] !== 'no') { $file[] = array( 'text' => 'Export', @@ -123,8 +122,7 @@ class importexport_admin_prefs_sidebox_hooks } } $config = config::read('phpgwapi'); - $limit_exception = count(@array_intersect(array($GLOBALS['egw_info']['user']['account_id']) + $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'],true), unserialize($GLOBALS['egw_info']['server']['export_limit_excepted']))) > 0; - if (($GLOBALS['egw_info']['user']['apps']['admin'] || $limit_exception || !$config['export_limit'] || $config['export_limit'] > 0) && $cache[$appname]['export']) + if (($GLOBALS['egw_info']['user']['apps']['admin'] || bo_merge::is_export_limit_excepted() || !$config['export_limit'] || $config['export_limit'] > 0) && $cache[$appname]['export']) { $file['Export CSV'] = array('link' => "javascript:egw_openWindowCentered2('". egw::link('/index.php',array( diff --git a/importexport/inc/class.importexport_definitions_ui.inc.php b/importexport/inc/class.importexport_definitions_ui.inc.php index eaf9ff63a4..f34aad701b 100644 --- a/importexport/inc/class.importexport_definitions_ui.inc.php +++ b/importexport/inc/class.importexport_definitions_ui.inc.php @@ -85,10 +85,9 @@ class importexport_definitions_ui $filter[] = '(owner=0 OR owner IS NULL OR allowed_users IS NOT NULL OR owner = ' . $GLOBALS['egw_info']['user']['account_id'] . ')'; } else { // Filter private definitions - $limit_exception = count(array_intersect(array($GLOBALS['egw_info']['user']['account_id']) + $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'],true), unserialize($GLOBALS['egw_info']['server']['export_limit_excepted']))) > 0; $filter['owner'] = $GLOBALS['egw_info']['user']['account_id']; $config = config::read('phpgwapi'); - if($config['export_limit'] == 'no' && !$limit_exception) { + if($config['export_limit'] == 'no' && !bo_merge::is_export_limit_excepted()) { $filter['type'] = 'import'; } } diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index 293487c571..63a0469556 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -101,8 +101,7 @@ class importexport_export_csv implements importexport_iface_export_record $this->csv_options = array_merge( $this->csv_options, $_options ); } - $limit_exception = count(array_intersect(array($GLOBALS['egw_info']['user']['account_id']) + $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'],true), unserialize($GLOBALS['egw_info']['server']['export_limit_excepted']))) > 0; - if(!($GLOBALS['egw_info']['user']['apps']['admin'] || $limit_exception)) { + if(!($GLOBALS['egw_info']['user']['apps']['admin'] || bo_merge::is_export_limit_excepted())) { $config = config::read('phpgwapi'); if($config['export_limit'] == 'no') throw new egw_exception_no_permission_admin('Export disabled'); $this->export_limit = (int)$config['export_limit']; @@ -165,7 +164,7 @@ class importexport_export_csv implements importexport_iface_export_record } // Check for limit - if($this->export_limit && $this->num_of_records > $this->export_limit) { + if($this->export_limit && $this->num_of_records >= $this->export_limit) { return; } diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index 4b49551d32..6d49391a7f 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -19,7 +19,7 @@ class importexport_export_ui { public $public_functions = array( 'export_dialog' => true, - 'download' => true, + 'download' => true, ); private $js; @@ -49,8 +49,7 @@ class importexport_export_ui { $preserv = array(); // Check global setting - $limit_exception = count(@array_intersect(array($GLOBALS['egw_info']['user']['account_id']) + $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'],true), unserialize($GLOBALS['egw_info']['server']['export_limit_excepted']))) > 0; - if(!($GLOBALS['egw_info']['user']['apps']['admin'] || $limit_exception)) { + if(!($GLOBALS['egw_info']['user']['apps']['admin'] || bo_merge::is_export_limit_excepted())) { $config = config::read('phpgwapi'); if($config['export_limit'] == 'no') { die(lang('Admin disabled exporting'));