Commit bc2d8977 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(ldapmanager) Add dialogs for empty import and successfull import

issue #4807
Showing with 6 additions and 1 deletion
+6 -1
...@@ -191,9 +191,14 @@ class ldapmanager extends simplePlugin ...@@ -191,9 +191,14 @@ class ldapmanager extends simplePlugin
function handle_import_ldif_submit() function handle_import_ldif_submit()
{ {
global $config; global $config;
if (empty($this->import)) {
msg_dialog::display(_('Warning'), _('Nothing to import, please upload a non-empty file or fill the textarea.'), WARNING_DIALOG);
return;
}
$ldap = $config->get_ldap_link(); $ldap = $config->get_ldap_link();
try { try {
$ldap->import_complete_ldif($this->import, !$this->overwrite, FALSE); $nb = $ldap->import_complete_ldif($this->import, !$this->overwrite, FALSE);
msg_dialog::display(_('Success'), sprintf(_('%d entries successfully imported'), $nb), INFO_DIALOG);
} catch (FusionDirectoryException $e) { } catch (FusionDirectoryException $e) {
msg_dialog::display(_('LDAP error'), $e->getMessage(), ERROR_DIALOG); msg_dialog::display(_('LDAP error'), $e->getMessage(), 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