mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Wrap definition constructor in a try/catch to catch & ignore permission errors
This commit is contained in:
parent
45d3e8d82a
commit
1cedf20503
@ -116,7 +116,12 @@ class importexport_definitions_ui
|
||||
$definitions = array('row0');
|
||||
|
||||
foreach ($bodefinitions->get_definitions() as $identifier) {
|
||||
$definition = new importexport_definition($identifier);
|
||||
try {
|
||||
$definition = new importexport_definition($identifier);
|
||||
} catch (Exception $e) {
|
||||
// permission error
|
||||
continue;
|
||||
}
|
||||
$array = $definition->get_record_array();
|
||||
$array['menuaction'] = $array['type'] == 'import' ? 'importexport.importexport_import_ui.import_dialog':'importexport.importexport_export_ui.export_dialog';
|
||||
$definitions[] = $array;
|
||||
|
@ -70,7 +70,12 @@ class importexport_export_ui {
|
||||
'application' => isset($content['appname']) ? $content['appname'] : '%'
|
||||
));
|
||||
foreach ((array)$definitions->get_definitions() as $identifier) {
|
||||
try {
|
||||
$definition = new importexport_definition($identifier);
|
||||
} catch (Exception $e) {
|
||||
// permission error
|
||||
continue;
|
||||
}
|
||||
if ($title = $definition->get_title()) {
|
||||
$sel_options['definition'][$title] = $title;
|
||||
}
|
||||
@ -311,7 +316,12 @@ class importexport_export_ui {
|
||||
));
|
||||
$response->addScript("clear_options('exec[definition]');");
|
||||
foreach ((array)$definitions->get_definitions() as $identifier) {
|
||||
try {
|
||||
$definition = new importexport_definition($identifier);
|
||||
} catch (Exception $e) {
|
||||
// Permission error
|
||||
continue;
|
||||
}
|
||||
if ($title = $definition->get_title()) {
|
||||
if (!$selected_plugin) $selected_plugin = $title;
|
||||
$response->addScript("selectbox_add_option('exec[definition]','$title', '$value',".($selected_plugin == $title ? 'true' : 'false').");");
|
||||
|
@ -104,11 +104,19 @@
|
||||
'application' => $data['appname']
|
||||
));
|
||||
foreach ((array)$definitions->get_definitions() as $identifier) {
|
||||
try
|
||||
{
|
||||
$definition = new importexport_definition($identifier);
|
||||
if ($title = $definition->get_title()) {
|
||||
$options['definition'][$title] = $title;
|
||||
}
|
||||
unset($definition);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// Permission error
|
||||
continue;
|
||||
}
|
||||
if ($title = $definition->get_title()) {
|
||||
$options['definition'][$title] = $title;
|
||||
}
|
||||
unset($definition);
|
||||
}
|
||||
unset($definitions);
|
||||
}
|
||||
|
@ -167,11 +167,16 @@
|
||||
if($data['plugin']) $query['plugin'] = $data['plugin'];
|
||||
$definitions = new importexport_definitions_bo($query);
|
||||
foreach ((array)$definitions->get_definitions() as $identifier) {
|
||||
try {
|
||||
$definition = new importexport_definition($identifier);
|
||||
if ($title = $definition->get_title()) {
|
||||
$options['definition'][$title] = $title;
|
||||
}
|
||||
unset($definition);
|
||||
} catch (Exception $e) {
|
||||
// permission error
|
||||
continue;
|
||||
}
|
||||
if ($title = $definition->get_title()) {
|
||||
$options['definition'][$title] = $title;
|
||||
}
|
||||
unset($definition);
|
||||
}
|
||||
unset($definitions);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user