X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_log.inc;h=af687c39e605b2c64bcdc03cd0d0f0bc9ed97470;hb=6bc38be280f4dd4b0386b2c256749934cb37e86e;hp=ecc3bf16d9ccb543781218ff039c78a6835e3714;hpb=04d9837e72728c01a0449760b158bd8616065d84;p=gosa.git diff --git a/include/class_log.inc b/include/class_log.inc index ecc3bf16d..af687c39e 100644 --- a/include/class_log.inc +++ b/include/class_log.inc @@ -45,12 +45,17 @@ class log { */ function log($action,$objecttype,$object,$changes_array = array(),$result = TRUE) { + if(!is_array($changes_array)){ + trigger_error("log(string,string,string,array(),bool). Forth parameter must be an array."); + $changes_array = array(); + } + $entry = array(); if(!isset($_SESSION['config'])){ $entry['user']= "unkown"; }else{ - $this->config = $_SESSION['config']; + $this->config = &$_SESSION['config']; $ui = get_userinfo(); $entry['user']= @$ui->dn; } @@ -138,14 +143,14 @@ class log { } foreach($servers as $server_name => $server){ - - $con = mysql_pconnect($server_name,$server['USER'],$server['PWD']); + + $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']); if(!$con){ - print_red(sprintf(_("Could not connect to logging server %s."),$server['SERVER'])); + print_red(sprintf(_("Could not connect to logging server %s."),$server_name)); }else{ $db = mysql_select_db($server['DB'],$con); if(!$db){ - print_red(sprintf(_("Could not select database %s on server %s. Server ssys :%s"),$server['DB'],$server['SERVER'],mysql_error($con))); + @print_red(sprintf(_("Could not select database %s on server %s. Server says :%s"),$server['DB'],$server['SERVER'],mysql_error($con))); }else{ /* Create mysql syntax */ @@ -168,6 +173,7 @@ class log { } } + mysql_close($con); } } }