mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 23:58:54 +01:00
Respect global setting export_limit = 'no' -> disable exporting
This commit is contained in:
parent
7e3e434e39
commit
a019e94e55
@ -31,14 +31,18 @@ class importexport_admin_prefs_sidebox_hooks
|
||||
"','_blank',850,440,'yes')",
|
||||
'icon' => 'import'
|
||||
),
|
||||
array(
|
||||
);
|
||||
$config = config::read('phpgwapi');
|
||||
if($GLOBALS['egw_info']['user']['apps']['admin'] || $config['export_limit'] !== 'no')
|
||||
{
|
||||
$file[] = array(
|
||||
'text' => 'Export',
|
||||
'link' => "javascript:egw_openWindowCentered2('".
|
||||
egw::link('/index.php','menuaction=importexport.importexport_export_ui.export_dialog',false).
|
||||
"','_blank',850,440,'yes')",
|
||||
'icon' => 'export'
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
if($GLOBALS['egw']->acl->check('definition', EGW_ACL_EDIT, $appname))
|
||||
{
|
||||
$file['Define imports|exports'] = egw::link('/index.php',array(
|
||||
|
@ -80,13 +80,20 @@ class importexport_definitions_ui
|
||||
{
|
||||
$filter = array('name' => '*');
|
||||
|
||||
// Filter private definitions
|
||||
if(!$GLOBALS['egw_info']['user']['apps']['admin']) {
|
||||
// Filter private definitions
|
||||
$filter['owner'] = $GLOBALS['egw_info']['user']['account_id'];
|
||||
|
||||
$config = config::read('phpgwapi');
|
||||
if($config['export_limit'] == 'no') {
|
||||
$filter['type'] = 'import';
|
||||
}
|
||||
} else {
|
||||
$filter[] = '!owner || owner IS NULL';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$bodefinitions = new importexport_definitions_bo($filter, true);
|
||||
if (is_array($content))
|
||||
{
|
||||
@ -400,7 +407,9 @@ class importexport_definitions_ui
|
||||
else
|
||||
{
|
||||
$content['msg'] = $this->steps['wizard_step20'];
|
||||
$config = config::read('phpgwapi');
|
||||
foreach ($this->plugins[$content['application']] as $type => $plugins) {
|
||||
if($config['export_limit'] == 'no' && !$GLOBALS['egw_info']['user']['apps']['admin'] && $type == 'export') continue;
|
||||
foreach($plugins as $plugin => $name) {
|
||||
$sel_options['plugin'][$plugin] = $name;
|
||||
}
|
||||
|
@ -48,6 +48,13 @@ class importexport_export_ui {
|
||||
$readonlys = array();
|
||||
$preserv = array();
|
||||
|
||||
// Check global setting
|
||||
if(!$GLOBALS['egw_info']['user']['apps']['admin']) {
|
||||
$config = config::read('phpgwapi');
|
||||
if($config['export_limit'] == 'no') {
|
||||
die(lang('Admin disabled exporting'));
|
||||
}
|
||||
}
|
||||
$et = new etemplate(self::_appname. '.export_dialog');
|
||||
$_appname = $_content['appname'] ? $_content['appname'] : $_GET['appname'];
|
||||
$_definition = $_content['definition'] ? $_content['definition'] : $_GET['definition'];
|
||||
|
Loading…
Reference in New Issue
Block a user