From a942e17bf70797e1d28d20a5cfa54b6312973c0c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 May 2007 06:39:40 +0000 Subject: [PATCH] fixed logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6439 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/addons/addressbook/class_addressbook.inc | 7 +++---- plugins/admin/acl/class_aclManagement.inc | 9 +++------ setup/class_setupStep_Migrate.inc | 5 +++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/plugins/addons/addressbook/class_addressbook.inc b/plugins/addons/addressbook/class_addressbook.inc index b9f5c72c1..f766133f3 100644 --- a/plugins/addons/addressbook/class_addressbook.inc +++ b/plugins/addons/addressbook/class_addressbook.inc @@ -203,14 +203,14 @@ class addressbook extends plugin $ldap->rmdir ($this->dn); @log::log("remove","addressbook/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn)); - gosa_log ("Address book object'".$this->dn."' has been removed"); - + @log::log("remove","addressbook/".get_class($this),$this->dn,array(),"Address book object'".$this->dn."' has been removed"); + } else { /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ print_red (_("You are not allowed to delete this entry!")); - gosa_log ("Warning: '".$this->ui->uid."' tried to trick address book deletion."); + @log::log("remove","addressbook/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick address book deletion."); } /* Remove lock file after successfull deletion */ @@ -242,7 +242,6 @@ class addressbook extends plugin /* No errors, save object */ if (count ($message) == 0){ $this->save(); - gosa_log ("Addressbook object '".$this->dn."' has been saved"); /* Clean up */ if (isset($_SESSION['saved_start'])){ diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index 8b3ccd1c2..450214858 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -246,7 +246,6 @@ class aclManagement extends plugin /* Delete request is permitted, perform LDAP action */ $this->acltabs= new aclroletab($this->config, NULL,$this->dn); $this->acltabs->delete(); - gosa_log ("ACL role object '".$this->dn."' has been removed"); unset ($this->acltabs); $this->acltabs= NULL; } else { @@ -256,7 +255,7 @@ class aclManagement extends plugin print_red (_("You are not allowed to delete this acl role!")); if(isset($this->ui->uid)){ - gosa_log ("Warning: '".$this->ui->uid."' tried to trick acl role deletion."); + @log::log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role deletion."); } } @@ -310,7 +309,6 @@ class aclManagement extends plugin /* Delete request is permitted, perform LDAP action */ $this->acltabs= new acl($this->config, NULL,$this->dn); $this->acltabs->remove_from_parent(); - gosa_log ("ACL object '".$this->dn."' has been removed"); unset ($this->acltabs); $this->acltabs= NULL; } else { @@ -320,7 +318,8 @@ class aclManagement extends plugin print_red (_("You are not allowed to delete this acl!")); if(isset($this->ui->uid)){ - gosa_log ("Warning: '".$this->ui->uid."' tried to trick acl deletion."); + @log::log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role deletion."); + } } @@ -357,10 +356,8 @@ class aclManagement extends plugin /* Save acl data to ldap */ if($this->acltabs->save() == 1){ - gosa_log ("ACL object '".$this->dn."' saving failed."); return; } - gosa_log ("ACL object '".$this->dn."' has been saved"); if (!isset($_POST['edit_apply'])){ diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index b166c1a37..864cee4f1 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -462,7 +462,8 @@ class Step_Migrate extends setup_step $res = $ldap->add($testEntry); $ldap->cat($dn); if(!$ldap->count()){ - gosa_log($ldap->get_error()); + @log::log("view","setup/".get_class($this),$dn,array(),$ldap->get_error()); + $this->checks['permissions']['STATUS'] = FALSE; $this->checks['permissions']['STATUS_MSG']= _("Failed"); $this->checks['permissions']['ERROR_MSG'] = @@ -475,7 +476,7 @@ class Step_Migrate extends setup_step $res = $ldap->rmDir($dn); $ldap->cat($dn); if($ldap->count()){ - gosa_log($ldap->get_error()); + @log::log("view","setup/".get_class($this),$dn,array(),$ldap->get_error()); $this->checks['permissions']['STATUS'] = FALSE; $this->checks['permissions']['STATUS_MSG']= _("Failed"); $this->checks['permissions']['ERROR_MSG'] = -- 2.30.2