mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
Catch exception thrown when trying to instanciate a definition the user has no rights for, and discard it.
This commit is contained in:
parent
21c1f08322
commit
94c616bf12
@ -438,9 +438,14 @@ class importexport_helper_functions {
|
|||||||
$def = new importexport_definitions_bo(array('application'=>$appnames, 'type' => $types));
|
$def = new importexport_definitions_bo(array('application'=>$appnames, 'type' => $types));
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach((array)$def->get_definitions() as $id) {
|
foreach((array)$def->get_definitions() as $id) {
|
||||||
$definition = new importexport_definition($id);
|
// Need to instanciate it to check, but if the user doesn't have permission, it throws an exception
|
||||||
if($def->is_permitted($definition->get_record_array())) {
|
try {
|
||||||
$list[$definition->application][$definition->type] = $id;
|
$definition = new importexport_definition($id);
|
||||||
|
if($def->is_permitted($definition->get_record_array())) {
|
||||||
|
$list[$definition->application][$definition->type] = $id;
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// That one doesn't work, keep going
|
||||||
}
|
}
|
||||||
$definition = null;
|
$definition = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user