From: hickert Date: Wed, 23 May 2007 08:10:40 +0000 (+0000) Subject: Updated logging X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d6a17677f5553b6ccef1e49bf600d67e02c2773d;p=gosa.git Updated logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6449 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc index 18f9d747b..315a6e26a 100644 --- a/plugins/admin/systems/class_goShareServer.inc +++ b/plugins/admin/systems/class_goShareServer.inc @@ -262,7 +262,7 @@ class goShareServer extends goService{ $ldap->cd($mountsdn); $ldap->add($mounts); show_ldap_error($ldap->get_error(), sprintf(_("Creating system server/shares (mount container) with dn '%s' failed."),$this->dn)); - gosa_log("Mount container '$mountsdn' has been created"); + new log("modify","server/".get_class($this),$mountdn,array_keys($mount),$ldap->get_error()); } # remove deleted mounts from the container @@ -276,7 +276,7 @@ class goShareServer extends goService{ if (count($attrs) != 0) { $ldap->rmdir($mountdn); show_ldap_error($ldap->get_error(), sprintf(_("Removing system server/shares (mount container) with dn '%s' failed."),$this->dn)); - gosa_log("Mount object '".$mountdn."' has been removed"); + new log("remove","server/".get_class($this),$mountdn,array_keys($mount),$ldap->get_error()); } } @@ -287,7 +287,7 @@ class goShareServer extends goService{ $ldap->cd($mountdn); $ldap->add($mount); show_ldap_error($ldap->get_error(), sprintf(_("Saving system server/shares (mount container) with dn '%s' failed."),$this->dn)); - gosa_log("Mount object '".$mountdn."' has been added"); + new log("create","server/".get_class($this),$mountdn,array_keys($mount),$ldap->get_error()); } } diff --git a/plugins/admin/systems/class_servKolab.inc b/plugins/admin/systems/class_servKolab.inc index 5941bbc68..8c8198442 100644 --- a/plugins/admin/systems/class_servKolab.inc +++ b/plugins/admin/systems/class_servKolab.inc @@ -198,8 +198,6 @@ class servkolab extends goService { /* Remove complete entry */ $ldap->rmdir ($this->dn); show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn)); - gosa_log("k=kolab entry removed, ".$this->hostname." was the last kolabHost entry."); - } else { /* Only modify kolabHost */ @@ -214,7 +212,6 @@ class servkolab extends goService { $this->cleanup(); $ldap->modify ($attrs); show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn)); - gosa_log("Removing ".$this->hostname." from list of kolabHosts"); } @log::log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index d7b4ffa5d..b3e614ea4 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -405,7 +405,7 @@ class systems extends plugin $attrs['gotoRootPasswd']= crypt($_POST['new_password'],substr(session_id(),0,2)); } $ldap->modify($attrs); - gosa_log ("Password for '".$this->dn."' has been changed"); + @log::log("security","systems/".get_class($this),$this->dn,array_keys($attrs),$ldap->get_error()); }else{ print_red(_("You are not allowed to change the password for this object.")); } @@ -513,15 +513,13 @@ class systems extends plugin $this->systab->delete(); } unset ($this->systab); - gosa_log ("System object'".$dn."' has been removed"); $this->systab= NULL; } else { /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ print_red (_("You are not allowed to delete this component!")); - gosa_log ("Warning: '".$this->ui->uid."' tried to trick system ". - "deletion."); + @log::log("security","systems/".get_class($this),$dn,array(),"Tried to trick deletion."); } /* Remove lock file after successfull deletion */ del_lock ($dn); @@ -647,7 +645,6 @@ class systems extends plugin $this->systab->delete(); } unset ($this->systab); - gosa_log ("System object'".$this->dn."' has been removed"); $this->systab= NULL; /* Terminal list has changed, reload it. */ @@ -656,8 +653,7 @@ class systems extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ print_red (_("You are not allowed to delete this component!")); - gosa_log ("Warning: '".$this->ui->uid."' tried to trick system ". - "deletion."); + @log::log("security","systems/".get_class($this),$dn,array(),"Tried to trick deletion."); } /* Remove lock file after successfull deletion */ @@ -715,7 +711,6 @@ class systems extends plugin } $this->systab->save(); - gosa_log ("System object'".$this->dn."' has been saved"); /* Incoming behavior; you can select a system type and an ogroup membership. * If this object is an Incoming object, $_SESSION['SelectedSystemType'] isset. diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index d11e22d65..7f02cf168 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -258,8 +258,7 @@ class userManagement extends plugin if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){ exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr); } - - gosa_log ("Password for '".$this->usertab->dn."' has been changed"); + @log::log("modify","users/".get_class($this),$this->usertab->dn,array(),"Password has been changed"); unset($this->usertab); $this->usertab= NULL; } @@ -269,7 +268,7 @@ class userManagement extends plugin exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr); } - gosa_log ("Password for '".$this->dn."' has been changed"); + @log::log("modify","users/".get_class($this),$this->dn,array(),"Password has been changed"); } } else { @@ -341,13 +340,12 @@ class userManagement extends plugin $this->usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'],$dn); $this->usertab->set_acl_base(); $this->usertab->delete (); - gosa_log ("User object '".$dn."' has been removed"); unset ($this->usertab); $this->usertab= NULL; } else { print_red (sprintf(_("You are not allowed to delete the user '%s'!"),$dn)); if(isset($this->ui->uid)){ - gosa_log ("Warning: '".$this->ui->uid."' tried to trick user deletion."); + @log::log("security","users/".get_class($this),$dn,array(),"Tried to trick deletion."); } } /* Remove lock file after successfull deletion */ @@ -415,7 +413,6 @@ class userManagement extends plugin $this->usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'],$this->dn); $this->usertab->set_acl_base(); $this->usertab->delete (); - gosa_log ("User object '".$this->dn."' has been removed"); unset ($this->usertab); $this->usertab= NULL; } else { @@ -425,7 +422,7 @@ class userManagement extends plugin print_red (_("You are not allowed to delete this user!")); if(isset($this->ui->uid)){ - gosa_log ("Warning: '".$this->ui->uid."' tried to trick user deletion."); + @log::log("security","users/".get_class($this),$this->dn,array(),"Tried to trick deletion."); } } @@ -472,10 +469,8 @@ class userManagement extends plugin /* Save user data to ldap */ if($this->usertab->save() == 1){ - gosa_log ("User object '".$this->dn."' saving failed."); return; } - gosa_log ("User object '".$this->dn."' has been saved"); if (!isset($_POST['edit_apply'])){ /* User has been saved successfully, remove lock from LDAP. */