Commit 07a0aacd authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3073 Adding snapshot debug trace info

Showing with 10 additions and 5 deletions
+10 -5
...@@ -398,6 +398,7 @@ class SnapshotHandler { ...@@ -398,6 +398,7 @@ class SnapshotHandler {
function restore_snapshot($dn) function restore_snapshot($dn)
{ {
if (!$this->enabled()) { if (!$this->enabled()) {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot are disabled but tried to restore snapshot');
return array(); return array();
} }
...@@ -409,16 +410,20 @@ class SnapshotHandler { ...@@ -409,16 +410,20 @@ class SnapshotHandler {
/* Prepare import string */ /* Prepare import string */
$data = gzuncompress($ldap->get_attribute($dn, 'gosaSnapshotData')); $data = gzuncompress($ldap->get_attribute($dn, 'gosaSnapshotData'));
if ($data === FALSE) {
msg_dialog::display(_('Error'), _('There was a problem uncompressing snapshot data'), ERROR_DIALOG);
}
/* Import the given data */ /* Import the given data */
try { try {
$ldap->import_complete_ldif($data, FALSE, FALSE); $ldap->import_complete_ldif($data, FALSE, FALSE);
} catch(Exception $e) {
if (!$ldap->success()) {
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, "", get_class()), LDAP_ERROR);
}
} catch (Exception $e) {
msg_dialog::display(_('LDAP error'), $e->getMessage(), ERROR_DIALOG); msg_dialog::display(_('LDAP error'), $e->getMessage(), ERROR_DIALOG);
} }
if (!$ldap->success()) {
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, "", get_class()), LDAP_ERROR);
}
} }
} }
?> ?>
...@@ -536,7 +536,7 @@ class management ...@@ -536,7 +536,7 @@ class management
$entry = array_pop($target); $entry = array_pop($target);
if (!empty($entry) && $this->ui->allow_snapshot_restore($entry, $this->aclCategory)) { if (!empty($entry) && $this->ui->allow_snapshot_restore($entry, $this->aclCategory)) {
$this->snapHandler->restore_snapshot($entry); $this->snapHandler->restore_snapshot($entry);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, "Snaptshot restored!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $entry, 'Snaptshot restored');
$this->closeDialogs(); $this->closeDialogs();
} else { } else {
msg_dialog::display(_("Permission"), sprintf(_("You are not allowed to restore a snapshot for %s."), $entry), msg_dialog::display(_("Permission"), sprintf(_("You are not allowed to restore a snapshot for %s."), $entry),
......
  • bmortier @bmortier

    mentioned in issue #1040 (closed)

    By Alex-31 on 2017-09-02T15:10:06 (imported from GitLab)

    ·

    mentioned in issue #1040 (closed)

    By Alex-31 on 2017-09-02T15:10:06 (imported from GitLab)

    Toggle commit list
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