[Secureideas-cvs] base-php4 base_qry_alert.php,1.66,1.67
Brought to you by:
secureideas,
sinukas
From: Juergen L. <jle...@us...> - 2009-11-23 20:27:46
|
Update of /cvsroot/secureideas/base-php4 In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30701/base-php4 Modified Files: base_qry_alert.php Log Message: Some more debug code, in order to get more information for bug #2880551, at: http://sourceforge.net/tracker/?func=detail&aid=2880551&group_id=103348&atid=635582 Index: base_qry_alert.php =================================================================== RCS file: /cvsroot/secureideas/base-php4/base_qry_alert.php,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- base_qry_alert.php 21 Nov 2009 15:30:31 -0000 1.66 +++ base_qry_alert.php 23 Nov 2009 20:27:32 -0000 1.67 @@ -83,7 +83,36 @@ return $url; } -function PrintPcapDownload($db, $cid, $sid){ +function PrintPcapDownload($db, $cid, $sid) +{ + if (!isset($db)) + { + error_log("ERROR: \$db is NOT set."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db is NOT set. Ignoring."); + $debug_str = "<BR><PRE>\n\n" . debug_print_backtrace() . "\n\n</PRE><BR>\n"; + ErrorMessage($debug_str); + } + + + if (!isset($db->DB)) + { + error_log("ERROR: \$db->DB is NOT set."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db->DB is NOT set. Ignoring."); + $debug_str = "<BR><PRE>\n\n" . debug_print_backtrace() . "\n\n</PRE><BR>\n"; + ErrorMessage($debug_str); + } + + if (!is_array($db->DB->MetaColumnNames('data'))) + { + error_log("ERROR: \$db->DB->MetaColumnNames('data') is NOT an array."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db->DB->MetaColumnNames('data') is NOT an array. Ignoring."); + print "<BR><PRE>\n\n"; + debug_print_backtrace(); + print "\n\n" ; + print_r($db->DB->MetaColumnNames('data')); + print "</PRE><BR>\n\n" ; + } + if ( !in_array("pcap_header", $db->DB->MetaColumnNames('data')) || !in_array("data_header", $db->DB->MetaColumnNames('data'))) { @@ -483,6 +512,35 @@ * database schema then we can show mac addresses from `data_header` * field from `data` table */ + if (!isset($db)) + { + error_log("ERROR: \$db is NOT set."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db is NOT set. Ignoring."); + $debug_str = "<BR><PRE>\n\n" . debug_print_backtrace() . "\n\n</PRE><BR>\n"; + ErrorMessage($debug_str); + } + + + if (!isset($db->DB)) + { + error_log("ERROR: \$db->DB is NOT set."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db->DB is NOT set. Ignoring."); + $debug_str = "<BR><PRE>\n\n" . debug_print_backtrace() . "\n\n</PRE><BR>\n"; + ErrorMessage($debug_str); + } + + if (!is_array($db->DB->MetaColumnNames('data'))) + { + error_log("ERROR: \$db->DB->MetaColumnNames('data') is NOT an array."); + ErrorMessage(__FILE__ . ":" . __LINE__ . ": db->DB->MetaColumnNames('data') is NOT an array. Ignoring."); + print "<BR><PRE>\n\n"; + debug_print_backtrace(); + print "\n\n" ; + print_r($db->DB->MetaColumnNames('data')); + print "</PRE><BR>\n\n" ; + } + + if (in_array("data_header", $db->DB->MetaColumnNames('data'))) { $sql5 = "SELECT data_header FROM data WHERE sid='$sid' AND cid='$cid'"; |