Verified Commit 4b244f9d authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(ldapmanager) Show ACL errors in CSV import

issue #5883
Showing with 7 additions and 3 deletions
+7 -3
...@@ -228,9 +228,13 @@ class csvimport extends simplePlugin ...@@ -228,9 +228,13 @@ class csvimport extends simplePlugin
$values[$m[1]][$m[2]] = $this->compute_attribute_value($attribute, $row); $values[$m[1]][$m[2]] = $this->compute_attribute_value($attribute, $row);
} }
$this->template_object->reset(); $this->template_object->reset();
$this->template_object->deserialize($values); $msgs = $this->template_object->deserialize($values);
$tabObject = $this->template_object->apply(); if ($msgs === TRUE) {
$msgs = $tabObject->save(); $tabObject = $this->template_object->apply();
$msgs = $tabObject->save();
} elseif (!is_array($msgs)) {
$msgs = array($msgs);
}
if (count($msgs)) { if (count($msgs)) {
$msg = '<ul><li>'.implode('</li><li>', $msgs).'</li></ul>'; $msg = '<ul><li>'.implode('</li><li>', $msgs).'</li></ul>';
msg_dialog::display(sprintf(_('Import failed for line %d'), $rownumber + 1), $msg, ERROR_DIALOG); msg_dialog::display(sprintf(_('Import failed for line %d'), $rownumber + 1), $msg, ERROR_DIALOG);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment