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

Fixes #4378 handling moving errors better

parent 0030e4f4
...@@ -1137,8 +1137,7 @@ class plugin ...@@ -1137,8 +1137,7 @@ class plugin
$ldap->add($new); $ldap->add($new);
if (!$ldap->success()) { if (!$ldap->success()) {
trigger_error("Trying to save $dst_dn failed.", trigger_error('Trying to save '.$dst_dn.' failed: '.$ldap->error(), E_USER_WARNING);
E_USER_WARNING);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
...@@ -1241,7 +1240,7 @@ class plugin ...@@ -1241,7 +1240,7 @@ class plugin
$ldap = $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
$ldap->rmdir_recursive($src_dn); $ldap->rmdir_recursive($src_dn);
if (!$ldap->success()) { if (!$ldap->success()) {
trigger_error("Trying to delete $src_dn failed.", E_USER_WARNING); trigger_error('Trying to delete '.$src_dn.' failed: '.$ldap->get_error(), E_USER_WARNING);
return FALSE; return FALSE;
} }
} }
......
...@@ -89,7 +89,7 @@ class simpleTabs ...@@ -89,7 +89,7 @@ class simpleTabs
$data[] = array("CLASS" => 'plugin',"NAME" => 'Error'); $data[] = array("CLASS" => 'plugin',"NAME" => 'Error');
msg_dialog::display(_("Error"), msg_dialog::display(_("Error"),
sprintf(_("No plugin definitions found to initialize '%s', please check your configuration file."), get_class($this)), sprintf(_("No plugin definitions found to initialize '%s', please check your configuration file."), get_class($this)),
"ERROR_DIALOG"); ERROR_DIALOG);
} }
$baseobject = NULL; $baseobject = NULL;
...@@ -399,10 +399,15 @@ class simpleTabs ...@@ -399,10 +399,15 @@ class simpleTabs
if ($this->dn != $new_dn) { if ($this->dn != $new_dn) {
/* Write entry on new 'dn' */ /* Write entry on new 'dn' */
if ($this->dn != 'new') { if ($this->dn != 'new') {
$baseobject->move($this->dn, $new_dn); if ($baseobject->move($this->dn, $new_dn)) {
$this->dn = $new_dn;
} else {
msg_dialog::display(_('Error'), sprintf(_('Move from "%s" to "%s" failed'), $this->dn, $new_dn), ERROR_DIALOG);
}
} else {
/* use the new one */
$this->dn = $new_dn;
} }
/* Happen to use the new one */
$this->dn = $new_dn;
} }
/* Save all plugins */ /* Save all plugins */
......
Markdown is supported
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