From: hickert Date: Tue, 4 Dec 2007 09:51:05 +0000 (+0000) Subject: Closes #291 Added some debug informations X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=88049e2b55ab053cb733ff9ef5cdf026eb40ca76;p=gosa.git Closes #291 Added some debug informations git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7996 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index 9a10edd43..27c53b66e 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -406,6 +406,7 @@ class conference extends plugin if($this->goFonHomeServer != $this->init_HomeServer){ $query = "SELECT id FROM ".$cfg_Current['EXT_TABLE']." WHERE exten='".$this->telephoneNumber."' OR '".$this->cn."';"; $res = @mysql_query($query,$res_cur); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ gosa_log(@mysql_error($res_cur)); return(_("Can not check if there are already some entries with given telephone number and/or cn in the destination home server."). @@ -418,6 +419,7 @@ class conference extends plugin /* Query and ensure that everything went fine */ $res = @mysql_query($SQL,$res_cur); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$SQL, "Database query"); if(!$res){ gosa_log(@mysql_error($res_cur)); return(_("Can not remove entries with some telephone number and/or cn from destination home server."). @@ -503,6 +505,7 @@ class conference extends plugin } foreach($SQL as $sqlsyn){ mysql_query($sqlsyn,$res_cur); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$sqlsyn, "Database query"); } } @@ -536,6 +539,7 @@ class conference extends plugin /* Check if there is an old entry */ $query = "SELECT id FROM ".$cfg_Init['EXT_TABLE']." WHERE exten='".$this->old_tele_number."' OR '".$this->old_cn."';"; $res = @mysql_query($query,$r_init); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ gosa_log(@mysql_error($r_init)); return(_("Can not check if entry exists in old database. Please have a look a the gosa logfiles.")); @@ -549,6 +553,7 @@ class conference extends plugin /* Query and ensure that everything went fine */ $res = @mysql_query($SQL,$r_init); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$SQL, "Database query"); if(!$res){ gosa_log(@mysql_error($r_init)); return(_("Can not remove old entries from initial home server. Please have a look a the gosa logfiles.")); diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index a7a8a6c13..b3ac8d456 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -217,6 +217,7 @@ class macro extends plugin $r_current = @mysql_pconnect($Server['SERVER'],$Server['LOGIN'],$Server['PASSWORD']); $db_current = @mysql_select_db($Server['DB'],$r_current); $res = @mysql_query($query,$r_current); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ gosa_log(@mysql_error($r_current)); return(sprintf(_("Removing macro from '%s' failed. Check GOsa log for mysql error."),$Server['SERVER'])); @@ -325,6 +326,7 @@ class macro extends plugin $db = @mysql_select_db($cfg['DB'],$r_con); $query = preg_replace("/%TABLENAME%/",$cfg['EXT_TABLE'],$sql); $res = @mysql_query($query,$r_con); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ gosa_log(@mysql_error($r_con)); return(sprintf(_("Insert of new macro failed for server '%s'."),$cfg['SERVER'])); diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 950484fe2..f1d41463b 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -257,8 +257,12 @@ class phoneAccount extends plugin $r_con = @mysql_pconnect($cur_cfg['SERVER'],$cur_cfg['LOGIN'],$cur_cfg['PASSWORD']); if($r_con){ $r_db = @mysql_select_db($cur_cfg['DB'],$r_con); - $vp = mysql_fetch_row(mysql_query("SELECT ".$cur_cfg['VOICE_TABLE'].".password FROM ".$cur_cfg['VOICE_TABLE'].", ".$cur_cfg['SIP_TABLE']." WHERE customer_id = sip_users.mailbox AND name='".$this->uid."'")); + + $query_tmp = "SELECT ".$cur_cfg['VOICE_TABLE'].".password FROM ".$cur_cfg['VOICE_TABLE'].", ". + $cur_cfg['SIP_TABLE']." WHERE customer_id = sip_users.mailbox AND name='".$this->uid."'"; + $vp = mysql_fetch_row(mysql_query($query_tmp)); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query_tmp, "Database query"); if((isset($vp[0]))&&(!empty($vp[0]))){ $this->goFonPINVoice = $vp[0]; } @@ -472,6 +476,7 @@ class phoneAccount extends plugin if($old_connection){ $query = "SELECT id,name,callerid FROM ".$a_Remove['SIP_TABLE']." WHERE name='".$this->uid."';"; $rid = mysql_query($query,$old_connection); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); /* Old entry found, remove it */ $query_a = array(); @@ -485,6 +490,7 @@ class phoneAccount extends plugin } foreach($query_a as $qry){ + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$qry, "Database query"); if(!mysql_query($qry,$old_connection)){ echo mysql_error($old_connection); } @@ -504,7 +510,9 @@ class phoneAccount extends plugin /* Check if there is already an entry in sip_users for this uid */ $SQL_query_array = array(); - $rid = mysql_query("SELECT * FROM ".$a_New['SIP_TABLE']." WHERE name='".$this->uid."';\n",$new_connection); + $query = "SELECT * FROM ".$a_New['SIP_TABLE']." WHERE name='".$this->uid."';\n"; + $rid = mysql_query($query,$new_connection); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(mysql_affected_rows($new_connection)){ /********************** @@ -611,7 +619,9 @@ class phoneAccount extends plugin } /* Check if there is already an entry in sip_users for this uid */ - $rid = mysql_query("SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".$customer_id."';\n",$new_connection); + $query_tmp = "SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".$customer_id."';\n"; + $rid = mysql_query($query_tmp,$new_connection); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query_tmp, "Database query"); if(mysql_affected_rows($new_connection)){ /********************** @@ -673,6 +683,7 @@ class phoneAccount extends plugin $query[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$s_telenums."\";"; } foreach($query as $qry){ + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$qry, "Database query"); if(!mysql_query($qry,$new_connection)){ echo mysql_error($new_connection); } @@ -759,6 +770,7 @@ class phoneAccount extends plugin // Perform queries ... if($this->goFonHardware != "automatic"){ foreach($SQL_query_array as $query){ + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!@mysql_query($query,$new_connection)){ print_red(_("Error while performing query:")." ".mysql_error()); return false; @@ -1307,6 +1319,7 @@ class phoneAccount extends plugin $SQL[] = "DELETE FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".$this->uid."';\n"; foreach($SQL as $query){ + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!@mysql_query($query,$r_con)){ print_red(_("Stop".mysql_error())); return false;