Hide exporting for admins too, if they've disabled exporting site-wide

This commit is contained in:
Nathan Gray 2011-02-23 16:45:19 +00:00
parent c4165cbe55
commit 75ba2fc475
3 changed files with 9 additions and 13 deletions

View File

@ -33,7 +33,7 @@ class importexport_admin_prefs_sidebox_hooks
), ),
); );
$config = config::read('phpgwapi'); $config = config::read('phpgwapi');
if($GLOBALS['egw_info']['user']['apps']['admin'] || $config['export_limit'] !== 'no') if($config['export_limit'] !== 'no')
{ {
$file[] = array( $file[] = array(
'text' => 'Export', 'text' => 'Export',

View File

@ -83,16 +83,13 @@ class importexport_definitions_ui
if(!$GLOBALS['egw_info']['user']['apps']['admin']) { if(!$GLOBALS['egw_info']['user']['apps']['admin']) {
// Filter private definitions // Filter private definitions
$filter['owner'] = $GLOBALS['egw_info']['user']['account_id']; $filter['owner'] = $GLOBALS['egw_info']['user']['account_id'];
$config = config::read('phpgwapi');
if($config['export_limit'] == 'no') {
$filter['type'] = 'import';
}
} else { } else {
$filter[] = '!owner || owner IS NULL'; $filter[] = '!owner || owner IS NULL';
} }
$config = config::read('phpgwapi');
if($config['export_limit'] == 'no') {
$filter['type'] = 'import';
}
$bodefinitions = new importexport_definitions_bo($filter, true); $bodefinitions = new importexport_definitions_bo($filter, true);
if (is_array($content)) if (is_array($content))

View File

@ -49,12 +49,11 @@ class importexport_export_ui {
$preserv = array(); $preserv = array();
// Check global setting // Check global setting
if(!$GLOBALS['egw_info']['user']['apps']['admin']) { $config = config::read('phpgwapi');
$config = config::read('phpgwapi'); if($config['export_limit'] == 'no') {
if($config['export_limit'] == 'no') { die(lang('Admin disabled exporting'));
die(lang('Admin disabled exporting'));
}
} }
$et = new etemplate(self::_appname. '.export_dialog'); $et = new etemplate(self::_appname. '.export_dialog');
$_appname = $_content['appname'] ? $_content['appname'] : $_GET['appname']; $_appname = $_content['appname'] ? $_content['appname'] : $_GET['appname'];
$_definition = $_content['definition'] ? $_content['definition'] : $_GET['definition']; $_definition = $_content['definition'] ? $_content['definition'] : $_GET['definition'];