Module: nagvis Branch: master Commit: 85a4c55c63cbca37c63b09ef6967da96b8017579 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/nagvis;a=commit;h=85a4c55c63cbca37c63b09ef6967da96b8017579
Author: Roman Kyrylych <[email protected]> Date: Thu Sep 3 17:35:50 2009 +0300 Return an empty array for unknown {host,service}groupName Signed-off-by: Roman Kyrylych <[email protected]> --- .../includes/classes/GlobalBackendmerlinmy.php | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/share/nagvis/includes/classes/GlobalBackendmerlinmy.php b/share/nagvis/includes/classes/GlobalBackendmerlinmy.php index c2d75b7..1b914cc 100755 --- a/share/nagvis/includes/classes/GlobalBackendmerlinmy.php +++ b/share/nagvis/includes/classes/GlobalBackendmerlinmy.php @@ -598,9 +598,7 @@ class GlobalBackendmerlinmy implements GlobalBackendInterface { .' LEFT JOIN hostgroup AS hg ON hg.id = hhg.hostgroup' ." WHERE hg.hostgroup_name = '$hostgroupName'"); - if(mysql_num_rows($QUERYHANDLE) == 0) { - $arrReturn['state'] = 'ERROR'; - } else { + if(mysql_num_rows($QUERYHANDLE)) { while($data = mysql_fetch_array($QUERYHANDLE)) { $arrRow = Array('name' => $data['host_name']); @@ -677,9 +675,7 @@ class GlobalBackendmerlinmy implements GlobalBackendInterface { .' LEFT JOIN servicegroup AS sg ON sg.id = ssg.servicegroup' ." WHERE sg.servicegroup_name = '$servicegroupName'"); - if(mysql_num_rows($QUERYHANDLE) == 0) { - $arrReturn['state'] = 'ERROR'; - } else { + if(mysql_num_rows($QUERYHANDLE)) { while($data = mysql_fetch_array($QUERYHANDLE)) { $arrRow = Array('host'] => $data['host_name'], 'description' => $data['service_description']); ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
