From 03ace41f27d274a8a82ad57defa833bf6cecd6d6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 May 2007 07:47:34 +0000 Subject: [PATCH] updated logging git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6448 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_ogroupManagement.inc | 7 ++----- plugins/admin/ogroups/class_phonequeue.inc | 14 +++++++------- plugins/admin/ogroups/class_termgroup.inc | 6 ------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 2cb1f755a..b5ab277dc 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -178,7 +178,6 @@ class ogroupManagement extends plugin /* Delete request is permitted, perform LDAP action */ $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $dn); $this->ogroup->delete (); - gosa_log ("Object group'".$dn."' has been removed"); unset ($this->ogroup); $this->ogroup= NULL; } else { @@ -186,7 +185,7 @@ class ogroupManagement 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 object group!")); - gosa_log ("Warning: '".$this->ui->uid."' tried to trick group deletion."); + @log::log("security","ogroups/".get_class($this),$dn,array(),"Tried to trick deletion."); } /* Remove lock file after successfull deletion */ del_lock ($dn); @@ -258,7 +257,6 @@ class ogroupManagement extends plugin $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $this->dn); $this->ogroup->delete (); - gosa_log ("Object group'".$this->dn."' has been removed"); unset ($this->ogroup); $this->ogroup= NULL; } else { @@ -266,7 +264,7 @@ class ogroupManagement 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 object group!")); - gosa_log ("Warning: '".$this->ui->uid."' tried to trick group deletion."); + @log::log("security","ogroups/".get_class($this),$dn,array(),"Tried to trick deletion."); } /* Remove lock file after successfull deletion */ @@ -327,7 +325,6 @@ class ogroupManagement extends plugin /* Save user data to ldap */ $this->ogroup->save(); - gosa_log ("Object group'".$this->dn."' has been saved"); if (!isset($_POST['edit_apply'])){ /* Group has been saved successfully, remove lock from diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 66933896e..6f615cff1 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -157,13 +157,13 @@ class phonequeue extends plugin $cfg_Current = $this->goFonHomeServers[$this->goFonHomeServer]; $r_current = @mysql_pconnect($cfg_Current['SERVER'],$cfg_Current['LOGIN'],$cfg_Current['PASSWORD']); if(!$r_current){ - gosa_log(@mysql_error($r_current)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current)); return(sprintf(_("The MySQL home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."), $cfg_Current['SERVER'],$cfg_Current['LOGIN'])); } $db_current = @mysql_select_db($cfg_Current['DB'],$r_current); if(!$db_current){ - gosa_log(@mysql_error($r_current)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current)); mysql_close($r_current); return( sprintf(_("Can't select database '%s' on home server '%s'."),$cfg_Current['DB'],$cfg_Current['SERVER'])); } @@ -176,13 +176,13 @@ class phonequeue extends plugin $cfg_Init = $this->goFonHomeServers[$this->init_HomeServer] ; $r_init = @mysql_pconnect($cfg_Init['SERVER'],$cfg_Init['LOGIN'],$cfg_Init['PASSWORD']); if(!$r_init){ - gosa_log(@mysql_error($r_init)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_init)); return(sprintf(_("The MySQL initial home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."), $cfg_Init['SERVER'],$cfg_Init['LOGIN'])); } $db_init = @mysql_select_db($cfg_Init['DB'],$r_init); if(!$db_init){ - gosa_log(@mysql_error($r_init)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_init)); mysql_close($r_init); return( sprintf(_("Can't select database '%s' on initial home server '%s'."),$cfg_Init['DB'],$cfg_Init['SERVER'])); } @@ -379,7 +379,7 @@ class phonequeue extends plugin foreach($delete as $sql){ $res = @mysql_query($sql,$res_cur); if(!$res){ - gosa_log(@mysql_error($res_cur)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current)); return(_("Error while removing old queue entries from database."). " "._("Please have a look a the gosa logfiles.")); } @@ -439,7 +439,7 @@ class phonequeue extends plugin $query = "SELECT * FROM ".$cfg_Current['QUEUE_TABLE']." WHERE name='".$this->old_cn."';"; $res = mysql_query($query,$res_cur); if(!$res){ - gosa_log(@mysql_error($res_cur)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($res_cur)); return(_("Could not detect old queue entry, query failed.")." "._("Please have a look a the gosa logfiles.")); } $cnt = mysql_affected_rows($res_cur); @@ -734,7 +734,7 @@ class phonequeue extends plugin foreach($SQL as $query) $res = mysql_query($query,$res_cur); if(!$res){ - gosa_log(@mysql_error($res_cur)); + @log::log("debug","ogroups/".get_class($this),"",array(),@mysql_error($res_cur)); return(_("Mysql query failed.")." "._("Please have a look a the gosa logfiles.")); } } diff --git a/plugins/admin/ogroups/class_termgroup.inc b/plugins/admin/ogroups/class_termgroup.inc index b8c1d68dd..a05c6a1c0 100644 --- a/plugins/admin/ogroups/class_termgroup.inc +++ b/plugins/admin/ogroups/class_termgroup.inc @@ -166,12 +166,6 @@ class termgroup extends plugin $ldap->cd ($key); $ldap->modify($attrs); show_ldap_error($ldap->get_error(),sprintf(_("Setting action state (FAIstate) failed for object '%s', value was '%s'."),$key,$action)); - - if(!preg_match("/success/i",$ldap->get_error())) { - gosa_log("FAILED !! Updating FAIstate to '".$action."' : ".$key); - }else{ - gosa_log("OK. Updating FAIstate to '".$action."' : ".$key); - } } } } -- 2.30.2