diff options
Diffstat (limited to 'frontends')
43 files changed, 881 insertions, 873 deletions
diff --git a/frontends/php/actions.php b/frontends/php/actions.php index 467a7d22..171ab0bd 100644 --- a/frontends/php/actions.php +++ b/frontends/php/actions.php @@ -28,7 +28,7 @@ ?> <?php - if(($HTTP_GET_VARS["triggerid"]!=0)&&!check_right_on_trigger("U",$HTTP_GET_VARS["triggerid"])) + if(($_GET["triggerid"]!=0)&&!check_right_on_trigger("U",$_GET["triggerid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -37,54 +37,54 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_action( $HTTP_GET_VARS["triggerid"], $HTTP_GET_VARS["userid"], $HTTP_GET_VARS["good"], $HTTP_GET_VARS["delay"], $HTTP_GET_VARS["subject"], $HTTP_GET_VARS["message"],$HTTP_GET_VARS["scope"],$HTTP_GET_VARS["severity"],$HTTP_GET_VARS["recipient"],$HTTP_GET_VARS["usrgrpid"]); + $result=add_action( $_GET["triggerid"], $_GET["userid"], $_GET["good"], $_GET["delay"], $_GET["subject"], $_GET["message"],$_GET["scope"],$_GET["severity"],$_GET["recipient"],$_GET["usrgrpid"]); show_messages($result,S_ACTION_ADDED,S_CANNOT_ADD_ACTION); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_action( $HTTP_GET_VARS["actionid"], $HTTP_GET_VARS["triggerid"], $HTTP_GET_VARS["userid"], $HTTP_GET_VARS["good"], $HTTP_GET_VARS["delay"], $HTTP_GET_VARS["subject"], $HTTP_GET_VARS["message"],$HTTP_GET_VARS["scope"],$HTTP_GET_VARS["severity"],$HTTP_GET_VARS["recipient"],$HTTP_GET_VARS["usrgrpid"]); + $result=update_action( $_GET["actionid"], $_GET["triggerid"], $_GET["userid"], $_GET["good"], $_GET["delay"], $_GET["subject"], $_GET["message"],$_GET["scope"],$_GET["severity"],$_GET["recipient"],$_GET["usrgrpid"]); show_messages($result,S_ACTION_UPDATED,S_CANNOT_UPATE_ACTION); - unset($HTTP_GET_VARS["actionid"]); + unset($_GET["actionid"]); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_action($HTTP_GET_VARS["actionid"]); + $result=delete_action($_GET["actionid"]); show_messages($result,S_ACTION_DELETED,S_CANNOT_DELETE_ACTION); - unset($HTTP_GET_VARS["actionid"]); + unset($_GET["actionid"]); } } ?> <?php - $trigger=get_trigger_by_triggerid($HTTP_GET_VARS["triggerid"]); + $trigger=get_trigger_by_triggerid($_GET["triggerid"]); $expression=explode_exp($trigger["expression"],1); // $description=$trigger["description"]; // if( strstr($description,"%s")) // { - $description=expand_trigger_description($HTTP_GET_VARS["triggerid"]); + $description=expand_trigger_description($_GET["triggerid"]); // } show_table_header("$description<BR>$expression"); ?> <?php -/* if(isset($HTTP_GET_VARS["scope"])&&($HTTP_GET_VARS["scope"]==2)) +/* if(isset($_GET["scope"])&&($_GET["scope"]==2)) { $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.recipient,a.scope from actions a order by a.scope desc"; } - elseif(isset($HTTP_GET_VARS["scope"])&&($HTTP_GET_VARS["scope"]==1)) + elseif(isset($_GET["scope"])&&($_GET["scope"]==1)) { $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.recipient,a.scope from actions a where a.scope=2 or a.scope=1 order by a.recipient desc"; } else { - $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.recipient,a.scope from actions a where (a.triggerid=".$HTTP_GET_VARS["triggerid"]." and a.scope=0) or (a.scope=2 or a.scope=1) order by a.recipient desc"; + $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.recipient,a.scope from actions a where (a.triggerid=".$_GET["triggerid"]." and a.scope=0) or (a.scope=2 or a.scope=1) order by a.recipient desc"; }*/ // echo $sql; - $sql="select actionid,userid,delay,subject,message,scope,severity,recipient,good,triggerid from actions where (scope=0 and triggerid=".$HTTP_GET_VARS["triggerid"].") or scope=1 or scope=2"; + $sql="select actionid,userid,delay,subject,message,scope,severity,recipient,good,triggerid from actions where (scope=0 and triggerid=".$_GET["triggerid"].") or scope=1 or scope=2"; $result=DBselect($sql); echo "<div align=center>"; @@ -104,7 +104,7 @@ if($row["scope"] == 1) { - $sql="select h.hostid from triggers t,hosts h,functions f,items i where f.triggerid=t.triggerid and h.hostid=i.hostid and i.itemid=f.itemid and t.triggerid=".$HTTP_GET_VARS["triggerid"]; + $sql="select h.hostid from triggers t,hosts h,functions f,items i where f.triggerid=t.triggerid and h.hostid=i.hostid and i.itemid=f.itemid and t.triggerid=".$_GET["triggerid"]; // echo "$sql<br>"; $result2=DBselect($sql); $found=0; @@ -159,7 +159,7 @@ // echo "<pre>".htmlspecialchars($row["message"])."</pre>"; // echo "</TD>"; echo "<TD>"; - echo " <A HREF=\"actions.php?register=edit&actionid=".$row["actionid"]."&triggerid=".$HTTP_GET_VARS["triggerid"]."#form\">Change</A>"; + echo " <A HREF=\"actions.php?register=edit&actionid=".$row["actionid"]."&triggerid=".$_GET["triggerid"]."#form\">Change</A>"; echo "</TD></TR>"; } if(DBnum_rows($result)==0) @@ -178,9 +178,9 @@ <?php echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["actionid"])) + if(isset($_GET["actionid"])) { - $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.scope,a.severity,a.recipient from actions a where a.actionid=".$HTTP_GET_VARS["actionid"]; + $sql="select a.actionid,a.triggerid,a.good,a.delay,a.subject,a.message,a.userid,a.scope,a.severity,a.recipient from actions a where a.actionid=".$_GET["actionid"]; $result=DBselect($sql); $actionid=DBget_field($result,0,0); @@ -191,30 +191,30 @@ $subject=htmlspecialchars(DBget_field($result,0,4)); $message=DBget_field($result,0,5); $uid=DBget_field($result,0,6); - $scope=@iif(isset($HTTP_GET_VARS["scope"]),$HTTP_GET_VARS["scope"],DBget_field($result,0,7)); + $scope=@iif(isset($_GET["scope"]),$_GET["scope"],DBget_field($result,0,7)); $severity=DBget_field($result,0,8); - $recipient=@iif(isset($HTTP_GET_VARS["recipient"]),$HTTP_GET_VARS["recipient"],DBget_field($result,0,9)); + $recipient=@iif(isset($_GET["recipient"]),$_GET["recipient"],DBget_field($result,0,9)); } else { - $trigger=get_trigger_by_triggerid($HTTP_GET_VARS["triggerid"]); + $trigger=get_trigger_by_triggerid($_GET["triggerid"]); $description=htmlspecialchars(stripslashes($trigger["description"])); // $delay=30; - $delay=@iif(isset($HTTP_GET_VARS["delay"]),$HTTP_GET_VARS["delay"],30); + $delay=@iif(isset($_GET["delay"]),$_GET["delay"],30); // $subject=$description; - $subject=@iif(isset($HTTP_GET_VARS["subject"]),$HTTP_GET_VARS["subject"],$description); - $scope=@iif(isset($HTTP_GET_VARS["scope"]),$HTTP_GET_VARS["scope"],0); - $good=@iif(isset($HTTP_GET_VARS["good"]),$HTTP_GET_VARS["good"],1); - $recipient=@iif(isset($HTTP_GET_VARS["recipient"]),$HTTP_GET_VARS["recipient"],RECIPIENT_TYPE_GROUP); + $subject=@iif(isset($_GET["subject"]),$_GET["subject"],$description); + $scope=@iif(isset($_GET["scope"]),$_GET["scope"],0); + $good=@iif(isset($_GET["good"]),$_GET["good"],1); + $recipient=@iif(isset($_GET["recipient"]),$_GET["recipient"],RECIPIENT_TYPE_GROUP); // $severity=0; - $severity=@iif(isset($HTTP_GET_VARS["severity"]),$HTTP_GET_VARS["severity"],0); + $severity=@iif(isset($_GET["severity"]),$_GET["severity"],0); - $sql="select i.description, h.host, i.key_ from hosts h, items i,functions f where f.triggerid=".$HTTP_GET_VARS["triggerid"]." and h.hostid=i.hostid and f.itemid=i.itemid order by i.description"; + $sql="select i.description, h.host, i.key_ from hosts h, items i,functions f where f.triggerid=".$_GET["triggerid"]." and h.hostid=i.hostid and f.itemid=i.itemid order by i.description"; $result=DBselect($sql); - if(isset($HTTP_GET_VARS["message"])) + if(isset($_GET["message"])) { - $message=$HTTP_GET_VARS["message"]; + $message=$_GET["message"]; } else { @@ -234,10 +234,10 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"actions.php\">"; - echo "<input name=\"triggerid\" type=\"hidden\" value=".$HTTP_GET_VARS["triggerid"].">"; - if(isset($HTTP_GET_VARS["actionid"])) + echo "<input name=\"triggerid\" type=\"hidden\" value=".$_GET["triggerid"].">"; + if(isset($_GET["actionid"])) { - echo "<input name=\"actionid\" type=\"hidden\" value=".$HTTP_GET_VARS["actionid"].">"; + echo "<input name=\"actionid\" type=\"hidden\" value=".$_GET["actionid"].">"; } echo nbsp(S_SEND_MESSAGE_TO); show_table2_h_delimiter(); diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php index c623c474..858993ef 100644 --- a/frontends/php/alarms.php +++ b/frontends/php/alarms.php @@ -27,7 +27,7 @@ ?> <?php - if(!check_right_on_trigger("R",$HTTP_GET_VARS["triggerid"])) + if(!check_right_on_trigger("R",$_GET["triggerid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -41,7 +41,7 @@ show_table_v_delimiter(); - if(!isset($HTTP_GET_VARS["triggerid"])) + if(!isset($_GET["triggerid"])) { echo "<div align=center><B>No triggerID!!!!</B><BR>Please Contact Server Adminstrator</div>"; show_footer(); @@ -49,7 +49,7 @@ } else { - $trigger=get_trigger_by_triggerid($HTTP_GET_VARS["triggerid"]); + $trigger=get_trigger_by_triggerid($_GET["triggerid"]); $Expression=$trigger["expression"]; $Description=$trigger["description"]; @@ -58,16 +58,16 @@ ?> <?php - if(isset($HTTP_GET_VARS["limit"]) && ($HTTP_GET_VARS["limit"]=="NO")) + if(isset($_GET["limit"]) && ($_GET["limit"]=="NO")) { - echo "[<A HREF=\"alarms.php?triggerid=".$HTTP_GET_VARS["triggerid"]."&limit=30\">"; + echo "[<A HREF=\"alarms.php?triggerid=".$_GET["triggerid"]."&limit=30\">"; echo S_SHOW_ONLY_LAST_100; echo "</A>]"; $limit=" "; } else { - echo "[<A HREF=\"alarms.php?triggerid=".$HTTP_GET_VARS["triggerid"]."&limit=NO\">"; + echo "[<A HREF=\"alarms.php?triggerid=".$_GET["triggerid"]."&limit=NO\">"; echo S_SHOW_ALL; echo "</A>]"; $limit=" limit 100"; @@ -89,7 +89,7 @@ <FONT COLOR="#000000"> <?php - $sql="select clock,value,triggerid from alarms where triggerid=".$HTTP_GET_VARS["triggerid"]." order by clock desc $limit"; + $sql="select clock,value,triggerid from alarms where triggerid=".$_GET["triggerid"]." order by clock desc $limit"; $result=DBselect($sql); echo "<TABLE WIDTH=100% align=center BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index 80581254..cee3188b 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -33,15 +33,15 @@ ?> <?php - if(isset($HTTP_GET_VARS["start"])&&($HTTP_GET_VARS["start"]<=0)) + if(isset($_GET["start"])&&($_GET["start"]<=0)) { - unset($HTTP_GET_VARS["start"]); + unset($_GET["start"]); } - if(isset($HTTP_GET_VARS["start"])) + if(isset($_GET["start"])) { - echo "[<A HREF=\"alerts.php?start=".($HTTP_GET_VARS["start"]-100)."\">"; + echo "[<A HREF=\"alerts.php?start=".($_GET["start"]-100)."\">"; echo "Show previous 100</A>] "; - echo "[<A HREF=\"alerts.php?start=".($HTTP_GET_VARS["start"]+100)."\">"; + echo "[<A HREF=\"alerts.php?start=".($_GET["start"]+100)."\">"; echo S_SHOW_NEXT_100; echo "</A>]"; } @@ -66,13 +66,13 @@ $row=DBfetch($result); $maxalertid=@iif(DBnum_rows($result)>0,$row["max"],0); - if(!isset($HTTP_GET_VARS["start"])) + if(!isset($_GET["start"])) { $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries,ac.scope from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200 order by a.clock desc limit 200"; } else { - $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries,ac.scope from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200-".$HTTP_GET_VARS["start"]." order by a.clock desc limit ".($HTTP_GET_VARS["start"]+500); + $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries,ac.scope from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200-".$_GET["start"]." order by a.clock desc limit ".($_GET["start"]+500); } $result=DBselect($sql); @@ -90,7 +90,7 @@ while($row=DBfetch($result)) { $zzz++; - if(isset($HTTP_GET_VARS["start"])&&($zzz<$HTTP_GET_VARS["start"])) + if(isset($_GET["start"])&&($zzz<$_GET["start"])) { continue; } diff --git a/frontends/php/chart.php b/frontends/php/chart.php index 3afe8304..099d6306 100644 --- a/frontends/php/chart.php +++ b/frontends/php/chart.php @@ -23,27 +23,27 @@ include "include/classes.inc.php"; $graph=new Graph(); - if(isset($HTTP_GET_VARS["period"])) + if(isset($_GET["period"])) { - $graph->setPeriod($HTTP_GET_VARS["period"]); + $graph->setPeriod($_GET["period"]); } - if(isset($HTTP_GET_VARS["from"])) + if(isset($_GET["from"])) { - $graph->setFrom($HTTP_GET_VARS["from"]); + $graph->setFrom($_GET["from"]); } - if(isset($HTTP_GET_VARS["width"])) + if(isset($_GET["width"])) { - $graph->setWidth($HTTP_GET_VARS["width"]); + $graph->setWidth($_GET["width"]); } - if(isset($HTTP_GET_VARS["height"])) + if(isset($_GET["height"])) { - $graph->setHeight($HTTP_GET_VARS["height"]); + $graph->setHeight($_GET["height"]); } - if(isset($HTTP_GET_VARS["border"])) + if(isset($_GET["border"])) { $graph->setBorder(0); } - $graph->addItem($HTTP_GET_VARS["itemid"]); + $graph->addItem($_GET["itemid"]); $graph->Draw(); ?> diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index 2f223b06..5d19b89b 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -23,37 +23,37 @@ include "include/classes.inc.php"; $graph=new Graph(); - if(isset($HTTP_GET_VARS["period"])) + if(isset($_GET["period"])) { - $graph->setPeriod($HTTP_GET_VARS["period"]); + $graph->setPeriod($_GET["period"]); } - if(isset($HTTP_GET_VARS["from"])) + if(isset($_GET["from"])) { - $graph->setFrom($HTTP_GET_VARS["from"]); + $graph->setFrom($_GET["from"]); } - if(isset($HTTP_GET_VARS["stime"])) + if(isset($_GET["stime"])) { - $graph->setSTime($HTTP_GET_VARS["stime"]); + $graph->setSTime($_GET["stime"]); } - if(isset($HTTP_GET_VARS["border"])) + if(isset($_GET["border"])) { $graph->setBorder(0); } - $result=DBselect("select name,width,height from graphs where graphid=".$HTTP_GET_VARS["graphid"]); + $result=DBselect("select name,width,height from graphs where graphid=".$_GET["graphid"]); $name=DBget_field($result,0,0); - if(isset($HTTP_GET_VARS["width"])&&$HTTP_GET_VARS["width"]>0) + if(isset($_GET["width"])&&$_GET["width"]>0) { - $width=$HTTP_GET_VARS["width"]; + $width=$_GET["width"]; } else { $width=DBget_field($result,0,1); } - if(isset($HTTP_GET_VARS["height"])&&$HTTP_GET_VARS["height"]>0) + if(isset($_GET["height"])&&$_GET["height"]>0) { - $height=$HTTP_GET_VARS["height"]; + $height=$_GET["height"]; } else { @@ -64,7 +64,7 @@ $graph->setHeight($height); $graph->setHeader(DBget_field($result,0,0)); - $result=DBselect("select gi.itemid,i.description,gi.color,h.host,gi.drawtype from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=".$HTTP_GET_VARS["graphid"]." and i.hostid=h.hostid order by gi.sortorder"); + $result=DBselect("select gi.itemid,i.description,gi.color,h.host,gi.drawtype from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=".$_GET["graphid"]." and i.hostid=h.hostid order by gi.sortorder"); for($i=0;$i<DBnum_rows($result);$i++) { diff --git a/frontends/php/chart3.php b/frontends/php/chart3.php index d5ff55c4..35eb457d 100644 --- a/frontends/php/chart3.php +++ b/frontends/php/chart3.php @@ -28,20 +28,20 @@ $start_time=time(NULL); - if(!isset($HTTP_GET_VARS["type"])) + if(!isset($_GET["type"])) { - $HTTP_GET_VARS["type"]="week"; + $_GET["type"]="week"; } - if($HTTP_GET_VARS["type"] == "month") + if($_GET["type"] == "month") { $period=30*24*3600; } - else if($HTTP_GET_VARS["type"] == "week") + else if($_GET["type"] == "week") { $period=7*24*3600; } - else if($HTTP_GET_VARS["type"] == "year") + else if($_GET["type"] == "year") { $period=365*24*3600; } @@ -51,9 +51,9 @@ $type="week"; } - if(isset($HTTP_GET_VARS["width"])&&$HTTP_GET_VARS["width"]>0) + if(isset($_GET["width"])&&$_GET["width"]>0) { - $sizeX=$HTTP_GET_VARS["width"]; + $sizeX=$_GET["width"]; } else { @@ -94,7 +94,7 @@ ImageFilledRectangle($im,0,0,$sizeX+$shiftX+61,$sizeY+$shiftYup+$shiftYdown+10,$white); ImageRectangle($im,0,0,$x-1,$y-1,$black); - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); // show_footer(); @@ -114,7 +114,7 @@ $max=array(); $avg=array(); - $sql="select round(900*((clock+3*3600)%(24*3600))/(24*3600)) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$from_time and clock<$to_time group by 1"; + $sql="select round(900*((clock+3*3600)%(24*3600))/(24*3600)) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid=".$_GET["itemid"]." and clock>$from_time and clock<$to_time group by 1"; // echo $sql."<br>"; $result=DBselect($sql); while($row=DBfetch($result)) @@ -129,7 +129,7 @@ $count_now=array(); $avg_now=array(); - $result=DBselect("select round(900*((clock+3*3600)%(24*3600))/(24*3600)) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$from_time_now and clock<$to_time group by 1"); + $result=DBselect("select round(900*((clock+3*3600)%(24*3600))/(24*3600)) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid=".$_GET["itemid"]." and clock>$from_time_now and clock<$to_time group by 1"); while($row=DBfetch($result)) { $i=$row["i"]; @@ -258,7 +258,7 @@ if(isset($nodata)&&($nodata == 0)) { - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); for($i=0;$i<=$sizeY;$i+=$sizeY/5) { ImageString($im, 1, $sizeX+5+$shiftX, $sizeY-$i-4+$shiftYup, convert_units($i*($maxY-$minY)/$sizeY+$minY,$item["units"],$item["multiplier"]) , $darkred); @@ -276,11 +276,11 @@ ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+19+15*0,$shiftX+5,$sizeY+$shiftYup+15+9+15*0,$darkgreen); ImageRectangle($im,$shiftX,$sizeY+$shiftYup+19+15*0,$shiftX+5,$sizeY+$shiftYup+15+9+15*0,$black); - if($HTTP_GET_VARS["type"]=="year") + if($_GET["type"]=="year") { ImageString($im, 2,$shiftX+9,$sizeY+$shiftYup+15*0+15, "Average for last 365 days", $black); } - else if($HTTP_GET_VARS["type"]=="month") + else if($_GET["type"]=="month") { ImageString($im, 2,$shiftX+9,$sizeY+$shiftYup+15*0+15, "Average for last 30 days", $black); } diff --git a/frontends/php/chart4.php b/frontends/php/chart4.php index 14dcea06..2a7000c0 100644 --- a/frontends/php/chart4.php +++ b/frontends/php/chart4.php @@ -28,20 +28,20 @@ $start_time=time(NULL); - if(!isset($HTTP_GET_VARS["type"])) + if(!isset($_GET["type"])) { - $HTTP_GET_VARS["type"]="week"; + $_GET["type"]="week"; } - if($HTTP_GET_VARS["type"] == "month") + if($_GET["type"] == "month") { $period=30*24*3600; } - else if($HTTP_GET_VARS["type"] == "week") + else if($_GET["type"] == "week") { $period=7*24*3600; } - else if($HTTP_GET_VARS["type"] == "year") + else if($_GET["type"] == "year") { $period=365*24*3600; } @@ -88,7 +88,7 @@ ImageFilledRectangle($im,0,0,$x,$y,$white); ImageRectangle($im,0,0,$x-1,$y-1,$black); - if(!check_right_on_trigger("R",$HTTP_GET_VARS["triggerid"])) + if(!check_right_on_trigger("R",$_GET["triggerid"])) { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); // show_footer(); @@ -98,12 +98,12 @@ } -// $trigger=get_trigger_by_triggerid($HTTP_GET_VARS["triggerid"]); +// $trigger=get_trigger_by_triggerid($_GET["triggerid"]); // $str=$trigger["description"]; // if( strstr($str,"%s")) // { - $str=expand_trigger_description($HTTP_GET_VARS["triggerid"]); + $str=expand_trigger_description($_GET["triggerid"]); // } $str=$str." (year ".date("Y").")"; @@ -129,7 +129,7 @@ { $period_start=$start+7*24*3600*$i; $period_end=$start+7*24*3600*($i+1); - $stat=calculate_availability($HTTP_GET_VARS["triggerid"],$period_start,$period_end); + $stat=calculate_availability($_GET["triggerid"],$period_start,$period_end); $true[$i]=$stat["true"]; $false[$i]=$stat["false"]; diff --git a/frontends/php/chart5.php b/frontends/php/chart5.php index 189f1b59..f8a8ab1b 100644 --- a/frontends/php/chart5.php +++ b/frontends/php/chart5.php @@ -28,20 +28,20 @@ $start_time=time(NULL); - if(!isset($HTTP_GET_VARS["type"])) + if(!isset($_GET["type"])) { - $HTTP_GET_VARS["type"]="week"; + $_GET["type"]="week"; } - if($HTTP_GET_VARS["type"] == "month") + if($_GET["type"] == "month") { $period=30*24*3600; } - else if($HTTP_GET_VARS["type"] == "week") + else if($_GET["type"] == "week") { $period=7*24*3600; } - else if($HTTP_GET_VARS["type"] == "year") + else if($_GET["type"] == "year") { $period=365*24*3600; } @@ -88,7 +88,7 @@ ImageFilledRectangle($im,0,0,$x,$y,$white); ImageRectangle($im,0,0,$x-1,$y-1,$black); -// if(!check_right_on_trigger("R",$HTTP_GET_VARS["triggerid"])) +// if(!check_right_on_trigger("R",$_GET["triggerid"])) // { // ImagePng($im); // ImageDestroy($im); @@ -96,7 +96,7 @@ // } - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); + $service=get_service_by_serviceid($_GET["serviceid"]); $str=$service["name"]." (year ".date("Y").")"; $x=imagesx($im)/2-ImageFontWidth(4)*strlen($str)/2; @@ -120,7 +120,7 @@ { $period_start=$start+7*24*3600*$i; $period_end=$start+7*24*3600*($i+1); - $stat=calculate_service_availability($HTTP_GET_VARS["serviceid"],$period_start,$period_end); + $stat=calculate_service_availability($_GET["serviceid"],$period_start,$period_end); $problem[$i]=$stat["problem"]; $ok[$i]=$stat["ok"]; diff --git a/frontends/php/chart_diff.php b/frontends/php/chart_diff.php index 95bf13e1..2f0b1de9 100644 --- a/frontends/php/chart_diff.php +++ b/frontends/php/chart_diff.php @@ -27,27 +27,27 @@ # period # from - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { $period=0; } else { - $period=$HTTP_GET_VARS["period"]; + $period=$_GET["period"]; } - if(!isset($HTTP_GET_VARS["from"])) + if(!isset($_GET["from"])) { $from=0; } else { - $from=$HTTP_GET_VARS["from"]; + $from=$_GET["from"]; } - if(isset($HTTP_GET_VARS["width"])) + if(isset($_GET["width"])) { - $sizeX=$HTTP_GET_VARS["width"]; + $sizeX=$_GET["width"]; } else { @@ -87,7 +87,7 @@ ImageFilledRectangle($im,0,0,$sizeX+$shiftX+61,$sizeY+2*$shiftY+10,$white); ImageRectangle($im,0,0,$x-1,$y-1,$black); - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); // show_footer(); @@ -104,7 +104,7 @@ { DashedLine($im,$i+$shiftX,$shiftY,$i+$shiftX,$sizeY+$shiftY,$gray); } - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); $host=get_host_by_hostid($item["hostid"]); $str=$host["host"].":".$item["description"]." (diff)"; @@ -113,7 +113,7 @@ $from_time = time(NULL)-$period-3600*$from; $to_time = time(NULL)-3600*$from; - $result=DBselect("select count(clock),min(clock),max(clock),min(value),max(value) from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$from_time and clock<$to_time "); + $result=DBselect("select count(clock),min(clock),max(clock),min(value),max(value) from history where itemid=".$_GET["itemid"]." and clock>$from_time and clock<$to_time "); $count=DBget_field($result,0,0); if($count>0) { @@ -140,7 +140,7 @@ // echo "MIN/MAX:",$minX," - ",$maxX," - ",$minY," - ",$maxY,"<Br>"; - $result=DBselect("select clock,value from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$from_time and clock<$to_time order by clock"); + $result=DBselect("select clock,value from history where itemid=".$_GET["itemid"]." and clock>$from_time and clock<$to_time order by clock"); if(isset($minX)&&($minX!=$maxX)&&($minY!=$maxY)) { for($i=0;$i<DBnum_rows($result)-3;$i++) diff --git a/frontends/php/chart_sla.php b/frontends/php/chart_sla.php index 9c2af066..fa022666 100644 --- a/frontends/php/chart_sla.php +++ b/frontends/php/chart_sla.php @@ -54,8 +54,8 @@ $now=time(NULL); $period_start=$now-7*24*3600; $period_end=$now; - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); - $stat=calculate_service_availability($HTTP_GET_VARS["serviceid"],$period_start,$period_end); + $service=get_service_by_serviceid($_GET["serviceid"]); + $stat=calculate_service_availability($_GET["serviceid"],$period_start,$period_end); $problem=$stat["problem"]; $ok=$stat["ok"]; diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 74bcb64c..f5e142b5 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -24,11 +24,11 @@ $page["file"] = "charts.php"; $nomenu=0; - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { $nomenu=1; } - if(isset($HTTP_GET_VARS["graphid"]) && !isset($HTTP_GET_VARS["period"]) && !isset($HTTP_GET_VARS["stime"])) + if(isset($_GET["graphid"]) && !isset($_GET["period"]) && !isset($_GET["stime"])) { show_header($page["title"],30,$nomenu); } @@ -41,13 +41,13 @@ <?php // BEGIN - IGMI - keep default value - if(!isset($HTTP_GET_VARS["keep"])) + if(!isset($_GET["keep"])) { - $HTTP_GET_VARS["keep"]=1; + $_GET["keep"]=1; } // END - IGMI - keep default value - if(!isset($HTTP_GET_VARS["fullscreen"])) + if(!isset($_GET["fullscreen"])) { show_table_header_begin(); echo S_GRAPHS_BIG; @@ -56,15 +56,15 @@ // Start of new code echo "<form name=\"form2\" method=\"get\" action=\"charts.php\">"; - if(isset($HTTP_GET_VARS["graphid"])&&($HTTP_GET_VARS["graphid"]==0)) + if(isset($_GET["graphid"])&&($_GET["graphid"]==0)) { - unset($HTTP_GET_VARS["graphid"]); + unset($_GET["graphid"]); } echo S_GRAPH." "; - echo "<input name=\"keep\" type=\"hidden\" value=".$HTTP_GET_VARS["keep"].">"; + echo "<input name=\"keep\" type=\"hidden\" value=".$_GET["keep"].">"; echo "<select class=\"biginput\" name=\"graphid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT; + echo "<option value=\"0\" ".iif(!isset($_GET["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT; $result=DBselect("select graphid,name from graphs order by name"); while($row=DBfetch($result)) @@ -73,7 +73,7 @@ { continue; } - echo "<option value=\"".$row["graphid"]."\" ".iif(isset($HTTP_GET_VARS["graphid"])&&($HTTP_GET_VARS["graphid"]==$row["graphid"]),"selected","").">".$row["name"]; + echo "<option value=\"".$row["graphid"]."\" ".iif(isset($_GET["graphid"])&&($_GET["graphid"]==$row["graphid"]),"selected","").">".$row["name"]; } echo "</select>"; echo "</form>"; @@ -88,28 +88,28 @@ { continue; } - if( isset($HTTP_GET_VARS["graphid"]) && ($HTTP_GET_VARS["graphid"] == $row["graphid"]) ) + if( isset($_GET["graphid"]) && ($_GET["graphid"] == $row["graphid"]) ) { echo "<b>["; } $str=""; - if(isset($HTTP_GET_VARS["keep"])) + if(isset($_GET["keep"])) { - if($HTTP_GET_VARS["keep"] == 1) + if($_GET["keep"] == 1) { - if(isset($HTTP_GET_VARS["from"])) + if(isset($_GET["from"])) { - $str=$str."&from=".$HTTP_GET_VARS["from"]; + $str=$str."&from=".$_GET["from"]; } - if(isset($HTTP_GET_VARS["period"])) + if(isset($_GET["period"])) { - $str=$str."&period=".$HTTP_GET_VARS["period"]; + $str=$str."&period=".$_GET["period"]; } } - $str=$str."&keep=".$HTTP_GET_VARS["keep"]; + $str=$str."&keep=".$_GET["keep"]; } echo "<a href='charts.php?graphid=".$row["graphid"].url_param("stime").$str."'>".$row["name"]."</a>"; - if(isset($HTTP_GET_VARS["graphid"]) && ($HTTP_GET_VARS["graphid"] == $row["graphid"]) ) + if(isset($_GET["graphid"]) && ($_GET["graphid"] == $row["graphid"]) ) { echo "]</b>"; } @@ -130,27 +130,27 @@ ?> <?php - if(isset($HTTP_GET_VARS["graphid"])) + if(isset($_GET["graphid"])) { - $result=DBselect("select name from graphs where graphid=".$HTTP_GET_VARS["graphid"]); + $result=DBselect("select name from graphs where graphid=".$_GET["graphid"]); $row=DBfetch($result); $str=""; - if(isset($HTTP_GET_VARS["from"])) + if(isset($_GET["from"])) { - $str=$str."&from=".$HTTP_GET_VARS["from"]; + $str=$str."&from=".$_GET["from"]; } - if(isset($HTTP_GET_VARS["period"])) + if(isset($_GET["period"])) { - $str=$str."&period=".$HTTP_GET_VARS["period"]; + $str=$str."&period=".$_GET["period"]; } // BEGIN - IGMI - keep support added - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { - $map="<a href=\"charts.php?graphid=".$HTTP_GET_VARS["graphid"].$str."&keep=".$HTTP_GET_VARS["keep"]."\">".$row["name"]."</a>"; + $map="<a href=\"charts.php?graphid=".$_GET["graphid"].$str."&keep=".$_GET["keep"]."\">".$row["name"]."</a>"; } else { - $map="<a href=\"charts.php?graphid=".$HTTP_GET_VARS["graphid"]."&fullscreen=1".$str."&keep=".$HTTP_GET_VARS["keep"]."\">".$row["name"]."</a>"; + $map="<a href=\"charts.php?graphid=".$_GET["graphid"]."&fullscreen=1".$str."&keep=".$_GET["keep"]."\">".$row["name"]."</a>"; } // END - IGMI - keep support added } @@ -158,23 +158,23 @@ { $map=S_SELECT_GRAPH_TO_DISPLAY; } - if(!isset($HTTP_GET_VARS["from"])) + if(!isset($_GET["from"])) { - $HTTP_GET_VARS["from"]=0; + $_GET["from"]=0; } - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { - $HTTP_GET_VARS["period"]=3600; + $_GET["period"]=3600; } show_table_header($map); echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["graphid"])) + if(isset($_GET["graphid"])) { echo "<script language=\"JavaScript\">"; - echo "document.write(\"<IMG SRC='chart2.php?graphid=".$HTTP_GET_VARS["graphid"].url_param("stime")."&period=".$HTTP_GET_VARS["period"]."&from=".$HTTP_GET_VARS["from"]."&width=\"+(document.width-108)+\"'>\")"; + echo "document.write(\"<IMG SRC='chart2.php?graphid=".$_GET["graphid"].url_param("stime")."&period=".$_GET["period"]."&from=".$_GET["from"]."&width=\"+(document.width-108)+\"'>\")"; echo "</script>"; } else @@ -185,7 +185,7 @@ echo "</TR>"; echo "</TABLE>"; - if(isset($HTTP_GET_VARS["graphid"])/*&&(!isset($HTTP_GET_VARS["fullscreen"]))*/) + if(isset($_GET["graphid"])/*&&(!isset($_GET["fullscreen"]))*/) { // BEGIN - IGMI - just another way of navigation echo "<TABLE BORDER=0 align=center COLS=2 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; @@ -202,9 +202,9 @@ foreach($a as $label=>$sec) { echo "["; - if($HTTP_GET_VARS["period"]>$sec) + if($_GET["period"]>$sec) { - $tmp=$HTTP_GET_VARS["period"]-$sec; + $tmp=$_GET["period"]-$sec; echo("<A HREF=\"charts.php?period=$tmp".url_param("graphid").url_param("stime").url_param("from").url_param("keep").url_param("fullscreen")."\">-</A>"); } else @@ -215,7 +215,7 @@ echo("<A HREF=\"charts.php?period=$sec".url_param("graphid").url_param("stime").url_param("from").url_param("keep").url_param("fullscreen")."\">"); echo($label."</A>"); - $tmp=$HTTP_GET_VARS["period"]+$sec; + $tmp=$_GET["period"]+$sec; echo("<A HREF=\"charts.php?period=$tmp".url_param("graphid").url_param("stime").url_param("from").url_param("keep").url_param("fullscreen")."\">+</A>"); echo "] "; @@ -226,14 +226,14 @@ // echo("[<A HREF=\"charts.php?period=".(365*24*3600).url_param("graphid").url_param("from").url_param("keep").url_param("fullscreen")."\">year</A>] "); /* echo("or "); - $tmp=$HTTP_GET_VARS["period"]+$hour; + $tmp=$_GET["period"]+$hour; echo("[<A HREF=\"charts.php?period=$tmp".url_param("graphid").url_param("from").url_param("keep").url_param("fullscreen")."\">"); echo("+1h</A>] "); - if ($HTTP_GET_VARS["period"]>$hour) + if ($_GET["period"]>$hour) { - $tmp=$HTTP_GET_VARS["period"]-$hour; -// echo("[<A HREF=\"charts.php?graphid=".$HTTP_GET_VARS["graphid"]."&from=".$HTTP_GET_VARS["from"]."&period=".$tmp."&keep=".$HTTP_GET_VARS["keep"]."\">"); + $tmp=$_GET["period"]-$hour; +// echo("[<A HREF=\"charts.php?graphid=".$_GET["graphid"]."&from=".$_GET["from"]."&period=".$tmp."&keep=".$_GET["keep"]."\">"); echo("[<A HREF=\"charts.php?period=$tmp".url_param("graphid").url_param("from").url_param("keep").url_param("fullscreen")."\">"); echo("-1h</A>] "); } @@ -247,7 +247,7 @@ echo "</TD>"; echo "<TD BGCOLOR=#FFFFFF WIDTH=15% ALIGN=RIGHT>"; echo "<b>".nbsp(S_KEEP_PERIOD).":</b> "; - if($HTTP_GET_VARS["keep"] == 1) + if($_GET["keep"] == 1) { echo("[<A HREF=\"charts.php?keep=0".url_param("graphid").url_param("from").url_param("period").url_param("fullscreen")."\">".S_ON_C."</a>]"); } @@ -259,7 +259,7 @@ echo "</TR>"; echo "<TR BGCOLOR=#FFFFFF>"; echo "<TD>"; - if(isset($HTTP_GET_VARS["stime"])) + if(isset($_GET["stime"])) { echo "<div align=left>" ; echo "<b>".S_MOVE.":</b> " ; @@ -272,7 +272,7 @@ { echo "["; - $stime=$HTTP_GET_VARS["stime"]; + $stime=$_GET["stime"]; $tmp=mktime(substr($stime,8,2),substr($stime,10,2),0,substr($stime,4,2),substr($stime,6,2),substr($stime,0,4)); $tmp=$tmp-3600*$hours; $tmp=date("YmdHi",$tmp); @@ -280,7 +280,7 @@ echo($label); - $stime=$HTTP_GET_VARS["stime"]; + $stime=$_GET["stime"]; $tmp=mktime(substr($stime,8,2),substr($stime,10,2),0,substr($stime,4,2),substr($stime,6,2),substr($stime,0,4)); $tmp=$tmp+3600*$hours; $tmp=date("YmdHi",$tmp); @@ -302,14 +302,14 @@ foreach($a as $label=>$hours) { echo "["; - $tmp=$HTTP_GET_VARS["from"]+$hours; + $tmp=$_GET["from"]+$hours; echo("<A HREF=\"charts.php?from=$tmp".url_param("graphid").url_param("period").url_param("keep").url_param("fullscreen")."\">-</A>"); echo($label); - if($HTTP_GET_VARS["from"]>=$hours) + if($_GET["from"]>=$hours) { - $tmp=$HTTP_GET_VARS["from"]-$hours; + $tmp=$_GET["from"]-$hours; echo("<A HREF=\"charts.php?from=$tmp".url_param("graphid").url_param("period").url_param("keep").url_param("fullscreen")."\">+</A>"); } else @@ -325,11 +325,11 @@ echo "<TD BGCOLOR=#FFFFFF WIDTH=15% ALIGN=RIGHT>"; // echo("<div align=left>"); echo "<form method=\"put\" action=\"charts.php\">"; - echo "<input name=\"graphid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["graphid"]."\" size=12>"; + echo "<input name=\"graphid\" type=\"hidden\" value=\"".$_GET["graphid"]."\" size=12>"; echo "<input name=\"period\" type=\"hidden\" value=\"".(9*3600)."\" size=12>"; - if(isset($HTTP_GET_VARS["stime"])) + if(isset($_GET["stime"])) { - echo "<input name=\"stime\" class=\"biginput\" value=\"".$HTTP_GET_VARS["stime"]."\" size=12>"; + echo "<input name=\"stime\" class=\"biginput\" value=\"".$_GET["stime"]."\" size=12>"; } else { diff --git a/frontends/php/compare.php b/frontends/php/compare.php index 8a6df047..3324c3a5 100644 --- a/frontends/php/compare.php +++ b/frontends/php/compare.php @@ -26,7 +26,7 @@ ?> <?php - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { show_table_header("<font color=\"AA0000\">No permissions !</font>"); show_footer(); @@ -36,48 +36,48 @@ <?php show_table_header_begin(); - $result=DBselect("select i.description,h.host,h.hostid from items i,hosts h where i.hostid=h.hostid and i.itemid=".$HTTP_GET_VARS["itemid"]); + $result=DBselect("select i.description,h.host,h.hostid from items i,hosts h where i.hostid=h.hostid and i.itemid=".$_GET["itemid"]); $description=DBget_field($result,0,0); $host=DBget_field($result,0,1); $hostid=DBget_field($result,0,2); - echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='history.php?action=showhistory&itemid=".$HTTP_GET_VARS["itemid"]."'>$description</a>"; + echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='history.php?action=showhistory&itemid=".$_GET["itemid"]."'>$description</a>"; show_table_v_delimiter(); echo "<font size=2>"; - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="year") + if(isset($_GET["type"])&&$_GET["type"]=="year") { - echo "<b>[<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=year'>year</a>]</b> "; + echo "<b>[<a href='compare.php?itemid=".$_GET["itemid"]."&type=year'>year</a>]</b> "; } else { - echo "<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=year'>year</a> "; + echo "<a href='compare.php?itemid=".$_GET["itemid"]."&type=year'>year</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="month") + if(isset($_GET["type"])&&$_GET["type"]=="month") { - echo "<b>[<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=month'>month</a>]</b> "; + echo "<b>[<a href='compare.php?itemid=".$_GET["itemid"]."&type=month'>month</a>]</b> "; } else { - echo "<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=month'>month</a> "; + echo "<a href='compare.php?itemid=".$_GET["itemid"]."&type=month'>month</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="week") + if(isset($_GET["type"])&&$_GET["type"]=="week") { - echo "<b>[<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=week'>week</a>]</b> "; + echo "<b>[<a href='compare.php?itemid=".$_GET["itemid"]."&type=week'>week</a>]</b> "; } else { - echo "<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=week'>week</a> "; + echo "<a href='compare.php?itemid=".$_GET["itemid"]."&type=week'>week</a> "; } echo "</font>"; - if(isset($HTTP_GET_VARS["type"])) + if(isset($_GET["type"])) { show_table_v_delimiter(); - echo "<b>[<a href='compare.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&type2=day'>day</a>]</b> "; + echo "<b>[<a href='compare.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&type2=day'>day</a>]</b> "; } show_table_header_end(); @@ -85,9 +85,9 @@ ?> <?php - if(isset($HTTP_GET_VARS["itemid"])&&isset($HTTP_GET_VARS["type"])) + if(isset($_GET["itemid"])&&isset($_GET["type"])) { - show_table_header(strtoupper($HTTP_GET_VARS["type"])); + show_table_header(strtoupper($_GET["type"])); } else { @@ -97,22 +97,22 @@ echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["itemid"])&&isset($HTTP_GET_VARS["type"])) + if(isset($_GET["itemid"])&&isset($_GET["type"])) { - if(isset($HTTP_GET_VARS["trendavg"])) + if(isset($_GET["trendavg"])) { echo "<script language=\"JavaScript\">"; echo "if (navigator.appName == \"Microsoft Internet Explorer\")"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1&width=\"+(document.body.clientWidth-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1&width=\"+(document.body.clientWidth-108)+\"'>\")"; echo "}"; echo "else if (navigator.appName == \"Netscape\")"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1&width=\"+(document.width-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1&width=\"+(document.width-108)+\"'>\")"; echo "}"; echo "else"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1'>\")"; echo "}"; echo "</script>"; } @@ -121,15 +121,15 @@ echo "<script language=\"JavaScript\">"; echo "if (navigator.appName == \"Microsoft Internet Explorer\")"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&width=\"+(document.body.clientWidth-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&width=\"+(document.body.clientWidth-108)+\"'>\")"; echo "}"; echo "else if (navigator.appName == \"Netscape\")"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&width=\"+(document.width-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&width=\"+(document.width-108)+\"'>\")"; echo "}"; echo "else"; echo "{"; - echo " document.write(\"<IMG SRC='chart3.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."'>\")"; + echo " document.write(\"<IMG SRC='chart3.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."'>\")"; echo "}"; echo "</script>"; } diff --git a/frontends/php/config.php b/frontends/php/config.php index 78743646..88452e67 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -39,28 +39,28 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_config($HTTP_GET_VARS["alarm_history"],$HTTP_GET_VARS["alert_history"]); + $result=update_config($_GET["alarm_history"],$_GET["alert_history"]); show_messages($result, S_CONFIGURATION_UPDATED, S_CONFIGURATION_WAS_NOT_UPDATED); } - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_mediatype($HTTP_GET_VARS["type"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["smtp_server"],$HTTP_GET_VARS["smtp_helo"],$HTTP_GET_VARS["smtp_email"],$HTTP_GET_VARS["exec_path"]); + $result=add_mediatype($_GET["type"],$_GET["description"],$_GET["smtp_server"],$_GET["smtp_helo"],$_GET["smtp_email"],$_GET["exec_path"]); show_messages($result, S_ADDED_NEW_MEDIA_TYPE, S_NEW_MEDIA_TYPE_WAS_NOT_ADDED); } - if($HTTP_GET_VARS["register"]=="update media") + if($_GET["register"]=="update media") { - $result=update_mediatype($HTTP_GET_VARS["mediatypeid"],$HTTP_GET_VARS["type"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["smtp_server"],$HTTP_GET_VARS["smtp_helo"],$HTTP_GET_VARS["smtp_email"],$HTTP_GET_VARS["exec_path"]); + $result=update_mediatype($_GET["mediatypeid"],$_GET["type"],$_GET["description"],$_GET["smtp_server"],$_GET["smtp_helo"],$_GET["smtp_email"],$_GET["exec_path"]); show_messages($result, S_MEDIA_TYPE_UPDATED, S_MEDIA_TYPE_WAS_NOT_UPDATED); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_mediatype($HTTP_GET_VARS["mediatypeid"]); + $result=delete_mediatype($_GET["mediatypeid"]); show_messages($result, S_MEDIA_TYPE_DELETED, S_MEDIA_TYPE_WAS_NOT_DELETED); - unset($HTTP_GET_VARS["mediatypeid"]); + unset($_GET["mediatypeid"]); } } ?> @@ -143,18 +143,18 @@ ?> <?php - $type=@iif(isset($HTTP_GET_VARS["type"]),$HTTP_GET_VARS["type"],0); - $description=@iif(isset($HTTP_GET_VARS["description"]),$HTTP_GET_VARS["description"],""); - $smtp_server=@iif(isset($HTTP_GET_VARS["smtp_server"]),$HTTP_GET_VARS["smtp_server"],"localhost"); - $smtp_helo=@iif(isset($HTTP_GET_VARS["smtp_helo"]),$HTTP_GET_VARS["smtp_helo"],"localhost"); - $smtp_email=@iif(isset($HTTP_GET_VARS["smtp_email"]),$HTTP_GET_VARS["smtp_email"],"zabbix@localhost"); - $exec_path=@iif(isset($HTTP_GET_VARS["exec_path"]),$HTTP_GET_VARS["exec_path"],""); - - if(isset($HTTP_GET_VARS["register"]) && ($HTTP_GET_VARS["register"] == "change")) + $type=@iif(isset($_GET["type"]),$_GET["type"],0); + $description=@iif(isset($_GET["description"]),$_GET["description"],""); + $smtp_server=@iif(isset($_GET["smtp_server"]),$_GET["smtp_server"],"localhost"); + $smtp_helo=@iif(isset($_GET["smtp_helo"]),$_GET["smtp_helo"],"localhost"); + $smtp_email=@iif(isset($_GET["smtp_email"]),$_GET["smtp_email"],"zabbix@localhost"); + $exec_path=@iif(isset($_GET["exec_path"]),$_GET["exec_path"],""); + + if(isset($_GET["register"]) && ($_GET["register"] == "change")) { - $result=DBselect("select mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path from media_type where mediatypeid=".$HTTP_GET_VARS["mediatypeid"]); + $result=DBselect("select mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path from media_type where mediatypeid=".$_GET["mediatypeid"]); $mediatypeid=DBget_field($result,0,0); - $type=@iif(isset($HTTP_GET_VARS["type"]),$HTTP_GET_VARS["type"],DBget_field($result,0,1)); + $type=@iif(isset($_GET["type"]),$_GET["type"],DBget_field($result,0,1)); $description=DBget_field($result,0,2); $smtp_server=DBget_field($result,0,3); $smtp_helo=DBget_field($result,0,4); diff --git a/frontends/php/graph.php b/frontends/php/graph.php index 2e123876..ac090c7f 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -31,7 +31,7 @@ ?> <?php - if(!check_right("Graph","R",$HTTP_GET_VARS["graphid"])) + if(!check_right("Graph","R",$_GET["graphid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -40,49 +40,49 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_item_to_graph($HTTP_GET_VARS["graphid"],$HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["color"],$HTTP_GET_VARS["drawtype"],$HTTP_GET_VARS["sortorder"]); + $result=add_item_to_graph($_GET["graphid"],$_GET["itemid"],$_GET["color"],$_GET["drawtype"],$_GET["sortorder"]); show_messages($result,S_ITEM_ADDED, S_CANNOT_ADD_ITEM); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_graph_item($HTTP_GET_VARS["gitemid"],$HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["color"],$HTTP_GET_VARS["drawtype"],$HTTP_GET_VARS["sortorder"]); + $result=update_graph_item($_GET["gitemid"],$_GET["itemid"],$_GET["color"],$_GET["drawtype"],$_GET["sortorder"]); show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_graphs_item($HTTP_GET_VARS["gitemid"]); + $result=delete_graphs_item($_GET["gitemid"]); show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM); - unset($HTTP_GET_VARS["gitemid"]); + unset($_GET["gitemid"]); } - if($HTTP_GET_VARS["register"]=="up") + if($_GET["register"]=="up") { - $sql="update graphs_items set sortorder=sortorder-1 where sortorder>0 and gitemid=".$HTTP_GET_VARS["gitemid"]; + $sql="update graphs_items set sortorder=sortorder-1 where sortorder>0 and gitemid=".$_GET["gitemid"]; $result=DBexecute($sql); show_messages($result, S_SORT_ORDER_UPDATED, S_CANNOT_UPDATE_SORT_ORDER); - unset($HTTP_GET_VARS["gitemid"]); + unset($_GET["gitemid"]); } - if($HTTP_GET_VARS["register"]=="down") + if($_GET["register"]=="down") { - $sql="update graphs_items set sortorder=sortorder+1 where sortorder<100 and gitemid=".$HTTP_GET_VARS["gitemid"]; + $sql="update graphs_items set sortorder=sortorder+1 where sortorder<100 and gitemid=".$_GET["gitemid"]; $result=DBexecute($sql); show_messages($result, S_SORT_ORDER_UPDATED, S_CANNOT_UPDATE_SORT_ORDER); - unset($HTTP_GET_VARS["gitemid"]); + unset($_GET["gitemid"]); } } ?> <?php - $result=DBselect("select name from graphs where graphid=".$HTTP_GET_VARS["graphid"]); + $result=DBselect("select name from graphs where graphid=".$_GET["graphid"]); $row=DBfetch($result); show_table_header($row["name"]); echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - echo "<IMG SRC=\"chart2.php?graphid=".$HTTP_GET_VARS["graphid"]."&period=3600&from=0\">"; + echo "<IMG SRC=\"chart2.php?graphid=".$_GET["graphid"]."&period=3600&from=0\">"; echo "</TD>"; echo "</TR>"; echo "</TABLE>"; @@ -97,7 +97,7 @@ echo "<TD WIDTH=10% NOSAVE><B>".S_ACTIONS."</B></TD>"; echo "</TR>"; - $sql="select i.itemid,h.host,i.description,gi.gitemid,gi.color,gi.drawtype,gi.sortorder from hosts h,graphs_items gi,items i where i.itemid=gi.itemid and gi.graphid=".$HTTP_GET_VARS["graphid"]." and h.hostid=i.hostid order by gi.sortorder"; + $sql="select i.itemid,h.host,i.description,gi.gitemid,gi.color,gi.drawtype,gi.sortorder from hosts h,graphs_items gi,items i where i.itemid=gi.itemid and gi.graphid=".$_GET["graphid"]." and h.hostid=i.hostid order by gi.sortorder"; $result=DBselect($sql); $col=0; while($row=DBfetch($result)) @@ -111,11 +111,11 @@ echo "<TD>".get_drawtype_description($row["drawtype"])."</TD>"; echo "<TD>".$row["color"]."</TD>"; echo "<TD>"; - echo "<A HREF=\"graph.php?graphid=".$HTTP_GET_VARS["graphid"]."&gitemid=".$row["gitemid"]."#form\">".S_CHANGE."</A>"; + echo "<A HREF=\"graph.php?graphid=".$_GET["graphid"]."&gitemid=".$row["gitemid"]."#form\">".S_CHANGE."</A>"; echo " - "; - echo "<A HREF=\"graph.php?graphid=".$HTTP_GET_VARS["graphid"]."&gitemid=".$row["gitemid"]."®ister=up\">".S_UP."</A>"; + echo "<A HREF=\"graph.php?graphid=".$_GET["graphid"]."&gitemid=".$row["gitemid"]."®ister=up\">".S_UP."</A>"; echo " - "; - echo "<A HREF=\"graph.php?graphid=".$HTTP_GET_VARS["graphid"]."&gitemid=".$row["gitemid"]."®ister=down\">".S_DOWN."</A>"; + echo "<A HREF=\"graph.php?graphid=".$_GET["graphid"]."&gitemid=".$row["gitemid"]."®ister=down\">".S_DOWN."</A>"; echo "</TD>"; echo "</TR>"; } @@ -126,9 +126,9 @@ echo "<br>"; echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["gitemid"])) + if(isset($_GET["gitemid"])) { - $sql="select itemid,color,drawtype,sortorder from graphs_items where gitemid=".$HTTP_GET_VARS["gitemid"]; + $sql="select itemid,color,drawtype,sortorder from graphs_items where gitemid=".$_GET["gitemid"]; $result=DBselect($sql); $itemid=DBget_field($result,0,0); $color=DBget_field($result,0,1); @@ -145,10 +145,10 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"graph.php\">"; - echo "<input name=\"graphid\" type=\"hidden\" value=".$HTTP_GET_VARS["graphid"].">"; - if(isset($HTTP_GET_VARS["gitemid"])) + echo "<input name=\"graphid\" type=\"hidden\" value=".$_GET["graphid"].">"; + if(isset($_GET["gitemid"])) { - echo "<input name=\"gitemid\" type=\"hidden\" value=".$HTTP_GET_VARS["gitemid"].">"; + echo "<input name=\"gitemid\" type=\"hidden\" value=".$_GET["gitemid"].">"; } echo S_PARAMETER; diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index a6515b75..b72cc9d2 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -41,23 +41,23 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_graph($HTTP_GET_VARS["name"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); + $result=add_graph($_GET["name"],$_GET["width"],$_GET["height"]); show_messages($result, S_GRAPH_ADDED, S_CANNOT_ADD_GRAPH); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_graph($HTTP_GET_VARS["graphid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); + $result=update_graph($_GET["graphid"],$_GET["name"],$_GET["width"],$_GET["height"]); show_messages($result, S_GRAPH_UPDATED, S_CANNOT_UPDATE_GRAPH); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_graph($HTTP_GET_VARS["graphid"]); + $result=delete_graph($_GET["graphid"]); show_messages($result, S_GRAPH_DELETED, S_CANNOT_DELETE_GRAPH); - unset($HTTP_GET_VARS["graphid"]); + unset($_GET["graphid"]); } } ?> @@ -102,9 +102,9 @@ <?php echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["graphid"])) + if(isset($_GET["graphid"])) { - $result=DBselect("select g.graphid,g.name,g.width,g.height from graphs g where graphid=".$HTTP_GET_VARS["graphid"]); + $result=DBselect("select g.graphid,g.name,g.width,g.height from graphs g where graphid=".$_GET["graphid"]); $row=DBfetch($result); $name=$row["name"]; $width=$row["width"]; @@ -123,9 +123,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"graphs.php\">"; - if(isset($HTTP_GET_VARS["graphid"])) + if(isset($_GET["graphid"])) { - echo "<input class=\"biginput\" name=\"graphid\" type=\"hidden\" value=".$HTTP_GET_VARS["graphid"].">"; + echo "<input class=\"biginput\" name=\"graphid\" type=\"hidden\" value=".$_GET["graphid"].">"; } echo S_NAME; show_table2_h_delimiter(); @@ -143,7 +143,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["graphid"])) + if(isset($_GET["graphid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_GRAPH_Q."');\">"; diff --git a/frontends/php/history.php b/frontends/php/history.php index b31b97dc..d11e656b 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -26,7 +26,7 @@ $now=time(); - $result=DBselect("select h.host,i.description,i.nextcheck-$now,h.hostid from items i,hosts h where i.itemid=".$HTTP_GET_VARS["itemid"]." and h.hostid=i.hostid"); + $result=DBselect("select h.host,i.description,i.nextcheck-$now,h.hostid from items i,hosts h where i.itemid=".$_GET["itemid"]." and h.hostid=i.hostid"); $host=DBget_field($result,0,0); $description=DBget_field($result,0,1); $beforenextcheck=DBget_field($result,0,2)+5; @@ -36,9 +36,9 @@ } $hostid=DBget_field($result,0,3); - if($HTTP_GET_VARS["action"]=="showhistory") + if($_GET["action"]=="showhistory") { - if(isset($HTTP_GET_VARS["year"])) + if(isset($_GET["year"])) { show_header("$host:$description",0,0); } @@ -47,28 +47,28 @@ show_header("$host:$description",$beforenextcheck,0); } } - if($HTTP_GET_VARS["action"]=="showhistory2") + if($_GET["action"]=="showhistory2") { show_header("$host:$description",0,0); } - if($HTTP_GET_VARS["action"]=="showvalues") + if($_GET["action"]=="showvalues") { show_header("$host:$description",0,0); } - if($HTTP_GET_VARS["action"]=="showfreehist") + if($_GET["action"]=="showfreehist") { show_header("$host:$description",0,0); } - if($HTTP_GET_VARS["action"]=="showplaintxt") + if($_GET["action"]=="showplaintxt") { show_header("$host:$description",0,0); } - if($HTTP_GET_VARS["action"]=="plaintext") + if($_GET["action"]=="plaintext") { show_header("$host:$description",0,1); } - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -78,11 +78,11 @@ ?> <?php - if($HTTP_GET_VARS["action"]=="plaintext") + if($_GET["action"]=="plaintext") { - $from=mktime($HTTP_GET_VARS["fromhour"],$HTTP_GET_VARS["frommin"],0,$HTTP_GET_VARS["frommonth"],$HTTP_GET_VARS["fromday"],$HTTP_GET_VARS["fromyear"]); - $till=mktime($HTTP_GET_VARS["tillhour"],$HTTP_GET_VARS["tillmin"],0,$HTTP_GET_VARS["tillmonth"],$HTTP_GET_VARS["tillday"],$HTTP_GET_VARS["tillyear"]); - show_plaintext($HTTP_GET_VARS["itemid"], $from, $till); + $from=mktime($_GET["fromhour"],$_GET["frommin"],0,$_GET["frommonth"],$_GET["fromday"],$_GET["fromyear"]); + $till=mktime($_GET["tillhour"],$_GET["tillmin"],0,$_GET["tillmonth"],$_GET["tillday"],$_GET["tillyear"]); + show_plaintext($_GET["itemid"], $from, $till); exit; } @@ -90,10 +90,10 @@ <?php show_table_header_begin(); - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); if($item["value_type"] == 0) { - echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."'>$description</a>"; + echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='trends.php?itemid=".$_GET["itemid"]."'>$description</a>"; } else { @@ -101,93 +101,93 @@ } show_table_v_delimiter(); echo("<DIV ALIGN=CENTER>"); - if($HTTP_GET_VARS["action"] =="showhistory") + if($_GET["action"] =="showhistory") { - echo("<b>[<A HREF=\"history.php?action=showhistory&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_LAST_HOUR_GRAPH."</A>]</b> "); + echo("<b>[<A HREF=\"history.php?action=showhistory&itemid=".$_GET["itemid"]."\">".S_LAST_HOUR_GRAPH."</A>]</b> "); } else { - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); if($item["value_type"] == 0) { - echo("<A HREF=\"history.php?action=showhistory&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_LAST_HOUR_GRAPH."</A> "); + echo("<A HREF=\"history.php?action=showhistory&itemid=".$_GET["itemid"]."\">".S_LAST_HOUR_GRAPH."</A> "); } } - if($HTTP_GET_VARS["action"] =="showhistory2") + if($_GET["action"] =="showhistory2") { - echo("<b>[<A HREF=\"history.php?action=showhistory2&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_LAST_HOUR_GRAPH_DIFF."</A>]</b> "); + echo("<b>[<A HREF=\"history.php?action=showhistory2&itemid=".$_GET["itemid"]."\">".S_LAST_HOUR_GRAPH_DIFF."</A>]</b> "); } else { - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); if($item["value_type"] == 0) { - echo("<A HREF=\"history.php?action=showhistory2&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_LAST_HOUR_GRAPH_DIFF."</A> "); + echo("<A HREF=\"history.php?action=showhistory2&itemid=".$_GET["itemid"]."\">".S_LAST_HOUR_GRAPH_DIFF."</A> "); } } - if($HTTP_GET_VARS["action"] =="showvalues") + if($_GET["action"] =="showvalues") { - echo("<b>[<A HREF=\"history.php?action=showvalues&itemid=".$HTTP_GET_VARS["itemid"]."&period=3600\">".S_VALUES_OF_LAST_HOUR."</A>]</b> "); + echo("<b>[<A HREF=\"history.php?action=showvalues&itemid=".$_GET["itemid"]."&period=3600\">".S_VALUES_OF_LAST_HOUR."</A>]</b> "); } else { - echo("<A HREF=\"history.php?action=showvalues&itemid=".$HTTP_GET_VARS["itemid"]."&period=3600\">".S_VALUES_OF_LAST_HOUR."</A> "); + echo("<A HREF=\"history.php?action=showvalues&itemid=".$_GET["itemid"]."&period=3600\">".S_VALUES_OF_LAST_HOUR."</A> "); } - if($HTTP_GET_VARS["action"] =="showfreehist") + if($_GET["action"] =="showfreehist") { - echo("<b>[<A HREF=\"history.php?action=showfreehist&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_VALUES_OF_SPECIFIED_PERIOD."</A>]</b> "); + echo("<b>[<A HREF=\"history.php?action=showfreehist&itemid=".$_GET["itemid"]."\">".S_VALUES_OF_SPECIFIED_PERIOD."</A>]</b> "); } else { - echo("<A HREF=\"history.php?action=showfreehist&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_VALUES_OF_SPECIFIED_PERIOD."</A> "); + echo("<A HREF=\"history.php?action=showfreehist&itemid=".$_GET["itemid"]."\">".S_VALUES_OF_SPECIFIED_PERIOD."</A> "); } - if($HTTP_GET_VARS["action"] =="showplaintxt") + if($_GET["action"] =="showplaintxt") { - echo("<b>[<A HREF=\"history.php?action=showplaintxt&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_VALUES_IN_PLAIN_TEXT_FORMAT."</A>]</b> "); + echo("<b>[<A HREF=\"history.php?action=showplaintxt&itemid=".$_GET["itemid"]."\">".S_VALUES_IN_PLAIN_TEXT_FORMAT."</A>]</b> "); } else { - echo("<A HREF=\"history.php?action=showplaintxt&itemid=".$HTTP_GET_VARS["itemid"]."\">".S_VALUES_IN_PLAIN_TEXT_FORMAT."</A> "); + echo("<A HREF=\"history.php?action=showplaintxt&itemid=".$_GET["itemid"]."\">".S_VALUES_IN_PLAIN_TEXT_FORMAT."</A> "); } echo("</DIV>\n"); show_table_header_end(); echo("<br>"); - if($HTTP_GET_VARS["action"]=="showfreehist") + if($_GET["action"]=="showfreehist") { - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { - show_freehist($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["period"]); + show_freehist($_GET["itemid"],$_GET["period"]); } exit; } - if($HTTP_GET_VARS["action"]=="showplaintxt") + if($_GET["action"]=="showplaintxt") { - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { - show_plaintxt($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["period"]); + show_plaintxt($_GET["itemid"],$_GET["period"]); } exit; } - if($HTTP_GET_VARS["action"]=="showvalues") + if($_GET["action"]=="showvalues") { - if(!isset($HTTP_GET_VARS["from"])) + if(!isset($_GET["from"])) { - $HTTP_GET_VARS["from"]=0; + $_GET["from"]=0; } - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { - $HTTP_GET_VARS["period"]=3600; + $_GET["period"]=3600; } - $time=time(NULL)-$HTTP_GET_VARS["period"]-$HTTP_GET_VARS["from"]*3600; - $till=time(NULL)-$HTTP_GET_VARS["from"]*3600; - $hours=$HTTP_GET_VARS["period"]/3600; + $time=time(NULL)-$_GET["period"]-$_GET["from"]*3600; + $till=time(NULL)-$_GET["from"]*3600; + $hours=$_GET["period"]/3600; - show_table_header("Showing history of ".$HTTP_GET_VARS["period"]." seconds($hours h)<BR>[from: ".date("Y.M.d H:i:s",$time)."] [till: ".date("Y.M.d H:i:s",$till)."]"); + show_table_header("Showing history of ".$_GET["period"]." seconds($hours h)<BR>[from: ".date("Y.M.d H:i:s",$time)."] [till: ".date("Y.M.d H:i:s",$till)."]"); echo "<TABLE BORDER=0 COLS=2 ALIGN=CENTER WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; @@ -195,14 +195,14 @@ echo "<TD><B>".S_VALUE."</B></TD>"; echo "</TR>"; - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); if($item["value_type"]==0) { - $sql="select clock,value from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$time and clock<$till order by clock desc"; + $sql="select clock,value from history where itemid=".$_GET["itemid"]." and clock>$time and clock<$till order by clock desc"; } else { - $sql="select clock,value from history_str where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$time and clock<$till order by clock desc"; + $sql="select clock,value from history_str where itemid=".$_GET["itemid"]." and clock>$time and clock<$till order by clock desc"; } $result=DBselect($sql); $col=0; @@ -237,28 +237,28 @@ exit; } - if($HTTP_GET_VARS["action"]=="showhistory") + if($_GET["action"]=="showhistory") { - if(!isset($HTTP_GET_VARS["period"])) + if(!isset($_GET["period"])) { - $HTTP_GET_VARS["period"]=3600; + $_GET["period"]=3600; } - if(!isset($HTTP_GET_VARS["from"])) + if(!isset($_GET["from"])) { - $HTTP_GET_VARS["from"]=0; + $_GET["from"]=0; } - if(isset($HTTP_GET_VARS["year"])) + if(isset($_GET["year"])) { - $HTTP_GET_VARS["from"]=($now-mktime($HTTP_GET_VARS["hour"], 0, 0, $HTTP_GET_VARS["month"], $HTTP_GET_VARS["day"],$HTTP_GET_VARS["year"]))/3600; + $_GET["from"]=($now-mktime($_GET["hour"], 0, 0, $_GET["month"], $_GET["day"],$_GET["year"]))/3600; } - @show_history($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["from"],$HTTP_GET_VARS["period"],0); + @show_history($_GET["itemid"],$_GET["from"],$_GET["period"],0); show_footer(); exit; } - if($HTTP_GET_VARS["action"]=="showhistory2") + if($_GET["action"]=="showhistory2") { - @show_history($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["from"],$HTTP_GET_VARS["period"],1); + @show_history($_GET["itemid"],$_GET["from"],$_GET["period"],1); show_footer(); exit; } diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 404418ef..426b0478 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -37,52 +37,52 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_host($HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["host_templateid"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]); + $result=add_host($_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["host_templateid"],$_GET["newgroup"],$_GET["groups"]); show_messages($result, S_HOST_ADDED, S_CANNOT_ADD_HOST); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } - if($HTTP_GET_VARS["register"]=="add items from template") + if($_GET["register"]=="add items from template") { - $result=add_using_host_template($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host_templateid"]); + $result=add_using_host_template($_GET["hostid"],$_GET["host_templateid"]); show_messages($result, S_ITEMS_ADDED, S_CANNOT_ADD_ITEMS); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=@update_host($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["host"],$HTTP_GET_VARS["port"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["useip"],$HTTP_GET_VARS["ip"],$HTTP_GET_VARS["newgroup"],$HTTP_GET_VARS["groups"]); + $result=@update_host($_GET["hostid"],$_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["newgroup"],$_GET["groups"]); show_messages($result, S_HOST_UPDATED, S_CANNOT_UPDATE_HOST); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } - if($HTTP_GET_VARS["register"]=="changestatus") + if($_GET["register"]=="changestatus") { - $result=update_host_status($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["status"]); + $result=update_host_status($_GET["hostid"],$_GET["status"]); show_messages($result,S_HOST_STATUS_UPDATED,S_CANNOT_UPDATE_HOST_STATUS); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_host($HTTP_GET_VARS["hostid"]); + $result=delete_host($_GET["hostid"]); show_messages($result, S_HOST_DELETED, S_CANNOT_DELETE_HOST); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } - if($HTTP_GET_VARS["register"]=="add group") + if($_GET["register"]=="add group") { - $result=add_host_group($HTTP_GET_VARS["name"], $HTTP_GET_VARS["hosts"]); + $result=add_host_group($_GET["name"], $_GET["hosts"]); show_messages($result, S_GROUP_ADDED, S_CANNOT_ADD_GROUP); } - if($HTTP_GET_VARS["register"]=="delete group") + if($_GET["register"]=="delete group") { - $result=delete_host_group($HTTP_GET_VARS["groupid"]); + $result=delete_host_group($_GET["groupid"]); show_messages($result, S_GROUP_DELETED, S_CANNOT_DELETE_GROUP); - unset($HTTP_GET_VARS["groupid"]); + unset($_GET["groupid"]); } - if($HTTP_GET_VARS["register"]=="update group") + if($_GET["register"]=="update group") { - $result=update_host_group($HTTP_GET_VARS["groupid"], $HTTP_GET_VARS["name"], $HTTP_GET_VARS["hosts"]); + $result=update_host_group($_GET["groupid"], $_GET["name"], $_GET["hosts"]); show_messages($result, S_GROUP_UPDATED, _S_CANNOT_UPDATE_GROUP); } } @@ -144,7 +144,7 @@ echo S_CONFIGURATION_OF_HOSTS_BIG; show_table_v_delimiter(); - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { // echo "all "; echo "<a href='hosts.php'>".S_ALL_SMALL."</a> "; @@ -162,12 +162,12 @@ // { // continue; // } - if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) + if( isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) ) { echo "<b>["; } echo "<a href='hosts.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>"; - if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) + if(isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) ) { echo "]</b>"; } @@ -179,7 +179,7 @@ ?> <?php - if(!isset($HTTP_GET_VARS["hostid"])) + if(!isset($_GET["hostid"])) { echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; @@ -192,9 +192,9 @@ echo "</TR>"; - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { - $sql="select h.hostid,h.host,h.port,h.status,h.useip,h.ip from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host"; + $sql="select h.hostid,h.host,h.port,h.status,h.useip,h.ip from hosts h,hosts_groups hg where hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid order by h.host"; } else { @@ -259,9 +259,9 @@ { if($row["status"] != HOST_STATUS_DELETED) { - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { - echo "<TD><A HREF=\"hosts.php?register=change&hostid=".$row["hostid"]."&groupid=".$HTTP_GET_VARS["groupid"]."#form\">".S_CHANGE."</A></TD>"; + echo "<TD><A HREF=\"hosts.php?register=change&hostid=".$row["hostid"]."&groupid=".$_GET["groupid"]."#form\">".S_CHANGE."</A></TD>"; } else { @@ -291,17 +291,17 @@ <?php echo "<br>"; - insert_hostgroups_form($HTTP_GET_VARS["groupid"]); + insert_hostgroups_form($_GET["groupid"]); ?> <?php - $host=@iif(isset($HTTP_GET_VARS["host"]),$HTTP_GET_VARS["host"],""); - $port=@iif(isset($HTTP_GET_VARS["port"]),$HTTP_GET_VARS["port"],get_profile("HOST_PORT",10000)); - $status=@iif(isset($HTTP_GET_VARS["status"]),$HTTP_GET_VARS["status"],0); - $useip=@iif(isset($HTTP_GET_VARS["useip"]),$HTTP_GET_VARS["useip"],"off"); - $newgroup=@iif(isset($HTTP_GET_VARS["newgroup"]),$HTTP_GET_VARS["newgroup"],""); - $ip=@iif(isset($HTTP_GET_VARS["ip"]),$HTTP_GET_VARS["ip"],""); - $host_templateid=@iif(isset($HTTP_GET_VARS["host_templateid"]),$HTTP_GET_VARS["host_templateid"],""); + $host=@iif(isset($_GET["host"]),$_GET["host"],""); + $port=@iif(isset($_GET["port"]),$_GET["port"],get_profile("HOST_PORT",10000)); + $status=@iif(isset($_GET["status"]),$_GET["status"],0); + $useip=@iif(isset($_GET["useip"]),$_GET["useip"],"off"); + $newgroup=@iif(isset($_GET["newgroup"]),$_GET["newgroup"],""); + $ip=@iif(isset($_GET["ip"]),$_GET["ip"],""); + $host_templateid=@iif(isset($_GET["host_templateid"]),$_GET["host_templateid"],""); if($useip!="on") { @@ -312,9 +312,9 @@ $useip="checked"; } - if(isset($HTTP_GET_VARS["register"]) && ($HTTP_GET_VARS["register"] == "change")) + if(isset($_GET["register"]) && ($_GET["register"] == "change")) { - $result=DBselect("select host,port,status,useip,ip from hosts where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select host,port,status,useip,ip from hosts where hostid=".$_GET["hostid"]); $host=DBget_field($result,0,0); $port=DBget_field($result,0,1); $status=DBget_field($result,0,2); @@ -342,13 +342,13 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"hosts.php#form\">"; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - echo "<input class=\"biginput\" name=\"hostid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["hostid"]."\">"; + echo "<input class=\"biginput\" name=\"hostid\" type=\"hidden\" value=\"".$_GET["hostid"]."\">"; } - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { - echo "<input class=\"biginput\" name=\"groupid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["groupid"]."\">"; + echo "<input class=\"biginput\" name=\"groupid\" type=\"hidden\" value=\"".$_GET["groupid"]."\">"; } echo S_HOST; show_table2_h_delimiter(); @@ -361,9 +361,9 @@ $result=DBselect("select distinct groupid,name from groups order by name"); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - $sql="select count(*) as count from hosts_groups where hostid=".$HTTP_GET_VARS["hostid"]." and groupid=".$row["groupid"]; + $sql="select count(*) as count from hosts_groups where hostid=".$_GET["hostid"]." and groupid=".$row["groupid"]; $result2=DBselect($sql); $row2=DBfetch($result2); if($row2["count"]==0) @@ -458,7 +458,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add items from template\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 65be722b..66e614b1 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1043,13 +1043,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; global $page; global $PHP_AUTH_USER,$PHP_AUTH_PW; global $USER_DETAILS; - global $HTTP_COOKIE_VARS; - global $HTTP_GET_VARS; + global $_COOKIE; + global $_GET; // global $sessionid; - if(isset($HTTP_COOKIE_VARS["sessionid"])) + if(isset($_COOKIE["sessionid"])) { - $sessionid=$HTTP_COOKIE_VARS["sessionid"]; + $sessionid=$_COOKIE["sessionid"]; } else { diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php index b427c915..8d8169e6 100644 --- a/frontends/php/include/defines.inc.php +++ b/frontends/php/include/defines.inc.php @@ -48,4 +48,12 @@ define("RECIPIENT_TYPE_USER",0); define("RECIPIENT_TYPE_GROUP",1); + +/* Support for PHP5. PHP5 does not have $HTTP_..._VARS */ + if (!function_exists('version_compare')) + { + $_GET = $HTTP_GET_VARS; + $_POST = $HTTP_POST_VARS; + $_COOKIE = $HTTP_COOKIE_VARS; + } ?> diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 3e36687e..19189f79 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -97,29 +97,29 @@ # Insert form for Item information function insert_item_form() { - global $HTTP_GET_VARS; - - $description=@iif(isset($HTTP_GET_VARS["description"]),$HTTP_GET_VARS["description"],""); - $key=@iif(isset($HTTP_GET_VARS["key"]),$HTTP_GET_VARS["key"],""); - $host=@iif(isset($HTTP_GET_VARS["host"]),$HTTP_GET_VARS["host"],""); - $port=@iif(isset($HTTP_GET_VARS["port"]),$HTTP_GET_VARS["port"],10000); - $delay=@iif(isset($HTTP_GET_VARS["delay"]),$HTTP_GET_VARS["delay"],30); - $history=@iif(isset($HTTP_GET_VARS["history"]),$HTTP_GET_VARS["history"],365); - $status=@iif(isset($HTTP_GET_VARS["status"]),$HTTP_GET_VARS["status"],0); - $type=@iif(isset($HTTP_GET_VARS["type"]),$HTTP_GET_VARS["type"],0); - $snmp_community=@iif(isset($HTTP_GET_VARS["snmp_community"]),$HTTP_GET_VARS["snmp_community"],"public"); - $snmp_oid=@iif(isset($HTTP_GET_VARS["snmp_oid"]),$HTTP_GET_VARS["snmp_oid"],"interfaces.ifTable.ifEntry.ifInOctets.1"); - $value_type=@iif(isset($HTTP_GET_VARS["value_type"]),$HTTP_GET_VARS["value_type"],0); - $trapper_hosts=@iif(isset($HTTP_GET_VARS["trapper_hosts"]),$HTTP_GET_VARS["trapper_hosts"],""); - $snmp_port=@iif(isset($HTTP_GET_VARS["snmp_port"]),$HTTP_GET_VARS["snmp_port"],161); - $units=@iif(isset($HTTP_GET_VARS["units"]),$HTTP_GET_VARS["units"],''); - $multiplier=@iif(isset($HTTP_GET_VARS["multiplier"]),$HTTP_GET_VARS["multiplier"],0); - $hostid=@iif(isset($HTTP_GET_VARS["hostid"]),$HTTP_GET_VARS["hostid"],0); - $delta=@iif(isset($HTTP_GET_VARS["delta"]),$HTTP_GET_VARS["delta"],0); - - if(isset($HTTP_GET_VARS["register"])&&($HTTP_GET_VARS["register"] == "change")) + global $_GET; + + $description=@iif(isset($_GET["description"]),$_GET["description"],""); + $key=@iif(isset($_GET["key"]),$_GET["key"],""); + $host=@iif(isset($_GET["host"]),$_GET["host"],""); + $port=@iif(isset($_GET["port"]),$_GET["port"],10000); + $delay=@iif(isset($_GET["delay"]),$_GET["delay"],30); + $history=@iif(isset($_GET["history"]),$_GET["history"],365); + $status=@iif(isset($_GET["status"]),$_GET["status"],0); + $type=@iif(isset($_GET["type"]),$_GET["type"],0); + $snmp_community=@iif(isset($_GET["snmp_community"]),$_GET["snmp_community"],"public"); + $snmp_oid=@iif(isset($_GET["snmp_oid"]),$_GET["snmp_oid"],"interfaces.ifTable.ifEntry.ifInOctets.1"); + $value_type=@iif(isset($_GET["value_type"]),$_GET["value_type"],0); + $trapper_hosts=@iif(isset($_GET["trapper_hosts"]),$_GET["trapper_hosts"],""); + $snmp_port=@iif(isset($_GET["snmp_port"]),$_GET["snmp_port"],161); + $units=@iif(isset($_GET["units"]),$_GET["units"],''); + $multiplier=@iif(isset($_GET["multiplier"]),$_GET["multiplier"],0); + $hostid=@iif(isset($_GET["hostid"]),$_GET["hostid"],0); + $delta=@iif(isset($_GET["delta"]),$_GET["delta"],0); + + if(isset($_GET["register"])&&($_GET["register"] == "change")) { - $result=DBselect("select i.description, i.key_, h.host, h.port, i.delay, i.history, i.status, i.type, i.snmp_community,i.snmp_oid,i.value_type,i.trapper_hosts,i.snmp_port,i.units,i.multiplier,h.hostid,i.delta from items i,hosts h where i.itemid=".$HTTP_GET_VARS["itemid"]." and h.hostid=i.hostid"); + $result=DBselect("select i.description, i.key_, h.host, h.port, i.delay, i.history, i.status, i.type, i.snmp_community,i.snmp_oid,i.value_type,i.trapper_hosts,i.snmp_port,i.units,i.multiplier,h.hostid,i.delta from items i,hosts h where i.itemid=".$_GET["itemid"]." and h.hostid=i.hostid"); $description=DBget_field($result,0,0); $key=DBget_field($result,0,1); @@ -128,7 +128,7 @@ $delay=DBget_field($result,0,4); $history=DBget_field($result,0,5); $status=DBget_field($result,0,6); - $type=iif(isset($HTTP_GET_VARS["type"]),isset($HTTP_GET_VARS["type"]),DBget_field($result,0,7)); + $type=iif(isset($_GET["type"]),isset($_GET["type"]),DBget_field($result,0,7)); $snmp_community=DBget_field($result,0,8); $snmp_oid=DBget_field($result,0,9); $value_type=DBget_field($result,0,10); @@ -147,9 +147,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"items.php\">"; - if(isset($HTTP_GET_VARS["itemid"])) + if(isset($_GET["itemid"])) { - echo "<input class=\"biginput\" name=\"itemid\" type=hidden value=".$HTTP_GET_VARS["itemid"].">"; + echo "<input class=\"biginput\" name=\"itemid\" type=hidden value=".$_GET["itemid"].">"; } echo "Description"; show_table2_h_delimiter(); @@ -322,7 +322,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add to all hosts\" onClick=\"return Confirm('Add item to all hosts?');\">"; - if(isset($HTTP_GET_VARS["itemid"])) + if(isset($_GET["itemid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete selected item?');\">"; @@ -334,7 +334,7 @@ # Insert form for Host Groups function insert_hostgroups_form($groupid) { - global $HTTP_GET_VARS; + global $_GET; if(isset($groupid)) { @@ -352,9 +352,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"hosts.php\">"; - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { - echo "<input name=\"groupid\" type=\"hidden\" value=\"".$HTTP_GET_VARS["groupid"]."\" size=8>"; + echo "<input name=\"groupid\" type=\"hidden\" value=\"".$_GET["groupid"]."\" size=8>"; } echo "Group name"; show_table2_h_delimiter(); @@ -367,9 +367,9 @@ $result=DBselect("select distinct hostid,host from hosts order by host"); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { - $sql="select count(*) as count from hosts_groups where hostid=".$row["hostid"]." and groupid=".$HTTP_GET_VARS["groupid"]; + $sql="select count(*) as count from hosts_groups where hostid=".$row["hostid"]." and groupid=".$_GET["groupid"]; $result2=DBselect($sql); $row2=DBfetch($result2); if($row2["count"]==0) @@ -390,7 +390,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add group\">"; - if(isset($HTTP_GET_VARS["groupid"])) + if(isset($_GET["groupid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update group\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete group\" onClick=\"return Confirm('Delete selected group?');\">"; @@ -402,7 +402,7 @@ # Insert form for User Groups function insert_usergroups_form($usrgrpid) { - global $HTTP_GET_VARS; + global $_GET; if(isset($usrgrpid)) { @@ -435,9 +435,9 @@ $result=DBselect("select distinct userid,alias from users order by alias"); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS["usrgrpid"])) + if(isset($_GET["usrgrpid"])) { - $sql="select count(*) as count from users_groups where userid=".$row["userid"]." and usrgrpid=".$HTTP_GET_VARS["usrgrpid"]; + $sql="select count(*) as count from users_groups where userid=".$row["userid"]." and usrgrpid=".$_GET["usrgrpid"]; $result2=DBselect($sql); $row2=DBfetch($result2); if($row2["count"]==0) @@ -458,7 +458,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add group\">"; - if(isset($HTTP_GET_VARS["usrgrpid"])) + if(isset($_GET["usrgrpid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update group\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete group\" onClick=\"return Confirm('Delete selected group?');\">"; @@ -518,7 +518,7 @@ function insert_login_form() { - global $HTTP_GET_VARS; + global $_GET; show_table2_header_begin(); echo "Login"; @@ -528,7 +528,7 @@ echo "Login name"; show_table2_h_delimiter(); -// echo "<input name=\"name\" value=\"".$HTTP_GET_VARS["name"]."\" size=20>"; +// echo "<input name=\"name\" value=\"".$_GET["name"]."\" size=20>"; echo "<input class=\"biginput\" name=\"name\" value=\"\" size=20>"; show_table2_v_delimiter(); diff --git a/frontends/php/include/html.inc.php b/frontends/php/include/html.inc.php index e7513383..dd292453 100644 --- a/frontends/php/include/html.inc.php +++ b/frontends/php/include/html.inc.php @@ -26,11 +26,11 @@ function url1_param($parameter) { - global $HTTP_GET_VARS; + global $_GET; - if(isset($HTTP_GET_VARS[$parameter])) + if(isset($_GET[$parameter])) { - return "$parameter=".$HTTP_GET_VARS[$parameter]; + return "$parameter=".$_GET[$parameter]; } else { @@ -40,11 +40,11 @@ function url_param($parameter) { - global $HTTP_GET_VARS; + global $_GET; - if(isset($HTTP_GET_VARS[$parameter])) + if(isset($_GET[$parameter])) { - return "&$parameter=".$HTTP_GET_VARS[$parameter]; + return "&$parameter=".$_GET[$parameter]; } else { diff --git a/frontends/php/index.php b/frontends/php/index.php index 79f64438..53a47edc 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -25,41 +25,41 @@ include "include/config.inc.php"; include "include/forms.inc.php"; - if(isset($HTTP_POST_VARS["password"])) + if(isset($_POST["password"])) { - $password=$HTTP_POST_VARS["password"]; + $password=$_POST["password"]; } else { unset($password); } - if(isset($HTTP_POST_VARS["name"])) + if(isset($_POST["name"])) { - $name=$HTTP_POST_VARS["name"]; + $name=$_POST["name"]; } else { unset($name); } - if(isset($HTTP_POST_VARS["register"])) + if(isset($_POST["register"])) { - $register=$HTTP_POST_VARS["register"]; + $register=$_POST["register"]; } else { unset($register); } - if(isset($HTTP_GET_VARS["reconnect"])) + if(isset($_GET["reconnect"])) { - $reconnect=$HTTP_GET_VARS["reconnect"]; + $reconnect=$_GET["reconnect"]; } else { unset($reconnect); } - if(isset($HTTP_COOKIE_VARS["sessionid"])) + if(isset($_COOKIE["sessionid"])) { - $sessionid=$HTTP_COOKIE_VARS["sessionid"]; + $sessionid=$_COOKIE["sessionid"]; } else { @@ -90,7 +90,7 @@ $sessionid=md5(time().$password.$name.rand(0,10000000)); setcookie("sessionid",$sessionid,time()+3600); // Required ! - $HTTP_COOKIE_VARS["sessionid"]=$sessionid; + $_COOKIE["sessionid"]=$sessionid; $sql="insert into sessions (sessionid,userid,lastaccess) values ('$sessionid',".$USER_DETAILS["userid"].",".time().")"; DBexecute($sql); @@ -110,7 +110,7 @@ <?php if(!isset($sessionid)) { -// echo "-",$HTTP_COOKIE_VARS["sessionid"],"-<br>"; +// echo "-",$_COOKIE["sessionid"],"-<br>"; insert_login_form(); } else diff --git a/frontends/php/items.php b/frontends/php/items.php index d1f74fd1..fa515d58 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -40,34 +40,34 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_item($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["key"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["delay"],$HTTP_GET_VARS["history"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["type"],$HTTP_GET_VARS["snmp_community"],$HTTP_GET_VARS["snmp_oid"],$HTTP_GET_VARS["value_type"],$HTTP_GET_VARS["trapper_hosts"],$HTTP_GET_VARS["snmp_port"],$HTTP_GET_VARS["units"],$HTTP_GET_VARS["multiplier"],$HTTP_GET_VARS["delta"]); + $result=update_item($_GET["itemid"],$_GET["description"],$_GET["key"],$_GET["hostid"],$_GET["delay"],$_GET["history"],$_GET["status"],$_GET["type"],$_GET["snmp_community"],$_GET["snmp_oid"],$_GET["value_type"],$_GET["trapper_hosts"],$_GET["snmp_port"],$_GET["units"],$_GET["multiplier"],$_GET["delta"]); show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM); // unset($itemid); } - if($HTTP_GET_VARS["register"]=="changestatus") + if($_GET["register"]=="changestatus") { - $result=update_item_status($HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["status"]); + $result=update_item_status($_GET["itemid"],$_GET["status"]); show_messages($result, S_STATUS_UPDATED, S_CANNOT_UPDATE_STATUS); - unset($HTTP_GET_VARS["itemid"]); + unset($_GET["itemid"]); } - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_item($HTTP_GET_VARS["description"],$HTTP_GET_VARS["key"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["delay"],$HTTP_GET_VARS["history"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["type"],$HTTP_GET_VARS["snmp_community"],$HTTP_GET_VARS["snmp_oid"],$HTTP_GET_VARS["value_type"],$HTTP_GET_VARS["trapper_hosts"],$HTTP_GET_VARS["snmp_port"],$HTTP_GET_VARS["units"],$HTTP_GET_VARS["multiplier"],$HTTP_GET_VARS["delta"]); + $result=add_item($_GET["description"],$_GET["key"],$_GET["hostid"],$_GET["delay"],$_GET["history"],$_GET["status"],$_GET["type"],$_GET["snmp_community"],$_GET["snmp_oid"],$_GET["value_type"],$_GET["trapper_hosts"],$_GET["snmp_port"],$_GET["units"],$_GET["multiplier"],$_GET["delta"]); show_messages($result, S_ITEM_ADDED, S_CANNOT_ADD_ITEM); - unset($HTTP_GET_VARS["itemid"]); + unset($_GET["itemid"]); } - if($HTTP_GET_VARS["register"]=="add to all hosts") + if($_GET["register"]=="add to all hosts") { $result=DBselect("select hostid,host from hosts order by host"); $hosts_ok=""; $hosts_notok=""; while($row=DBfetch($result)) { - $result2=add_item($HTTP_GET_VARS["description"],$HTTP_GET_VARS["key"],$row["hostid"],$HTTP_GET_VARS["delay"],$HTTP_GET_VARS["history"],$HTTP_GET_VARS["status"],$HTTP_GET_VARS["type"],$HTTP_GET_VARS["snmp_community"],$HTTP_GET_VARS["snmp_oid"],$HTTP_GET_VARS["value_type"],$HTTP_GET_VARS["trapper_hosts"],$HTTP_GET_VARS["snmp_port"],$HTTP_GET_VARS["units"],$HTTP_GET_VARS["multiplier"],$HTTP_GET_VARS["delta"]); + $result2=add_item($_GET["description"],$_GET["key"],$row["hostid"],$_GET["delay"],$_GET["history"],$_GET["status"],$_GET["type"],$_GET["snmp_community"],$_GET["snmp_oid"],$_GET["value_type"],$_GET["trapper_hosts"],$_GET["snmp_port"],$_GET["units"],$_GET["multiplier"],$_GET["delta"]); if($result2) { $hosts_ok=$hosts_ok." ".$row["host"]; @@ -78,47 +78,47 @@ } } show_messages(TRUE,"Items added]<br>[Success for '$hosts_ok']<br>[Failed for '$hosts_notok'","Cannot add item"); - unset($HTTP_GET_VARS["itemid"]); + unset($_GET["itemid"]); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_item($HTTP_GET_VARS["itemid"]); + $result=delete_item($_GET["itemid"]); show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM); unset($itemid); } - if($HTTP_GET_VARS["register"]=="Delete selected") + if($_GET["register"]=="Delete selected") { - $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select itemid from items where hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { // $$ is correct here - if(isset($HTTP_GET_VARS[$row["itemid"]])) + if(isset($_GET[$row["itemid"]])) { $result2=delete_item($row["itemid"]); } } show_messages(TRUE, S_ITEMS_DELETED, S_CANNOT_DELETE_ITEMS); } - if($HTTP_GET_VARS["register"]=="Activate selected") + if($_GET["register"]=="Activate selected") { - $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select itemid from items where hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { // $$ is correct here - if(isset($HTTP_GET_VARS[$row["itemid"]])) + if(isset($_GET[$row["itemid"]])) { $result2=activate_item($row["itemid"]); } } show_messages(TRUE, S_ITEMS_ACTIVATED, S_CANNOT_ACTIVATE_ITEMS); } - if($HTTP_GET_VARS["register"]=="Disable selected") + if($_GET["register"]=="Disable selected") { - $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select itemid from items where hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { // $$ is correct here - if(isset($HTTP_GET_VARS[$row["itemid"]])) + if(isset($_GET[$row["itemid"]])) { $result2=disable_item($row["itemid"]); } @@ -136,14 +136,14 @@ // Start of new code echo "<form name=\"form2\" method=\"get\" action=\"items.php\">"; - if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0)) + if(isset($_GET["groupid"])&&($_GET["groupid"]==0)) { - unset($HTTP_GET_VARS["groupid"]); + unset($_GET["groupid"]); } echo S_GROUP." "; echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL; + echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL; $result=DBselect("select groupid,name from groups order by name"); while($row=DBfetch($result)) @@ -161,7 +161,7 @@ } if($cnt!=0) { - echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; + echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; } } echo "</select>"; @@ -169,8 +169,8 @@ echo " ".S_HOST." "; echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; - $sql=iif(isset($HTTP_GET_VARS["groupid"]), - "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", + $sql=iif(isset($_GET["groupid"]), + "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host"); $result=DBselect($sql); @@ -180,7 +180,7 @@ { continue; } - echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; + echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; } echo "</select>"; @@ -190,9 +190,9 @@ show_table_header_end(); $lasthost=""; - if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["type"])) + if(isset($_GET["hostid"])&&!isset($_GET["type"])) { - $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid,i.type from hosts h,items i where h.hostid=i.hostid and h.hostid=".$HTTP_GET_VARS["hostid"]." order by h.host,i.key_,i.description"); + $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid,i.type from hosts h,items i where h.hostid=i.hostid and h.hostid=".$_GET["hostid"]." order by h.host,i.key_,i.description"); $col=0; while($row=DBfetch($result)) { @@ -209,7 +209,7 @@ echo "<br>"; show_table_header("<A HREF='items.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); echo "<form method=\"get\" action=\"items.php\">"; - echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$HTTP_GET_VARS["hostid"]." size=8>"; + echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>"; echo "<TABLE BORDER=0 COLS=13 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; // echo "<TD WIDTH=3% NOSAVE><B>Sel</B></TD>"; @@ -271,10 +271,10 @@ switch($row["status"]) { case 0: - echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."®ister=changestatus&status=1\"><font color=\"00AA00\">".S_ACTIVE."</font></a>"; + echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$_GET["hostid"]."®ister=changestatus&status=1\"><font color=\"00AA00\">".S_ACTIVE."</font></a>"; break; case 1: - echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."®ister=changestatus&status=0\"><font color=\"AA0000\">".S_NOT_ACTIVE."</font></a>"; + echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$_GET["hostid"]."®ister=changestatus&status=0\"><font color=\"AA0000\">".S_NOT_ACTIVE."</font></a>"; break; # case 2: # echo "Trapper"; diff --git a/frontends/php/latest.php b/frontends/php/latest.php index 1fab4909..a6819b29 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -32,13 +32,13 @@ show_footer(); exit; } - if(isset($HTTP_GET_VARS["select"])&&($HTTP_GET_VARS["select"]!="")) + if(isset($_GET["select"])&&($_GET["select"]!="")) { - unset($HTTP_GET_VARS["groupid"]); - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["groupid"]); + unset($_GET["hostid"]); } - if(isset($HTTP_GET_VARS["hostid"])&&!check_right("Host","R",$HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])&&!check_right("Host","R",$_GET["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -55,14 +55,14 @@ // Start of new code echo "<form name=\"form2\" method=\"get\" action=\"latest.php\">"; - if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0)) + if(isset($_GET["groupid"])&&($_GET["groupid"]==0)) { - unset($HTTP_GET_VARS["groupid"]); + unset($_GET["groupid"]); } echo S_GROUP." "; echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL; + echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL; $result=DBselect("select groupid,name from groups order by name"); while($row=DBfetch($result)) @@ -80,7 +80,7 @@ } if($cnt!=0) { - echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; + echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; } } echo "</select>"; @@ -88,8 +88,8 @@ echo " ".S_HOST." "; echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; - $sql=iif(isset($HTTP_GET_VARS["groupid"]), - "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", + $sql=iif(isset($_GET["groupid"]), + "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host"); $result=DBselect($sql); @@ -99,18 +99,18 @@ { continue; } - echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; + echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; } echo "</select>"; echo nbsp(" "); - if(isset($HTTP_GET_VARS["select"])&&($HTTP_GET_VARS["select"]=="")) + if(isset($_GET["select"])&&($_GET["select"]=="")) { - unset($HTTP_GET_VARS["select"]); + unset($_GET["select"]); } - iif_echo(isset($HTTP_GET_VARS["select"]), - "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$HTTP_GET_VARS["select"]."\">", + iif_echo(isset($_GET["select"]), + "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$_GET["select"]."\">", "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"\">"); echo nbsp(" "); echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"select\">"; @@ -121,65 +121,65 @@ show_table_header_end(); - if(!isset($HTTP_GET_VARS["sort"])) + if(!isset($_GET["sort"])) { - $HTTP_GET_VARS["sort"]="description"; + $_GET["sort"]="description"; } - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - $result=DBselect("select host from hosts where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select host from hosts where hostid=".$_GET["hostid"]); if(DBnum_rows($result)==0) { - unset($HTTP_GET_VARS["hostid"]); + unset($_GET["hostid"]); } } - if(isset($HTTP_GET_VARS["hostid"])||isset($HTTP_GET_VARS["select"])) + if(isset($_GET["hostid"])||isset($_GET["select"])) { echo "<br>"; - if(!isset($HTTP_GET_VARS["select"])) + if(!isset($_GET["select"])) { - $result=DBselect("select host from hosts where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select host from hosts where hostid=".$_GET["hostid"]); $host=DBget_field($result,0,0); - show_table_header("<a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."\">$host</a>"); + show_table_header("<a href=\"latest.php?hostid=".$_GET["hostid"]."\">$host</a>"); } else { - show_table_header("Description is like *".$HTTP_GET_VARS["select"]."*"); + show_table_header("Description is like *".$_GET["select"]."*"); } # show_table_header_begin(); -# echo "<a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."\">$host</a>"; +# echo "<a href=\"latest.php?hostid=".$_GET["hostid"]."\">$host</a>"; # show_table3_v_delimiter(); echo "<TABLE BORDER=0 COLS=4 WIDTH=100% cellspacing=1 cellpadding=3>"; cr(); echo "<TR BGCOLOR=\"CCCCCC\">"; cr(); - if(isset($HTTP_GET_VARS["select"])) + if(isset($_GET["select"])) { echo "<TD><B>Host</B></TD>"; } - if(!isset($HTTP_GET_VARS["sort"])||(isset($HTTP_GET_VARS["sort"])&&($HTTP_GET_VARS["sort"]=="description"))) + if(!isset($_GET["sort"])||(isset($_GET["sort"])&&($_GET["sort"]=="description"))) { echo "<TD><B>".S_DESCRIPTION_LARGE."</B></TD>"; } else { - iif_echo(isset($HTTP_GET_VARS["select"]), - "<TD><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>", - "<TD><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>"); + iif_echo(isset($_GET["select"]), + "<TD><B><a href=\"latest.php?select=".$_GET["select"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>", + "<TD><B><a href=\"latest.php?hostid=".$_GET["hostid"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>"); } - if(isset($HTTP_GET_VARS["sort"])&&($HTTP_GET_VARS["sort"]=="lastcheck")) + if(isset($_GET["sort"])&&($_GET["sort"]=="lastcheck")) { echo "<TD WIDTH=12%><B>LAST CHECK</B></TD>"; } else { - iif_echo(isset($HTTP_GET_VARS["select"]), - "<TD WIDTH=12%><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=lastcheck\">Last check</B></TD>", - "<TD WIDTH=12%><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=lastcheck\">Last check</B></TD>"); + iif_echo(isset($_GET["select"]), + "<TD WIDTH=12%><B><a href=\"latest.php?select=".$_GET["select"]."&sort=lastcheck\">Last check</B></TD>", + "<TD WIDTH=12%><B><a href=\"latest.php?hostid=".$_GET["hostid"]."&sort=lastcheck\">Last check</B></TD>"); } cr(); echo "<TD WIDTH=10%><B>Last value</B></TD>"; @@ -196,28 +196,28 @@ cr(); $col=0; - if(isset($HTTP_GET_VARS["sort"])) + if(isset($_GET["sort"])) { - switch ($HTTP_GET_VARS["sort"]) + switch ($_GET["sort"]) { case "description": - $HTTP_GET_VARS["sort"]="order by i.description"; + $_GET["sort"]="order by i.description"; break; case "lastcheck": - $HTTP_GET_VARS["sort"]="order by i.lastclock"; + $_GET["sort"]="order by i.lastclock"; break; default: - $HTTP_GET_VARS["sort"]="order by i.description"; + $_GET["sort"]="order by i.description"; break; } } else { - $HTTP_GET_VARS["sort"]="order by i.description"; + $_GET["sort"]="order by i.description"; } - $sql=iif(isset($HTTP_GET_VARS["select"]), - "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$HTTP_GET_VARS["select"]."%' ".$HTTP_GET_VARS["sort"], - "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$HTTP_GET_VARS["hostid"]." ".$HTTP_GET_VARS["sort"]); + $sql=iif(isset($_GET["select"]), + "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$_GET["select"]."%' ".$_GET["sort"], + "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$_GET["hostid"]." ".$_GET["sort"]); $result=DBselect($sql); while($row=DBfetch($result)) { @@ -233,7 +233,7 @@ "<tr bgcolor=#DDDDDD>", "<tr bgcolor=#EEEEEE>"); - if(isset($HTTP_GET_VARS["select"])) + if(isset($_GET["select"])) { table_td($row["host"],""); } diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php index 429e5bed..8305c3f6 100644 --- a/frontends/php/latestalarms.php +++ b/frontends/php/latestalarms.php @@ -34,16 +34,16 @@ ?> <?php - if(isset($HTTP_GET_VARS["start"])&&($HTTP_GET_VARS["start"]<=0)) + if(isset($_GET["start"])&&($_GET["start"]<=0)) { - unset($HTTP_GET_VARS["start"]); + unset($_GET["start"]); } - if(isset($HTTP_GET_VARS["start"])) + if(isset($_GET["start"])) { - echo "[<A HREF=\"latestalarms.php?start=".($HTTP_GET_VARS["start"]-100)."\">"; + echo "[<A HREF=\"latestalarms.php?start=".($_GET["start"]-100)."\">"; echo S_SHOW_PREVIOUS_100; echo "</A>] "; - echo "[<A HREF=\"latestalarms.php?start=".($HTTP_GET_VARS["start"]+100)."\">"; + echo "[<A HREF=\"latestalarms.php?start=".($_GET["start"]+100)."\">"; echo S_SHOW_NEXT_100; echo "</A>]"; } @@ -67,13 +67,13 @@ $row=DBfetch($result); $maxalarmid=@iif(DBnum_rows($result)>0,$row["max"],0); - if(!isset($HTTP_GET_VARS["start"])) + if(!isset($_GET["start"])) { $sql="select t.description,a.clock,a.value,t.triggerid,t.priority from alarms a,triggers t where t.triggerid=a.triggerid and a.alarmid>$maxalarmid-200 order by clock desc limit 200"; } else { - $sql="select t.description,a.clock,a.value,t.triggerid,t.priority from alarms a,triggers t where t.triggerid=a.triggerid and a.alarmid>$maxalarmid-".($HTTP_GET_VARS["start"]+200)." order by clock desc limit ".($HTTP_GET_VARS["start"]+200); + $sql="select t.description,a.clock,a.value,t.triggerid,t.priority from alarms a,triggers t where t.triggerid=a.triggerid and a.alarmid>$maxalarmid-".($_GET["start"]+200)." order by clock desc limit ".($_GET["start"]+200); } $result=DBselect($sql); @@ -89,7 +89,7 @@ while($row=DBfetch($result)) { $i++; - if(isset($HTTP_GET_VARS["start"])&&($i<$HTTP_GET_VARS["start"])) + if(isset($_GET["start"])&&($i<$_GET["start"])) { continue; } diff --git a/frontends/php/map.php b/frontends/php/map.php index 067a37c2..c1b2cb4f 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -28,7 +28,7 @@ $grid=50; - $result=DBselect("select name,width,height,use_background,background from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select name,width,height,use_background,background from sysmaps where sysmapid=".$_GET["sysmapid"]); $name=DBget_field($result,0,0); $width=DBget_field($result,0,1); @@ -90,7 +90,7 @@ ImageFilledRectangle($im,0,0,$width,$height,$white); } - if(!isset($HTTP_GET_VARS["border"])) + if(!isset($_GET["border"])) { ImageRectangle($im,0,0,$width-1,$height-1,$colors["Black"]); } @@ -101,14 +101,14 @@ $str=date("m.d.Y H:i:s",time(NULL)); ImageString($im, 0,imagesx($im)-120,imagesy($im)-12,"$str", $gray); - if(!check_right("Network map","R",$HTTP_GET_VARS["sysmapid"])) + if(!check_right("Network map","R",$_GET["sysmapid"])) { ImagePng($im); ImageDestroy($im); exit(); } - if(!isset($HTTP_GET_VARS["noedit"])) + if(!isset($_GET["noedit"])) { for($x=$grid;$x<$width;$x+=$grid) { @@ -126,7 +126,7 @@ # Draw connectors - $result=DBselect("select shostid1,shostid2,triggerid,color_off,drawtype_off,color_on,drawtype_on from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select shostid1,shostid2,triggerid,color_off,drawtype_off,color_on,drawtype_on from sysmaps_links where sysmapid=".$_GET["sysmapid"]); for($i=0;$i<DBnum_rows($result);$i++) { $shostid1=DBget_field($result,$i,0); @@ -198,7 +198,7 @@ # Draw hosts $icons=array(); - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=".$HTTP_GET_VARS["sysmapid"]." and h.hostid=sh.hostid"); + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_GET["sysmapid"]." and h.hostid=sh.hostid"); for($i=0;$i<DBnum_rows($result);$i++) { $host=DBget_field($result,$i,0); diff --git a/frontends/php/maps.php b/frontends/php/maps.php index 25bd5051..d6a56e0b 100644 --- a/frontends/php/maps.php +++ b/frontends/php/maps.php @@ -24,11 +24,11 @@ $page["file"] = "maps.php"; $nomenu=0; - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { $nomenu=1; } - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { show_header($page["title"],30,$nomenu); } @@ -39,7 +39,7 @@ ?> <?php - if(isset($HTTP_GET_VARS["sysmapid"])&&!check_right("Network map","R",$HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])&&!check_right("Network map","R",$_GET["sysmapid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -48,22 +48,22 @@ ?> <?php -// if(!isset($HTTP_GET_VARS["fullscreen"])) +// if(!isset($_GET["fullscreen"])) { show_table3_header_begin(); - if(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==0)) + if(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==0)) { - unset($HTTP_GET_VARS["sysmapid"]); + unset($_GET["sysmapid"]); } - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { - $result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select name from sysmaps where sysmapid=".$_GET["sysmapid"]); $map=DBget_field($result,0,0); - $map=iif(isset($HTTP_GET_VARS["fullscreen"]), - "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">".$map."</a>", - "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."&fullscreen=1\">".$map."</a>"); + $map=iif(isset($_GET["fullscreen"]), + "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."\">".$map."</a>", + "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."&fullscreen=1\">".$map."</a>"); } else { @@ -75,13 +75,13 @@ show_table3_h_delimiter(); echo "<form name=\"form2\" method=\"get\" action=\"maps.php\">"; - if(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==0)) + if(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==0)) { - unset($HTTP_GET_VARS["sysmapid"]); + unset($_GET["sysmapid"]); } echo "<select class=\"biginput\" name=\"sysmapid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_SELECT_MAP_DOT_DOT_DOT; + echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_SELECT_MAP_DOT_DOT_DOT; $result=DBselect("select sysmapid,name from sysmaps order by name"); while($row=DBfetch($result)) @@ -90,7 +90,7 @@ { continue; } - echo "<option value=\"".$row["sysmapid"]."\" ".iif(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==$row["sysmapid"]),"selected","").">".$row["name"]; + echo "<option value=\"".$row["sysmapid"]."\" ".iif(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==$row["sysmapid"]),"selected","").">".$row["name"]; } echo "</select>"; echo "</form>"; @@ -102,13 +102,13 @@ ?> <?php -/* if(isset($HTTP_GET_VARS["sysmapid"])) +/* if(isset($_GET["sysmapid"])) { - $result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select name from sysmaps where sysmapid=".$_GET["sysmapid"]); $map=DBget_field($result,0,0); - $map=iif(isset($HTTP_GET_VARS["fullscreen"]), - "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">".$map."</a>", - "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."&fullscreen=1\">".$map."</a>"); + $map=iif(isset($_GET["fullscreen"]), + "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."\">".$map."</a>", + "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."&fullscreen=1\">".$map."</a>"); } else { @@ -122,10 +122,10 @@ echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { - echo get_map_imagemap($HTTP_GET_VARS["sysmapid"]); - echo "<IMG SRC=\"map.php?noedit=1&sysmapid=".$HTTP_GET_VARS["sysmapid"]."\" border=0 usemap=#links>"; + echo get_map_imagemap($_GET["sysmapid"]); + echo "<IMG SRC=\"map.php?noedit=1&sysmapid=".$_GET["sysmapid"]."\" border=0 usemap=#links>"; } else { diff --git a/frontends/php/media.php b/frontends/php/media.php index 35651aff..07f7b9d6 100644 --- a/frontends/php/media.php +++ b/frontends/php/media.php @@ -28,7 +28,7 @@ ?> <?php - if(!check_right("User","U",$HTTP_GET_VARS["userid"])) + if(!check_right("User","U",$_GET["userid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font >"); @@ -39,33 +39,33 @@ <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="enable") + if($_GET["register"]=="enable") { - $result=activate_media( $HTTP_GET_VARS["mediaid"] ); + $result=activate_media( $_GET["mediaid"] ); show_messages($result, S_MEDIA_ACTIVATED, S_CANNOT_ACTIVATE_MEDIA); } - elseif($HTTP_GET_VARS["register"]=="disable") + elseif($_GET["register"]=="disable") { - $result=disactivate_media( $HTTP_GET_VARS["mediaid"] ); + $result=disactivate_media( $_GET["mediaid"] ); show_messages($result, S_MEDIA_DISABLED, S_CANNOT_DISABLE_MEDIA); } - elseif($HTTP_GET_VARS["register"]=="add") + elseif($_GET["register"]=="add") { - $result=add_media( $HTTP_GET_VARS["userid"], $HTTP_GET_VARS["mediatypeid"], $HTTP_GET_VARS["sendto"],$HTTP_GET_VARS["severity"],$HTTP_GET_VARS["active"]); + $result=add_media( $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$_GET["severity"],$_GET["active"]); show_messages($result, S_MEDIA_ADDED, S_CANNOT_ADD_MEDIA); } - elseif($HTTP_GET_VARS["register"]=="update") + elseif($_GET["register"]=="update") { - $result=update_media($HTTP_GET_VARS["mediaid"], $HTTP_GET_VARS["userid"], $HTTP_GET_VARS["mediatypeid"], $HTTP_GET_VARS["sendto"],$HTTP_GET_VARS["severity"],$HTTP_GET_VARS["active"]); + $result=update_media($_GET["mediaid"], $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$_GET["severity"],$_GET["active"]); show_messages($result,S_MEDIA_UPDATED,S_CANNOT_UPDATE_MEDIA); } - elseif($HTTP_GET_VARS["register"]=="delete") + elseif($_GET["register"]=="delete") { - $result=delete_media( $HTTP_GET_VARS["mediaid"] ); + $result=delete_media( $_GET["mediaid"] ); show_messages($result,S_MEDIA_DELETED, S_CANNOT_DELETE_MEDIA); - unset($HTTP_GET_VARS["mediaid"]); + unset($_GET["mediaid"]); } } ?> @@ -76,7 +76,7 @@ <FONT COLOR="#000000"> <?php - $sql="select m.mediaid,mt.description,m.sendto,m.active from media m,media_type mt where m.mediatypeid=mt.mediatypeid and m.userid=".$HTTP_GET_VARS["userid"]." order by mt.type,m.sendto"; + $sql="select m.mediaid,mt.description,m.sendto,m.active from media m,media_type mt where m.mediatypeid=mt.mediatypeid and m.userid=".$_GET["userid"]." order by mt.type,m.sendto"; $result=DBselect($sql); echo "<TABLE BORDER=0 WIDTH=100% align=center BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; @@ -108,15 +108,15 @@ echo "<TD>"; if(DBget_field($result,$i,3)==0) { - echo "<a href=\"media.php?register=disable&mediaid=$mediaid&userid=".$HTTP_GET_VARS["userid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></A>"; + echo "<a href=\"media.php?register=disable&mediaid=$mediaid&userid=".$_GET["userid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></A>"; } else { - echo "<a href=\"media.php?register=enable&mediaid=$mediaid&userid=".$HTTP_GET_VARS["userid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></A>"; + echo "<a href=\"media.php?register=enable&mediaid=$mediaid&userid=".$_GET["userid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></A>"; } echo "</TD>"; echo "<TD>"; - echo "<A HREF=\"media.php?register=change&mediaid=$mediaid&userid=".$HTTP_GET_VARS["userid"]."\">".S_CHANGE."</A>"; + echo "<A HREF=\"media.php?register=change&mediaid=$mediaid&userid=".$_GET["userid"]."\">".S_CHANGE."</A>"; echo "</TD>"; echo "</TR>"; } @@ -134,9 +134,9 @@ </TABLE> <?php - if(isset($HTTP_GET_VARS["mediaid"])) + if(isset($_GET["mediaid"])) { - $sql="select m.severity,m.sendto,m.active,m.mediatypeid from media m where m.mediaid=".$HTTP_GET_VARS["mediaid"]; + $sql="select m.severity,m.sendto,m.active,m.mediatypeid from media m where m.mediaid=".$_GET["mediaid"]; $result=DBselect($sql); $severity=DBget_field($result,0,0); $sendto=DBget_field($result,0,1); @@ -157,10 +157,10 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"media.php\">"; - echo "<input name=\"userid\" type=\"hidden\" value=".$HTTP_GET_VARS["userid"].">"; - if(isset($HTTP_GET_VARS["mediaid"])) + echo "<input name=\"userid\" type=\"hidden\" value=".$_GET["userid"].">"; + if(isset($_GET["mediaid"])) { - echo "<input name=\"mediaid\" type=\"hidden\" value=".$HTTP_GET_VARS["mediaid"].">"; + echo "<input name=\"mediaid\" type=\"hidden\" value=".$_GET["mediaid"].">"; } echo S_TYPE; show_table2_h_delimiter(); @@ -222,7 +222,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["mediaid"])) + if(isset($_GET["mediaid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_SELECTED_MEDIA_Q."');\">"; diff --git a/frontends/php/report2.php b/frontends/php/report2.php index 353300e0..62967406 100644 --- a/frontends/php/report2.php +++ b/frontends/php/report2.php @@ -48,12 +48,12 @@ { continue; } - if( isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]) ) + if( isset($_GET["hostid"]) && ($_GET["hostid"] == $row["hostid"]) ) { echo "<b>["; } echo "<a href='report2.php?hostid=".$row["hostid"]."'>".$row["host"]."</a>"; - if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]) ) + if(isset($_GET["hostid"]) && ($_GET["hostid"] == $row["hostid"]) ) { echo "]</b>"; } @@ -64,14 +64,14 @@ ?> <?php - if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["triggerid"])) + if(isset($_GET["hostid"])&&!isset($_GET["triggerid"])) { echo "<br>"; - $result=DBselect("select host from hosts where hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select host from hosts where hostid=".$_GET["hostid"]); $row=DBfetch($result); show_table_header($row["host"]); - $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description"); + $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description"); echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><B>".S_DESCRIPTION."</B></TD>"; @@ -114,7 +114,7 @@ printf("%.4f%%",$availability["unknown"]); echo "</TD>"; echo "<TD>"; - echo "<a href=\"report2.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."\">".S_SHOW."</a>"; + echo "<a href=\"report2.php?hostid=".$_GET["hostid"]."&triggerid=".$row["triggerid"]."\">".S_SHOW."</a>"; echo "</TD>"; echo "</TR>\n"; } @@ -123,13 +123,13 @@ ?> <?php - if(isset($HTTP_GET_VARS["triggerid"])) + if(isset($_GET["triggerid"])) { echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - echo "<IMG SRC=\"chart4.php?triggerid=".$HTTP_GET_VARS["triggerid"]."\" border=0>"; + echo "<IMG SRC=\"chart4.php?triggerid=".$_GET["triggerid"]."\" border=0>"; echo "</TD>"; echo "</TR>"; echo "</TABLE>"; diff --git a/frontends/php/report3.php b/frontends/php/report3.php index b7289b2f..61a7b953 100644 --- a/frontends/php/report3.php +++ b/frontends/php/report3.php @@ -35,13 +35,13 @@ ?> <?php - if(!isset($HTTP_GET_VARS["serviceid"])) + if(!isset($_GET["serviceid"])) { show_table_header("<font color=\"AA0000\">Undefined serviceid !</font>"); show_footer(); exit; } - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); + $service=get_service_by_serviceid($_GET["serviceid"]); ?> <?php @@ -57,12 +57,12 @@ $year=date("Y"); for($year=date("Y")-2;$year<=date("Y");$year++) { - if( isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] == $year) ) + if( isset($_GET["year"]) && ($_GET["year"] == $year) ) { echo "<b>["; } - echo "<a href='report3.php?serviceid=".$HTTP_GET_VARS["serviceid"]."&year=$year'>".$year."</a>"; - if(isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] == $year) ) + echo "<a href='report3.php?serviceid=".$_GET["serviceid"]."&year=$year'>".$year."</a>"; + if(isset($_GET["year"]) && ($_GET["year"] == $year) ) { echo "]</b>"; } @@ -90,7 +90,7 @@ $year=date("Y"); for($year=date("Y")-2;$year<=date("Y");$year++) { - if( isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] != $year) ) + if( isset($_GET["year"]) && ($_GET["year"] != $year) ) { continue; } diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 300ce321..c88a81d4 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -41,23 +41,23 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_screen($HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]); + $result=add_screen($_GET["name"],$_GET["cols"],$_GET["rows"]); show_messages($result,S_SCREEN_ADDED,S_CANNOT_ADD_SCREEN); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_screen($HTTP_GET_VARS["screenid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]); + $result=update_screen($_GET["screenid"],$_GET["name"],$_GET["cols"],$_GET["rows"]); show_messages($result, S_SCREEN_UPDATED, S_CANNOT_UPDATE_SCREEN); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_screen($HTTP_GET_VARS["screenid"]); + $result=delete_screen($_GET["screenid"]); show_messages($result, S_SCREEN_DELETED, S_CANNOT_DELETE_SCREEN); - unset($HTTP_GET_VARS["screenid"]); + unset($_GET["screenid"]); } } ?> @@ -102,9 +102,9 @@ <?php echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["screenid"])) + if(isset($_GET["screenid"])) { - $result=DBselect("select screenid,name,cols,rows from screens g where screenid=".$HTTP_GET_VARS["screenid"]); + $result=DBselect("select screenid,name,cols,rows from screens g where screenid=".$_GET["screenid"]); $row=DBfetch($result); $name=$row["name"]; $cols=$row["cols"]; @@ -123,9 +123,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"screenconf.php\">"; - if(isset($HTTP_GET_VARS["screenid"])) + if(isset($_GET["screenid"])) { - echo "<input class=\"biginput\" name=\"screenid\" type=\"hidden\" value=".$HTTP_GET_VARS["screenid"].">"; + echo "<input class=\"biginput\" name=\"screenid\" type=\"hidden\" value=".$_GET["screenid"].">"; } echo S_NAME; show_table2_h_delimiter(); @@ -143,7 +143,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["screenid"])) + if(isset($_GET["screenid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_SCREEN_Q."');\">"; diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index 6ad3c07e..9fedf1a9 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -31,7 +31,7 @@ ?> <?php - if(!check_right("Screen","U",$HTTP_GET_VARS["screenid"])) + if(!check_right("Screen","U",$_GET["screenid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -40,38 +40,38 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { -// if(isset($HTTP_GET_VARS["screenitemid"])) +// if(isset($_GET["screenitemid"])) // { -// delete_screen_item($HTTP_GET_VARS["screenitemid"]); -// unset($HTTP_GET_VARS["screenitemid"]); +// delete_screen_item($_GET["screenitemid"]); +// unset($_GET["screenitemid"]); // } - $result=add_screen_item($HTTP_GET_VARS["resource"],$HTTP_GET_VARS["screenid"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["resourceid"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); - unset($HTTP_GET_VARS["x"]); + $result=add_screen_item($_GET["resource"],$_GET["screenid"],$_GET["x"],$_GET["y"],$_GET["resourceid"],$_GET["width"],$_GET["height"]); + unset($_GET["x"]); show_messages($result, S_ITEM_ADDED, S_CANNOT_ADD_ITEM); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_screen_item($HTTP_GET_VARS["screenitemid"]); + $result=delete_screen_item($_GET["screenitemid"]); show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM); - unset($HTTP_GET_VARS["x"]); + unset($_GET["x"]); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_screen_item($HTTP_GET_VARS["screenitemid"],$HTTP_GET_VARS["resource"],$HTTP_GET_VARS["resourceid"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); + $result=update_screen_item($_GET["screenitemid"],$_GET["resource"],$_GET["resourceid"],$_GET["width"],$_GET["height"]); show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM); - unset($HTTP_GET_VARS["x"]); + unset($_GET["x"]); } - unset($HTTP_GET_VARS["register"]); + unset($_GET["register"]); } ?> <?php - $screenid=$HTTP_GET_VARS["screenid"]; + $screenid=$_GET["screenid"]; $result=DBselect("select name,cols,rows from screens where screenid=$screenid"); $row=DBfetch($result); show_table_header("<a href=\"screenedit.php?screenid=$screenid\">".$row["name"]."</a>"); @@ -105,13 +105,13 @@ $height=100; } - if(isset($HTTP_GET_VARS["x"])&&($HTTP_GET_VARS["x"]==$c)&&($HTTP_GET_VARS["y"]==$r)) + if(isset($_GET["x"])&&($_GET["x"]==$c)&&($_GET["y"]==$r)) { - $resource=@iif(isset($HTTP_GET_VARS["resource"]),$HTTP_GET_VARS["resource"],$resource); - $resourceid=@iif(isset($HTTP_GET_VARS["resourceid"]),$HTTP_GET_VARS["resourceid"],$resourceid); - $screenitemid=@iif(isset($HTTP_GET_VARS["screenitemid"]),$HTTP_GET_VARS["screenitemid"],$screenitemid); - $width=@iif(isset($HTTP_GET_VARS["width"]),$HTTP_GET_VARS["width"],$width); - $height=@iif(isset($HTTP_GET_VARS["height"]),$HTTP_GET_VARS["height"],$height); + $resource=@iif(isset($_GET["resource"]),$_GET["resource"],$resource); + $resourceid=@iif(isset($_GET["resourceid"]),$_GET["resourceid"],$resourceid); + $screenitemid=@iif(isset($_GET["screenitemid"]),$_GET["screenitemid"],$screenitemid); + $width=@iif(isset($_GET["width"]),$_GET["width"],$width); + $height=@iif(isset($_GET["height"]),$_GET["height"],$height); show_table2_header_begin(); echo S_SCREEN_CELL_CONFIGURATION; diff --git a/frontends/php/screens.php b/frontends/php/screens.php index 836e4f42..507586a9 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -24,11 +24,11 @@ $page["file"] = "screens.php"; $nomenu=0; - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { $nomenu=1; } - if(isset($HTTP_GET_VARS["screenid"])) + if(isset($_GET["screenid"])) { show_header($page["title"],60,$nomenu); } @@ -39,7 +39,7 @@ ?> <?php - if(!isset($HTTP_GET_VARS["fullscreen"])) + if(!isset($_GET["fullscreen"])) { show_table_header_begin(); echo S_SCREENS_BIG; @@ -55,12 +55,12 @@ { continue; } - if( isset($HTTP_GET_VARS["screenid"]) && ($HTTP_GET_VARS["screenid"] == $row["screenid"]) ) + if( isset($_GET["screenid"]) && ($_GET["screenid"] == $row["screenid"]) ) { echo "<b>["; } echo "<a href='screens.php?screenid=".$row["screenid"]."'>".$row["name"]."</a>"; - if(isset($HTTP_GET_VARS["screenid"]) && ($HTTP_GET_VARS["screenid"] == $row["screenid"]) ) + if(isset($_GET["screenid"]) && ($_GET["screenid"] == $row["screenid"]) ) { echo "]</b>"; } @@ -78,19 +78,19 @@ ?> <?php -// if(isset($HTTP_GET_VARS["screenid"])) - if( isset($HTTP_GET_VARS["screenid"]) && check_right("Screen","R",$HTTP_GET_VARS["screenid"])) +// if(isset($_GET["screenid"])) + if( isset($_GET["screenid"]) && check_right("Screen","R",$_GET["screenid"])) { - $screenid=$HTTP_GET_VARS["screenid"]; + $screenid=$_GET["screenid"]; $result=DBselect("select name,cols,rows from screens where screenid=$screenid"); $row=DBfetch($result); - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { - $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."\">".$row["name"]."</a>"; + $map="<a href=\"screens.php?screenid=".$_GET["screenid"]."\">".$row["name"]."</a>"; } else { - $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."&fullscreen=1\">".$row["name"]."</a>"; + $map="<a href=\"screens.php?screenid=".$_GET["screenid"]."&fullscreen=1\">".$row["name"]."</a>"; } show_table_header($map); echo "<TABLE BORDER=1 COLS=".$row["cols"]." align=center WIDTH=100% BGCOLOR=\"#FFFFFF\""; diff --git a/frontends/php/services.php b/frontends/php/services.php index 6f286d2f..364f759e 100644 --- a/frontends/php/services.php +++ b/frontends/php/services.php @@ -38,45 +38,45 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=@update_service($HTTP_GET_VARS["serviceid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["linktrigger"],$HTTP_GET_VARS["algorithm"],$HTTP_GET_VARS["showsla"],$HTTP_GET_VARS["goodsla"],$HTTP_GET_VARS["sortorder"]); + $result=@update_service($_GET["serviceid"],$_GET["name"],$_GET["triggerid"],$_GET["linktrigger"],$_GET["algorithm"],$_GET["showsla"],$_GET["goodsla"],$_GET["sortorder"]); show_messages($result, S_SERVICE_UPDATED, S_CANNOT_UPDATE_SERVICE); } - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=@add_service($HTTP_GET_VARS["serviceid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["linktrigger"],$HTTP_GET_VARS["algorithm"],$HTTP_GET_VARS["showsla"],$HTTP_GET_VARS["goodsla"],$HTTP_GET_VARS["goodsla"]); + $result=@add_service($_GET["serviceid"],$_GET["name"],$_GET["triggerid"],$_GET["linktrigger"],$_GET["algorithm"],$_GET["showsla"],$_GET["goodsla"],$_GET["goodsla"]); show_messages($result, S_SERVICE_ADDED, S_CANNOT_ADD_SERVICE); } - if($HTTP_GET_VARS["register"]=="add server") + if($_GET["register"]=="add server") { - $result=add_host_to_services($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["serviceid"]); + $result=add_host_to_services($_GET["hostid"],$_GET["serviceid"]); show_messages($result, S_TRIGGER_ADDED, S_CANNOT_ADD_TRIGGER); } - if($HTTP_GET_VARS["register"]=="add link") + if($_GET["register"]=="add link") { - if(!isset($HTTP_GET_VARS["softlink"])) + if(!isset($_GET["softlink"])) { - $HTTP_GET_VARS["softlink"]=0; + $_GET["softlink"]=0; } else { - $HTTP_GET_VARS["softlink"]=1; + $_GET["softlink"]=1; } - $result=add_service_link($HTTP_GET_VARS["servicedownid"],$HTTP_GET_VARS["serviceupid"],$HTTP_GET_VARS["softlink"]); + $result=add_service_link($_GET["servicedownid"],$_GET["serviceupid"],$_GET["softlink"]); show_messages($result, S_LINK_ADDED, S_CANNOT_ADD_LINK); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_service($HTTP_GET_VARS["serviceid"]); + $result=delete_service($_GET["serviceid"]); show_messages($result, S_SERVICE_DELETED, S_CANNOT_DELETE_SERVICE); - unset($HTTP_GET_VARS["serviceid"]); + unset($_GET["serviceid"]); } - if($HTTP_GET_VARS["register"]=="delete_link") + if($_GET["register"]=="delete_link") { - $result=delete_service_link($HTTP_GET_VARS["linkid"]); + $result=delete_service_link($_GET["linkid"]); show_messages($result, S_LINK_DELETED, S_CANNOT_DELETE_LINK); } } @@ -94,10 +94,10 @@ echo "</tr>"; $col=0; - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { echo "<tr bgcolor=#EEEEEE>"; - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); + $service=get_service_by_serviceid($_GET["serviceid"]); echo "<td><b><a href=\"services.php?serviceid=".$service["serviceid"]."#form\">".$service["name"]."</a></b></td>"; if($service["algorithm"] == SERVICE_ALGORITHM_NONE) { @@ -120,15 +120,15 @@ } while($row=DBfetch($result)) { - if(!isset($HTTP_GET_VARS["serviceid"]) && service_has_parent($row["serviceid"])) + if(!isset($_GET["serviceid"]) && service_has_parent($row["serviceid"])) { continue; } - if(isset($HTTP_GET_VARS["serviceid"]) && service_has_no_this_parent($HTTP_GET_VARS["serviceid"],$row["serviceid"])) + if(isset($_GET["serviceid"]) && service_has_no_this_parent($_GET["serviceid"],$row["serviceid"])) { continue; } - if(isset($HTTP_GET_VARS["serviceid"])&&($HTTP_GET_VARS["serviceid"]==$row["serviceid"])) + if(isset($_GET["serviceid"])&&($_GET["serviceid"]==$row["serviceid"])) { echo "<tr bgcolor=#99AABB>"; } @@ -138,7 +138,7 @@ else { echo "<tr bgcolor=#DDDDDD>"; } } $childs=get_num_of_service_childs($row["serviceid"]); - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { echo "<td> - <a href=\"services.php?serviceid=".$row["serviceid"]."#form\">".$row["name"]." [$childs]</a></td>"; } @@ -168,7 +168,7 @@ ?> <?php - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { show_table_header("LINKS"); echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>"; @@ -178,7 +178,7 @@ echo "<td><b>".S_SOFT_HARD_LINK."</b></td>"; echo "<td><b>".S_ACTIONS."</b></td>"; echo "</tr>"; - $sql="select linkid,servicedownid,serviceupid,soft from services_links where serviceupid=".$HTTP_GET_VARS["serviceid"]." or servicedownid=".$HTTP_GET_VARS["serviceid"]; + $sql="select linkid,servicedownid,serviceupid,soft from services_links where serviceupid=".$_GET["serviceid"]." or servicedownid=".$_GET["serviceid"]; $result=DBselect($sql); $col=0; while($row=DBfetch($result)) @@ -197,7 +197,7 @@ { echo "<td>".S_SOFT."</td>"; } - echo "<td><a href=\"services.php?register=delete_link&serviceid=".$HTTP_GET_VARS["serviceid"]."&linkid=".$row["linkid"]."\">".S_DELETE."</a></td>"; + echo "<td><a href=\"services.php?register=delete_link&serviceid=".$_GET["serviceid"]."&linkid=".$row["linkid"]."\">".S_DELETE."</a></td>"; echo "</tr>"; } echo "</table>"; @@ -205,9 +205,9 @@ ?> <?php - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { - $result=DBselect("select serviceid,triggerid,name,algorithm,showsla,goodsla,sortorder from services where serviceid=".$HTTP_GET_VARS["serviceid"]); + $result=DBselect("select serviceid,triggerid,name,algorithm,showsla,goodsla,sortorder from services where serviceid=".$_GET["serviceid"]); $triggerid=DBget_field($result,0,1); $name=DBget_field($result,0,2); $algorithm=DBget_field($result,0,3); @@ -231,9 +231,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"services.php\">"; - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { - echo "<input class=\"biginput\" name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">"; + echo "<input class=\"biginput\" name=\"serviceid\" type=\"hidden\" value=".$_GET["serviceid"].">"; } echo S_NAME; show_table2_h_delimiter(); @@ -243,24 +243,24 @@ echo nbsp(S_STATUS_CALCULATION_ALGORITHM); show_table2_h_delimiter(); echo "<select class=\"biginput\" name=\"algorithm\" size=1>"; -// if(isset($HTTP_GET_VARS["algorithm"])) +// if(isset($_GET["algorithm"])) if(isset($algorithm)) { -// if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_NONE) +// if($_GET["algorithm"] == SERVICE_ALGORITHM_NONE) if($algorithm == SERVICE_ALGORITHM_NONE) { echo "<OPTION VALUE='0' SELECTED>".S_DO_NOT_CALCULATE; echo "<OPTION VALUE='1'>".S_MAX_BIG; echo "<OPTION VALUE='2'>".S_MIN_BIG; } -// else if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_MAX) +// else if($_GET["algorithm"] == SERVICE_ALGORITHM_MAX) else if($algorithm == SERVICE_ALGORITHM_MAX) { echo "<OPTION VALUE='0'>".S_DO_NOT_CALCULATE; echo "<OPTION VALUE='1' SELECTED>".S_MAX_BIG; echo "<OPTION VALUE='2'>".S_MIN_BIG; } - else if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_MIN) + else if($_GET["algorithm"] == SERVICE_ALGORITHM_MIN) { echo "<OPTION VALUE='0'>".S_DO_NOT_CALCULATE; echo "<OPTION VALUE='1'>".S_MAX_BIG; @@ -318,7 +318,7 @@ // { $description_=expand_trigger_description($triggerid_); // } -// if(isset($HTTP_GET_VARS["triggerid"]) && ($HTTP_GET_VARS["triggerid"]==$triggerid_)) +// if(isset($_GET["triggerid"]) && ($_GET["triggerid"]==$triggerid_)) if(isset($triggerid) && ($triggerid==$triggerid_)) { echo "<OPTION VALUE='$triggerid_' SELECTED>$description_"; @@ -341,7 +341,7 @@ { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; } - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_SERVICE_Q."');\">"; @@ -351,16 +351,16 @@ ?> <?php - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { - $result=DBselect("select serviceid,triggerid,name from services where serviceid=".$HTTP_GET_VARS["serviceid"]); + $result=DBselect("select serviceid,triggerid,name from services where serviceid=".$_GET["serviceid"]); $triggerid=DBget_field($result,0,1); $name=DBget_field($result,0,2); } else { $name=""; - unset($HTTP_GET_VARS["triggerid"]); + unset($_GET["triggerid"]); } echo "<br>"; @@ -369,10 +369,10 @@ show_table2_v_delimiter(); echo "<form method=\"post\" action=\"services.php\">"; - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { - echo "<input name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">"; - echo "<input name=\"serviceupid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">"; + echo "<input name=\"serviceid\" type=\"hidden\" value=".$_GET["serviceid"].">"; + echo "<input name=\"serviceupid\" type=\"hidden\" value=".$_GET["serviceid"].">"; } echo S_NAME; show_table2_h_delimiter(); @@ -400,7 +400,7 @@ show_table2_v_delimiter(); echo nbsp(S_SOFT_LINK_Q); show_table2_h_delimiter(); -// if(isset($HTTP_GET_VARS["softlink"])&&($HTTP_GET_VARS["triggerid"]!="")) +// if(isset($_GET["softlink"])&&($_GET["triggerid"]!="")) // { // echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"softlink\" VALUE=\"true\">"; // } @@ -417,7 +417,7 @@ ?> <?php - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { echo "<br>"; @@ -426,9 +426,9 @@ show_table2_v_delimiter(); echo "<form method=\"post\" action=\"services.php\">"; - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { - echo "<input name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">"; + echo "<input name=\"serviceid\" type=\"hidden\" value=".$_GET["serviceid"].">"; } echo S_SERVER; show_table2_h_delimiter(); diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php index 05e2273c..8c5872d6 100644 --- a/frontends/php/srv_status.php +++ b/frontends/php/srv_status.php @@ -29,13 +29,13 @@ <?php show_table_header(S_IT_SERVICES_BIG); - if(isset($HTTP_GET_VARS["serviceid"])&&isset($HTTP_GET_VARS["showgraph"])) + if(isset($_GET["serviceid"])&&isset($_GET["showgraph"])) { echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - echo "<IMG SRC=\"chart5.php?serviceid=".$HTTP_GET_VARS["serviceid"]."\" border=0>"; + echo "<IMG SRC=\"chart5.php?serviceid=".$_GET["serviceid"]."\" border=0>"; echo "</TD>"; echo "</TR>"; echo "</TABLE>"; @@ -57,10 +57,10 @@ echo "</tr>"; echo "\n"; $col=0; - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { echo "<tr bgcolor=#EEEEEE>"; - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); + $service=get_service_by_serviceid($_GET["serviceid"]); echo "<td><b><a href=\"srv_status.php?serviceid=".$service["serviceid"]."\">".$service["name"]."</a></b></td>"; echo "<td>".get_service_status_description($service["status"])."</td>"; echo "<td> </td>"; @@ -99,11 +99,11 @@ } while($row=DBfetch($result)) { - if(!isset($HTTP_GET_VARS["serviceid"]) && service_has_parent($row["serviceid"])) + if(!isset($_GET["serviceid"]) && service_has_parent($row["serviceid"])) { continue; } - if(isset($HTTP_GET_VARS["serviceid"]) && service_has_no_this_parent($HTTP_GET_VARS["serviceid"],$row["serviceid"])) + if(isset($_GET["serviceid"]) && service_has_no_this_parent($_GET["serviceid"],$row["serviceid"])) { continue; } @@ -111,7 +111,7 @@ { continue; } - if(isset($HTTP_GET_VARS["serviceid"])&&($HTTP_GET_VARS["serviceid"]==$row["serviceid"])) + if(isset($_GET["serviceid"])&&($_GET["serviceid"]==$row["serviceid"])) { echo "<tr bgcolor=#99AABB>"; } @@ -136,7 +136,7 @@ $trigger_link=""; $description=$row["name"]; } - if(isset($HTTP_GET_VARS["serviceid"])) + if(isset($_GET["serviceid"])) { if($childs == 0) { diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 40e8d1f5..339b490c 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -26,7 +26,7 @@ ?> <?php - if(!check_right("Network map","U",$HTTP_GET_VARS["sysmapid"])) + if(!check_right("Network map","U",$_GET["sysmapid"])) { show_table_header("<font color=\"AA0000\">No permissions !</font>"); show_footer(); @@ -40,50 +40,50 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_host_to_sysmap($HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["label"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["icon"]); + $result=add_host_to_sysmap($_GET["sysmapid"],$_GET["hostid"],$_GET["label"],$_GET["x"],$_GET["y"],$_GET["icon"]); show_messages($result,"Host added","Cannot add host"); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_sysmap_host($HTTP_GET_VARS["shostid"],$HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["label"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["icon"]); + $result=update_sysmap_host($_GET["shostid"],$_GET["sysmapid"],$_GET["hostid"],$_GET["label"],$_GET["x"],$_GET["y"],$_GET["icon"]); show_messages($result,"Host updated","Cannot update host"); } - if($HTTP_GET_VARS["register"]=="add link") + if($_GET["register"]=="add link") { - $result=add_link($HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["shostid1"],$HTTP_GET_VARS["shostid2"],$HTTP_GET_VARS["triggerid"], - $HTTP_GET_VARS["drawtype_off"],$HTTP_GET_VARS["color_off"],$HTTP_GET_VARS["drawtype_on"],$HTTP_GET_VARS["color_on"]); + $result=add_link($_GET["sysmapid"],$_GET["shostid1"],$_GET["shostid2"],$_GET["triggerid"], + $_GET["drawtype_off"],$_GET["color_off"],$_GET["drawtype_on"],$_GET["color_on"]); show_messages($result,"Link added","Cannot add link"); } - if($HTTP_GET_VARS["register"]=="delete_link") + if($_GET["register"]=="delete_link") { - $result=delete_link($HTTP_GET_VARS["linkid"]); + $result=delete_link($_GET["linkid"]); show_messages($result,"Link deleted","Cannot delete link"); - unset($HTTP_GET_VARS["linkid"]); + unset($_GET["linkid"]); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_sysmaps_host($HTTP_GET_VARS["shostid"]); + $result=delete_sysmaps_host($_GET["shostid"]); show_messages($result,"Host deleted","Cannot delete host"); - unset($HTTP_GET_VARS["shostid"]); + unset($_GET["shostid"]); } } ?> <?php - $result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select name from sysmaps where sysmapid=".$_GET["sysmapid"]); $map=DBget_field($result,0,0); show_table_header($map); echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { $map="\n<map name=links>"; - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status from sysmaps_hosts sh,hosts h where sh.sysmapid=".$HTTP_GET_VARS["sysmapid"]." and h.hostid=sh.hostid"); + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,h.status from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_GET["sysmapid"]." and h.hostid=sh.hostid"); for($i=0;$i<DBnum_rows($result);$i++) { $host_=DBget_field($result,$i,0); @@ -106,7 +106,7 @@ } $map=$map."\n</map>"; echo $map; - echo "<IMG SRC=\"map.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\" border=0 usemap=#links>"; + echo "<IMG SRC=\"map.php?sysmapid=".$_GET["sysmapid"]."\" border=0 usemap=#links>"; } echo "</TD>"; @@ -123,7 +123,7 @@ echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; - $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=".$HTTP_GET_VARS["sysmapid"]." and h.hostid=sh.hostid order by h.host"); + $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=".$_GET["sysmapid"]." and h.hostid=sh.hostid order by h.host"); $col=0; for($i=0;$i<DBnum_rows($result);$i++) { @@ -166,7 +166,7 @@ echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; - $result=DBselect("select linkid,shostid1,shostid2,triggerid from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]." order by linkid"); + $result=DBselect("select linkid,shostid1,shostid2,triggerid from sysmaps_links where sysmapid=".$_GET["sysmapid"]." order by linkid"); $col=0; for($i=0;$i<DBnum_rows($result);$i++) { @@ -207,7 +207,7 @@ echo "<TD>$label1</TD>"; echo "<TD>$label2</TD>"; echo "<TD>$description</TD>"; - echo "<TD><A HREF=\"sysmap.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."®ister=delete_link&linkid=$linkid\">Delete</A></TD>"; + echo "<TD><A HREF=\"sysmap.php?sysmapid=".$_GET["sysmapid"]."®ister=delete_link&linkid=$linkid\">Delete</A></TD>"; echo "</TR>"; } echo "</TABLE>"; @@ -217,9 +217,9 @@ echo "<br>"; echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["shostid"])) + if(isset($_GET["shostid"])) { - $result=DBselect("select hostid,label,x,y,icon from sysmaps_hosts where shostid=".$HTTP_GET_VARS["shostid"]); + $result=DBselect("select hostid,label,x,y,icon from sysmaps_hosts where shostid=".$_GET["shostid"]); $hostid=DBget_field($result,0,0); $label=DBget_field($result,0,1); $x=DBget_field($result,0,2); @@ -238,13 +238,13 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"sysmap.php\">"; - if(isset($HTTP_GET_VARS["shostid"])) + if(isset($_GET["shostid"])) { - echo "<input name=\"shostid\" type=\"hidden\" value=".$HTTP_GET_VARS["shostid"].">"; + echo "<input name=\"shostid\" type=\"hidden\" value=".$_GET["shostid"].">"; } - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { - echo "<input name=\"sysmapid\" type=\"hidden\" value=".$HTTP_GET_VARS["sysmapid"].">"; + echo "<input name=\"sysmapid\" type=\"hidden\" value=".$_GET["sysmapid"].">"; } echo "Host"; show_table2_h_delimiter(); @@ -254,8 +254,8 @@ { $hostid_=DBget_field($result,$i,0); $host_=DBget_field($result,$i,1); - if(isset($HTTP_GET_VARS["shostid"]) && ($hostid==$hostid_)) -// if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"]==$hostid_)) + if(isset($_GET["shostid"]) && ($hostid==$hostid_)) +// if(isset($_GET["hostid"]) && ($_GET["hostid"]==$hostid_)) { echo "<OPTION VALUE='$hostid_' SELECTED>$host_"; } @@ -297,8 +297,8 @@ for($i=0;$i<DBnum_rows($result);$i++) { $name=DBget_field($result,$i,0); - if(isset($HTTP_GET_VARS["shostid"]) && ($icon==$name)) -// if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["icon"]==$icons[$i])) + if(isset($_GET["shostid"]) && ($icon==$name)) +// if(isset($_GET["hostid"]) && ($_GET["icon"]==$icons[$i])) { echo "<OPTION VALUE='".$name."' SELECTED>".$name; } @@ -326,7 +326,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["shostid"])) + if(isset($_GET["shostid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; } @@ -336,23 +336,23 @@ <?php echo "<br>"; - $result=DBselect("select shostid,label from sysmaps_hosts where sysmapid=".$HTTP_GET_VARS["sysmapid"]." order by label"); + $result=DBselect("select shostid,label from sysmaps_hosts where sysmapid=".$_GET["sysmapid"]." order by label"); if(DBnum_rows($result)>1) { show_table2_header_begin(); echo "New connector"; show_table2_v_delimiter(); - echo "<form method=\"post\" action=\"sysmap.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">"; + echo "<form method=\"post\" action=\"sysmap.php?sysmapid=".$_GET["sysmapid"]."\">"; echo nbsp("Host 1"); show_table2_h_delimiter(); -// $result=DBselect("select shostid,label from sysmaps_hosts where sysmapid=".$HTTP_GET_VARS["sysmapid"]." order by label"); +// $result=DBselect("select shostid,label from sysmaps_hosts where sysmapid=".$_GET["sysmapid"]." order by label"); echo "<select class=\"biginput\" name=\"shostid1\" size=1>"; for($i=0;$i<DBnum_rows($result);$i++) { $shostid_=DBget_field($result,$i,0); $label=DBget_field($result,$i,1); - if(isset($HTTP_GET_VARS["shostid"])&&($HTTP_GET_VARS["shostid"]==$shostid_)) + if(isset($_GET["shostid"])&&($_GET["shostid"]==$shostid_)) { echo "<OPTION VALUE='$shostid_' SELECTED>$label"; } @@ -364,7 +364,7 @@ echo "</SELECT>"; show_table2_v_delimiter(); -// echo "<form method=\"get\" action=\"sysmap.php?sysmapid=".$HTTP_GET_VARS["sysmapid"].">"; +// echo "<form method=\"get\" action=\"sysmap.php?sysmapid=".$_GET["sysmapid"].">"; echo nbsp("Host 2"); show_table2_h_delimiter(); echo "<select class=\"biginput\" name=\"shostid2\" size=1>"; diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index c3e960e5..c520630e 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -36,23 +36,23 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - $result=add_sysmap($HTTP_GET_VARS["name"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); + $result=add_sysmap($_GET["name"],$_GET["width"],$_GET["height"]); show_messages($result,"Network map added","Cannot add network map"); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - $result=update_sysmap($HTTP_GET_VARS["sysmapid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]); + $result=update_sysmap($_GET["sysmapid"],$_GET["name"],$_GET["width"],$_GET["height"]); show_messages($result,"Network map updated","Cannot update network map"); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_sysmap($HTTP_GET_VARS["sysmapid"]); + $result=delete_sysmap($_GET["sysmapid"]); show_messages($result,"Network map deleted","Cannot delete network map"); - unset($HTTP_GET_VARS["sysmapid"]); + unset($_GET["sysmapid"]); } } ?> @@ -110,9 +110,9 @@ <?php echo "<a name=\"form\"></a>"; - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { - $result=DBselect("select s.sysmapid,s.name,s.width,s.height from sysmaps s where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select s.sysmapid,s.name,s.width,s.height from sysmaps s where sysmapid=".$_GET["sysmapid"]); $name=DBget_field($result,0,1); $width=DBget_field($result,0,2); $height=DBget_field($result,0,3); @@ -130,9 +130,9 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"sysmaps.php\">"; - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { - echo "<input class=\"biginput\" name=\"sysmapid\" type=\"hidden\" value=".$HTTP_GET_VARS["sysmapid"].">"; + echo "<input class=\"biginput\" name=\"sysmapid\" type=\"hidden\" value=".$_GET["sysmapid"].">"; } echo "Name"; show_table2_h_delimiter(); @@ -150,7 +150,7 @@ show_table2_v_delimiter2(); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; - if(isset($HTTP_GET_VARS["sysmapid"])) + if(isset($_GET["sysmapid"])) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete system map?');\">"; diff --git a/frontends/php/tr_comments.php b/frontends/php/tr_comments.php index fde6d328..9acf4b52 100644 --- a/frontends/php/tr_comments.php +++ b/frontends/php/tr_comments.php @@ -26,7 +26,7 @@ show_header($page["title"],0,0); ?> <?php - if(!check_right("Trigger comment","R",$HTTP_GET_VARS["triggerid"])) + if(!check_right("Trigger comment","R",$_GET["triggerid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -40,15 +40,15 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"]) && ($HTTP_GET_VARS["register"]=="update")) + if(isset($_GET["register"]) && ($_GET["register"]=="update")) { - $result=update_trigger_comments($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["comments"]); + $result=update_trigger_comments($_GET["triggerid"],$_GET["comments"]); show_messages($result, S_COMMENT_UPDATED, S_CANNO_UPDATE_COMMENT); } ?> <?php - $result=DBselect("select comments from triggers where triggerid=".$HTTP_GET_VARS["triggerid"]); + $result=DBselect("select comments from triggers where triggerid=".$_GET["triggerid"]); $comments=stripslashes(DBget_field($result,0,0)); ?> @@ -58,7 +58,7 @@ show_table2_v_delimiter(); echo "<form method=\"get\" action=\"tr_comments.php\">"; - echo "<input name=\"triggerid\" type=\"hidden\" value=".$HTTP_GET_VARS["triggerid"].">"; + echo "<input name=\"triggerid\" type=\"hidden\" value=".$_GET["triggerid"].">"; echo S_COMMENTS; show_table2_h_delimiter(); echo "<textarea name=\"comments\" cols=100 ROWS=\"25\" wrap=\"soft\">$comments</TEXTAREA>"; diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index e28e001b..2fd2eb3c 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -28,26 +28,26 @@ $tr_hash=calc_trigger_hash(); setcookie("triggers_hash",$tr_hash,time()+1800); - if(!isset($HTTP_COOKIE_VARS["triggers_hash"])) + if(!isset($_COOKIE["triggers_hash"])) { $triggers_hash="0,0"; } else { - $triggers_hash=$HTTP_COOKIE_VARS["triggers_hash"]; + $triggers_hash=$_COOKIE["triggers_hash"]; } $new=explode(",",$tr_hash); $old=explode(",",$triggers_hash); setcookie("triggers_hash",$tr_hash,time()+1800); - if(!isset($HTTP_COOKIE_VARS["triggers_hash"])) + if(!isset($_COOKIE["triggers_hash"])) { $triggers_hash="0,0"; } else { - $triggers_hash=$HTTP_COOKIE_VARS["triggers_hash"]; + $triggers_hash=$_COOKIE["triggers_hash"]; } $new=explode(",",$tr_hash); @@ -77,11 +77,11 @@ ?> <?php $refresh=10; - if(!isset($HTTP_GET_VARS["onlytrue"])||isset($HTTP_GET_VARS["txt_select"])) + if(!isset($_GET["onlytrue"])||isset($_GET["txt_select"])) { $refresh=0; } - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { show_header($page["title"],$refresh,1); } @@ -97,7 +97,7 @@ show_footer(); exit; } - if(isset($HTTP_GET_VARS["hostid"])&&!check_right("Host","R",$HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])&&!check_right("Host","R",$_GET["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); show_footer(); @@ -114,23 +114,23 @@ <?php - if(!isset($HTTP_GET_VARS["sort"])) + if(!isset($_GET["sort"])) { $sort='priority'; } else { - $sort=$HTTP_GET_VARS["sort"]; + $sort=$_GET["sort"]; } - if(!isset($HTTP_GET_VARS["onlytrue"])) + if(!isset($_GET["onlytrue"])) { $onlytrue='false'; } else { - $onlytrue=$HTTP_GET_VARS["onlytrue"]; + $onlytrue=$_GET["onlytrue"]; } - if(isset($HTTP_GET_VARS["noactions"])&&($HTTP_GET_VARS["noactions"]!='true')) + if(isset($_GET["noactions"])&&($_GET["noactions"]!='true')) { $noactions='false'; } @@ -138,7 +138,7 @@ { $noactions='true'; } - if(isset($HTTP_GET_VARS["compact"])&&($HTTP_GET_VARS["compact"]!='true')) + if(isset($_GET["compact"])&&($_GET["compact"]!='true')) { $compact='false'; } @@ -149,25 +149,25 @@ ?> <?php - if(!isset($HTTP_GET_VARS["select"])) + if(!isset($_GET["select"])) { $select=""; } else { - $select=$HTTP_GET_VARS["select"]; + $select=$_GET["select"]; } - if(!isset($HTTP_GET_VARS["txt_select"])) + if(!isset($_GET["txt_select"])) { $txt_select=""; } else { - $txt_select=$HTTP_GET_VARS["txt_select"]; + $txt_select=$_GET["txt_select"]; } - if(isset($HTTP_GET_VARS["btnSelect"])&&($HTTP_GET_VARS["btnSelect"]=="Inverse select")) + if(isset($_GET["btnSelect"])&&($_GET["btnSelect"]=="Inverse select")) { $select_cond="not like '%$txt_select%'"; } @@ -176,14 +176,14 @@ $select_cond="like '%$txt_select%'"; } - if(!isset($HTTP_GET_VARS["fullscreen"])) + if(!isset($_GET["fullscreen"])) { show_table_header_begin(); echo S_STATUS_OF_TRIGGERS_BIG; show_table_v_delimiter(); $result=DBselect("select hostid,host from hosts where status in (0,2) order by host"); - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { echo "<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".S_ALL_SMALL."</A> "; } @@ -197,7 +197,7 @@ { continue; } - if(isset($HTTP_GET_VARS["hostid"]) && ($row["hostid"] == $HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"]) && ($row["hostid"] == $_GET["hostid"])) { echo "<b>[<A HREF=\"tr_status.php?hostid=".$row["hostid"]."&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".$row["host"]."</A>]</b> "; } @@ -211,9 +211,9 @@ ?> <?php - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - $cond="&hostid=".$HTTP_GET_VARS["hostid"]; + $cond="&hostid=".$_GET["hostid"]; } else { @@ -268,14 +268,14 @@ } $time=date("[H:i:s]",time()); - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".S_TRIGGERS_BIG." $time</A>"); $cond=""; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - $cond=" and h.hostid=".$HTTP_GET_VARS["hostid"]." "; + $cond=" and h.hostid=".$_GET["hostid"]." "; } if($onlytrue=='true') @@ -318,7 +318,7 @@ echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["fullscreen"])) + if(isset($_GET["fullscreen"])) { $fullscreen="&fullscreen=1"; } @@ -390,9 +390,9 @@ echo "<TD WIDTH=9%><B>".S_COMMENTS."</B></TD>"; echo "</TR>\n"; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - $cond=" and h.hostid=".$HTTP_GET_VARS["hostid"]." "; + $cond=" and h.hostid=".$_GET["hostid"]." "; } else { @@ -505,9 +505,9 @@ echo "<TD>"; echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">".S_SHOW_ACTIONS."</A> - "; echo "<A HREF=\"alarms.php?triggerid=".$row["triggerid"]."\">".S_HISTORY."</A> - "; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { - echo "<A HREF=\"triggers.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A>"; + echo "<A HREF=\"triggers.php?hostid=".$_GET["hostid"]."&triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A>"; } else { diff --git a/frontends/php/trend.php b/frontends/php/trend.php index 89c75eaf..fa94a141 100644 --- a/frontends/php/trend.php +++ b/frontends/php/trend.php @@ -29,27 +29,27 @@ $start_time=time(NULL); - if(!isset($HTTP_GET_VARS["type"])) + if(!isset($_GET["type"])) { - $HTTP_GET_VARS["type"]="15min"; + $_GET["type"]="15min"; } - if($HTTP_GET_VARS["type"] == "15min") + if($_GET["type"] == "15min") { $period=900; $label_format="H:i"; } - else if($HTTP_GET_VARS["type"] == "30min") + else if($_GET["type"] == "30min") { $period=1800; $label_format="H:i"; } - else if($HTTP_GET_VARS["type"] == "4hours") + else if($_GET["type"] == "4hours") { $period=4*3600; $label_format="H:i"; } - else if($HTTP_GET_VARS["type"] == "12hours") + else if($_GET["type"] == "12hours") { $period=12*3600; $label_format="H:i"; @@ -60,9 +60,9 @@ $label_format="H:i"; } - if(isset($HTTP_GET_VARS["width"])&&$HTTP_GET_VARS["width"]>0) + if(isset($_GET["width"])&&$_GET["width"]>0) { - $sizeX=$HTTP_GET_VARS["width"]; + $sizeX=$_GET["width"]; } else { @@ -102,7 +102,7 @@ ImageFilledRectangle($im,0,0,$sizeX+$shiftX+61,$sizeY+2*$shiftY+10,$white); ImageRectangle($im,0,0,$x-1,$y-1,$black); - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { ImagePng($im); ImageDestroy($im); @@ -139,7 +139,7 @@ else { for($i=0;$i<900;$i++) { - $result=DBselect("select count(value),min(value),max(value),avg(value) from history where itemid=".$HTTP_GET_VARS["itemid"]." and clock>$from_time+$i*($to_time-$from_time)/(900-50) and clock<$from_time+($i+1)*($to_time-$from_time)/(900-50)"); + $result=DBselect("select count(value),min(value),max(value),avg(value) from history where itemid=".$_GET["itemid"]." and clock>$from_time+$i*($to_time-$from_time)/(900-50) and clock<$from_time+($i+1)*($to_time-$from_time)/(900-50)"); $count[$i]=DBget_field($result,0,0); if($count[$i]>0) { @@ -186,7 +186,7 @@ else if($nodata == 0) { - if(isset($HTTP_GET_VARS["trendavg"])) + if(isset($_GET["trendavg"])) { $maxY=max($avg); $minY=min($avg); @@ -208,7 +208,7 @@ else { if($count[$i]>0) { - if(!isset($HTTP_GET_VARS["trendavg"])) + if(!isset($_GET["trendavg"])) { $x1=$sizeX*($i-$minX)/($maxX-$minX); $y1=$sizeY*($max[$i]-$minY)/($maxY-$minY); @@ -229,7 +229,7 @@ else ImageLine($im,$x1+$shiftX,$y1+$shiftY,$x2+$shiftX,$y2+$shiftY,$darkyellow); - if(!isset($HTTP_GET_VARS["trendavg"])) + if(!isset($_GET["trendavg"])) { $x1=$sizeX*($i-$minX)/($maxX-$minX); $y1=$sizeY*($min[$i]-$minY)/($maxY-$minY); @@ -253,7 +253,7 @@ else if($nodata == 0) { - $item=get_item_by_itemid($HTTP_GET_VARS["itemid"]); + $item=get_item_by_itemid($_GET["itemid"]); for($i=0;$i<=$sizeY;$i+=$sizeY/5) { ImageString($im, 1, $sizeX+5+$shiftX, $sizeY-$i-4+$shiftY, convert_units($i*($maxY-$minY)/$sizeY+$minY,$item["units"],$item["multiplier"]) , $darkred); diff --git a/frontends/php/trends.php b/frontends/php/trends.php index 614415e8..9eaea8d9 100644 --- a/frontends/php/trends.php +++ b/frontends/php/trends.php @@ -26,7 +26,7 @@ ?> <?php - if(!check_right("Item","R",$HTTP_GET_VARS["itemid"])) + if(!check_right("Item","R",$_GET["itemid"])) { show_table_header("<font color=\"AA0000\">No permissions !</font>"); show_footer(); @@ -36,68 +36,68 @@ <?php show_table_header_begin(); - $result=DBselect("select i.description,h.host,h.hostid from items i,hosts h where i.hostid=h.hostid and i.itemid=".$HTTP_GET_VARS["itemid"]); + $result=DBselect("select i.description,h.host,h.hostid from items i,hosts h where i.hostid=h.hostid and i.itemid=".$_GET["itemid"]); $description=DBget_field($result,0,0); $host=DBget_field($result,0,1); $hostid=DBget_field($result,0,2); - echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='compare.php?action=showhistory&itemid=".$HTTP_GET_VARS["itemid"]."'>$description</a>"; + echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='compare.php?action=showhistory&itemid=".$_GET["itemid"]."'>$description</a>"; show_table_v_delimiter(); - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="12hours") + if(isset($_GET["type"])&&$_GET["type"]=="12hours") { - echo "<b>[<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=12hours'>12hours</a>]</b> "; + echo "<b>[<a href='trends.php?itemid=".$_GET["itemid"]."&type=12hours'>12hours</a>]</b> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=12hours'>12hours</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=12hours'>12hours</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="4hours") + if(isset($_GET["type"])&&$_GET["type"]=="4hours") { - echo "<b>[<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=4hours'>4hours</a>]</b> "; + echo "<b>[<a href='trends.php?itemid=".$_GET["itemid"]."&type=4hours'>4hours</a>]</b> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=4hours'>4hours</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=4hours'>4hours</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="hour") + if(isset($_GET["type"])&&$_GET["type"]=="hour") { - echo "<b>[<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=hour'>hour</a>]</b> "; + echo "<b>[<a href='trends.php?itemid=".$_GET["itemid"]."&type=hour'>hour</a>]</b> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=hour'>hour</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=hour'>hour</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="30min") + if(isset($_GET["type"])&&$_GET["type"]=="30min") { - echo "<b>[<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=30min'>30min</a>]</b> "; + echo "<b>[<a href='trends.php?itemid=".$_GET["itemid"]."&type=30min'>30min</a>]</b> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=30min'>30min</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=30min'>30min</a> "; } - if(isset($HTTP_GET_VARS["type"])&&$HTTP_GET_VARS["type"]=="15min") + if(isset($_GET["type"])&&$_GET["type"]=="15min") { - echo "<b>[<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=15min'>15min</a>]</b> "; + echo "<b>[<a href='trends.php?itemid=".$_GET["itemid"]."&type=15min'>15min</a>]</b> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=15min'>15min</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=15min'>15min</a> "; } echo "</font>"; - if(isset($HTTP_GET_VARS["type"])) + if(isset($_GET["type"])) { show_table_v_delimiter(); - if(isset($HTTP_GET_VARS["trendavg"])) + if(isset($_GET["trendavg"])) { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."'>ALL</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."'>ALL</a> "; } else { - echo "<a href='trends.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1'>AVG</a> "; + echo "<a href='trends.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1'>AVG</a> "; } } @@ -106,9 +106,9 @@ ?> <?php - if(isset($HTTP_GET_VARS["itemid"])&&isset($HTTP_GET_VARS["type"])) + if(isset($_GET["itemid"])&&isset($_GET["type"])) { - show_table_header(strtoupper($HTTP_GET_VARS["type"])); + show_table_header(strtoupper($_GET["type"])); } else { @@ -118,22 +118,22 @@ echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; - if(isset($HTTP_GET_VARS["itemid"])&&isset($HTTP_GET_VARS["type"])) + if(isset($_GET["itemid"])&&isset($_GET["type"])) { - if(isset($HTTP_GET_VARS["trendavg"])) + if(isset($_GET["trendavg"])) { echo "<script language=\"JavaScript\">"; echo "if (navigator.appName == \"Microsoft Internet Explorer\")"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1&width=\"+(document.body.clientWidth-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1&width=\"+(document.body.clientWidth-108)+\"'>\")"; echo "}"; echo "else if (navigator.appName == \"Netscape\")"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1&width=\"+(document.width-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1&width=\"+(document.width-108)+\"'>\")"; echo "}"; echo "else"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&trendavg=1'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&trendavg=1'>\")"; echo "}"; echo "</script>"; } @@ -142,15 +142,15 @@ echo "<script language=\"JavaScript\">"; echo "if (navigator.appName == \"Microsoft Internet Explorer\")"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&width=\"+(document.body.clientWidth-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&width=\"+(document.body.clientWidth-108)+\"'>\")"; echo "}"; echo "else if (navigator.appName == \"Netscape\")"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."&width=\"+(document.width-108)+\"'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."&width=\"+(document.width-108)+\"'>\")"; echo "}"; echo "else"; echo "{"; - echo " document.write(\"<IMG SRC='trend.php?itemid=".$HTTP_GET_VARS["itemid"]."&type=".$HTTP_GET_VARS["type"]."'>\")"; + echo " document.write(\"<IMG SRC='trend.php?itemid=".$_GET["itemid"]."&type=".$_GET["type"]."'>\")"; echo "}"; echo "</script>"; } diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 6294e385..2c8979b7 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -40,98 +40,98 @@ <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add dependency") + if($_GET["register"]=="add dependency") { - $result=add_trigger_dependency($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["depid"]); + $result=add_trigger_dependency($_GET["triggerid"],$_GET["depid"]); show_messages($result, S_DEPENDENCY_ADDED, S_CANNOT_ADD_DEPENDENCY); } - if($HTTP_GET_VARS["register"]=="delete dependency") + if($_GET["register"]=="delete dependency") { - $result=delete_trigger_dependency($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["dependency"]); + $result=delete_trigger_dependency($_GET["triggerid"],$_GET["dependency"]); show_messages($result, S_DEPENDENCY_DELETED, S_CANNOT_DELETE_DEPENDENCY); } - if($HTTP_GET_VARS["register"]=="changestatus") + if($_GET["register"]=="changestatus") { - $result=update_trigger_status($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["status"]); + $result=update_trigger_status($_GET["triggerid"],$_GET["status"]); show_messages($result, S_STATUS_UPDATED, S_CANNOT_UPDATE_STATUS); - unset($HTTP_GET_VARS["triggerid"]); + unset($_GET["triggerid"]); } - if($HTTP_GET_VARS["register"]=="enable selected") + if($_GET["register"]=="enable selected") { - $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS[$row["triggerid"]])) + if(isset($_GET[$row["triggerid"]])) { $result2=update_trigger_status($row["triggerid"],0); } } show_messages(TRUE, S_TRIGGERS_ENABLED, S_CANNOT_UPDATE_TRIGGERS); } - if($HTTP_GET_VARS["register"]=="disable selected") + if($_GET["register"]=="disable selected") { - $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS[$row["triggerid"]])) + if(isset($_GET[$row["triggerid"]])) { $result2=update_trigger_status($row["triggerid"],1); } } show_messages(TRUE, S_TRIGGERS_DISABLED, S_CANNOT_DISABLE_TRIGGERS); } - if($HTTP_GET_VARS["register"]=="delete selected") + if($_GET["register"]=="delete selected") { - $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]); + $result=DBselect("select distinct t.triggerid from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]); while($row=DBfetch($result)) { - if(isset($HTTP_GET_VARS[$row["triggerid"]])) + if(isset($_GET[$row["triggerid"]])) { $result2=delete_trigger($row["triggerid"]); } } show_messages(TRUE, S_TRIGGERS_DELETED, S_CANNOT_DELETE_TRIGGERS); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - if(validate_expression($HTTP_GET_VARS["expression"])==0) + if(validate_expression($_GET["expression"])==0) { $now=mktime(); - if(isset($HTTP_GET_VARS["disabled"])) { $status=1; } + if(isset($_GET["disabled"])) { $status=1; } else { $status=0; } - $result=update_trigger($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["expression"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["priority"],$status,$HTTP_GET_VARS["comments"],$HTTP_GET_VARS["url"]); + $result=update_trigger($_GET["triggerid"],$_GET["expression"],$_GET["description"],$_GET["priority"],$status,$_GET["comments"],$_GET["url"]); show_messages($result, S_TRIGGER_UPDATED, S_CANNOT_UPDATE_TRIGGER); } else { show_error_message(S_INVALID_TRIGGER_EXPRESSION); } - unset($HTTP_GET_VARS["triggerid"]); + unset($_GET["triggerid"]); } - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - if(validate_expression($HTTP_GET_VARS["expression"])==0) + if(validate_expression($_GET["expression"])==0) { - if(isset($HTTP_GET_VARS["disabled"])) { $status=1; } + if(isset($_GET["disabled"])) { $status=1; } else { $status=0; } - $result=add_trigger($HTTP_GET_VARS["expression"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["priority"],$status,$HTTP_GET_VARS["comments"],$HTTP_GET_VARS["url"]); + $result=add_trigger($_GET["expression"],$_GET["description"],$_GET["priority"],$status,$_GET["comments"],$_GET["url"]); show_messages($result, S_TRIGGER_ADDED, S_CANNOT_ADD_TRIGGER); } else { show_error_message(S_INVALID_TRIGGER_EXPRESSION); } - unset($HTTP_GET_VARS["triggerid"]); + unset($_GET["triggerid"]); } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_trigger($HTTP_GET_VARS["triggerid"]); + $result=delete_trigger($_GET["triggerid"]); show_messages($result, S_TRIGGER_DELETED, S_CANNOT_DELETE_TRIGGER); - unset($HTTP_GET_VARS["triggerid"]); + unset($_GET["triggerid"]); } } ?> @@ -145,14 +145,14 @@ // Start of new code echo "<form name=\"form2\" method=\"get\" action=\"triggers.php\">"; - if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0)) + if(isset($_GET["groupid"])&&($_GET["groupid"]==0)) { - unset($HTTP_GET_VARS["groupid"]); + unset($_GET["groupid"]); } echo S_GROUP." "; echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">"; - echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL; + echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL; $result=DBselect("select groupid,name from groups order by name"); while($row=DBfetch($result)) @@ -170,7 +170,7 @@ } if($cnt!=0) { - echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; + echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"]; } } echo "</select>"; @@ -178,8 +178,8 @@ echo " ".S_HOST." "; echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; - $sql=iif(isset($HTTP_GET_VARS["groupid"]), - "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", + $sql=iif(isset($_GET["groupid"]), + "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host", "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host"); $result=DBselect($sql); @@ -189,7 +189,7 @@ { continue; } - echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; + echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"]; } echo "</select>"; @@ -201,10 +201,10 @@ <?php - if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["triggerid"])) + if(isset($_GET["hostid"])&&!isset($_GET["triggerid"])) { - $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.status,t.value,t.priority from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]." order by h.host,t.description"); + $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.status,t.value,t.priority from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]." order by h.host,t.description"); $lasthost=""; $col=0; while($row=DBfetch($result)) @@ -222,7 +222,7 @@ echo "<br>"; show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); echo "<form method=\"get\" action=\"triggers.php\">"; - echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$HTTP_GET_VARS["hostid"]." size=8>"; + echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>"; echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD WIDTH=\"8%\"><B>Id</B></TD>"; @@ -274,7 +274,7 @@ echo "</TD>"; echo "<TD>"; - if(isset($HTTP_GET_VARS["hostid"])) + if(isset($_GET["hostid"])) { echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."&hostid=".$row["hostid"]."#form\">".S_CHANGE."</A> "; } @@ -309,7 +309,7 @@ if(DBget_field($result,0,0)>0) { echo "<a name=\"form\"></a>"; - @insert_trigger_form($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["triggerid"]); + @insert_trigger_form($_GET["hostid"],$_GET["triggerid"]); } ?> diff --git a/frontends/php/users.php b/frontends/php/users.php index 035b6cc3..6dd899ea 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -39,13 +39,13 @@ ?> <?php - if(isset($HTTP_GET_VARS["register"])) + if(isset($_GET["register"])) { - if($HTTP_GET_VARS["register"]=="add") + if($_GET["register"]=="add") { - if($HTTP_GET_VARS["password1"]==$HTTP_GET_VARS["password2"]) + if($_GET["password1"]==$_GET["password2"]) { - $result=add_user($HTTP_GET_VARS["name"],$HTTP_GET_VARS["surname"],$HTTP_GET_VARS["alias"],$HTTP_GET_VARS["password1"],$HTTP_GET_VARS["url"]); + $result=add_user($_GET["name"],$_GET["surname"],$_GET["alias"],$_GET["password1"],$_GET["url"]); show_messages($result, S_USER_ADDED, S_CANNOT_ADD_USER); } else @@ -53,28 +53,28 @@ show_error_message(S_CANNOT_ADD_USER_BOTH_PASSWORDS_MUST); } } - if($HTTP_GET_VARS["register"]=="delete") + if($_GET["register"]=="delete") { - $result=delete_user($HTTP_GET_VARS["userid"]); + $result=delete_user($_GET["userid"]); show_messages($result, S_USER_DELETED, S_CANNOT_DELETE_USER); unset($userid); } - if($HTTP_GET_VARS["register"]=="delete_permission") + if($_GET["register"]=="delete_permission") { - $result=delete_permission($HTTP_GET_VARS["rightid"]); + $result=delete_permission($_GET["rightid"]); show_messages($result, S_PERMISSION_DELETED, S_CANNOT_DELETE_PERMISSION); unset($rightid); } - if($HTTP_GET_VARS["register"]=="add permission") + if($_GET["register"]=="add permission") { - $result=add_permission($HTTP_GET_VARS["userid"],$HTTP_GET_VARS["right"],$HTTP_GET_VARS["permission"],$HTTP_GET_VARS["id"]); + $result=add_permission($_GET["userid"],$_GET["right"],$_GET["permission"],$_GET["id"]); show_messages($result, S_PERMISSION_ADDED, S_CANNOT_ADD_PERMISSION); } - if($HTTP_GET_VARS["register"]=="update") + if($_GET["register"]=="update") { - if($HTTP_GET_VARS["password1"]==$HTTP_GET_VARS["password2"]) + if($_GET["password1"]==$_GET["password2"]) { - $result=update_user($HTTP_GET_VARS["userid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["surname"],$HTTP_GET_VARS["alias"],$HTTP_GET_VARS["password1"],$HTTP_GET_VARS["url"]); + $result=update_user($_GET["userid"],$_GET["name"],$_GET["surname"],$_GET["alias"],$_GET["password1"],$_GET["url"]); show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER); } else @@ -82,21 +82,21 @@ show_error_message(S_CANNOT_UPDATE_USER_BOTH_PASSWORDS); } } - if($HTTP_GET_VARS["register"]=="add group") + if($_GET["register"]=="add group") { - $result=add_user_group($HTTP_GET_VARS["name"], $HTTP_GET_VARS["users"]); + $result=add_user_group($_GET["name"], $_GET["users"]); show_messages($result, S_GROUP_ADDED, S_CANNOT_ADD_GROUP); } - if($HTTP_GET_VARS["register"]=="update group") + if($_GET["register"]=="update group") { - $result=update_user_group($HTTP_GET_VARS["usrgrpid"], $HTTP_GET_VARS["name"], $HTTP_GET_VARS["users"]); + $result=update_user_group($_GET["usrgrpid"], $_GET["name"], $_GET["users"]); show_messages($result, S_GROUP_UPDATED, S_CANNOT_UPDATE_GROUP); } - if($HTTP_GET_VARS["register"]=="delete group") + if($_GET["register"]=="delete group") { - $result=delete_user_group($HTTP_GET_VARS["usrgrpid"]); + $result=delete_user_group($_GET["usrgrpid"]); show_messages($result, S_GROUP_DELETED, S_CANNOT_DELETE_GROUP); - unset($HTTP_GET_VARS["usrgrpid"]); + unset($_GET["usrgrpid"]); } } ?> @@ -217,7 +217,7 @@ ?> <?php - if(isset($HTTP_GET_VARS["userid"])) + if(isset($_GET["userid"])) { echo "<br>"; echo "<a name=\"form\"></a>"; @@ -228,7 +228,7 @@ echo "<TD WIDTH=10% NOSAVE><B>".S_RESOURCE_NAME."</B></TD>"; echo "<TD WIDTH=10% NOSAVE><B>".S_ACTIONS."</B></TD>"; echo "</TR>"; - $result=DBselect("select rightid,name,permission,id from rights where userid=".$HTTP_GET_VARS["userid"]." order by name,permission,id"); + $result=DBselect("select rightid,name,permission,id from rights where userid=".$_GET["userid"]." order by name,permission,id"); $col=0; while($row=DBfetch($result)) { @@ -261,22 +261,22 @@ echo "<TD>".$row["permission"]."</TD>"; } echo "<TD>".get_resource_name($row["name"],$row["id"])."</TD>"; - echo "<TD><A HREF=users.php?userid=".$HTTP_GET_VARS["userid"]."&rightid=".$row["rightid"]."®ister=delete_permission>".S_DELETE."</A></TD>"; + echo "<TD><A HREF=users.php?userid=".$_GET["userid"]."&rightid=".$row["rightid"]."®ister=delete_permission>".S_DELETE."</A></TD>"; } echo "</TR>"; echo "</TABLE>"; - insert_permissions_form($HTTP_GET_VARS["userid"]); + insert_permissions_form($_GET["userid"]); } ?> <?php echo "<br>"; - @insert_usergroups_form($HTTP_GET_VARS["usrgrpid"]); + @insert_usergroups_form($_GET["usrgrpid"]); echo "<br>"; - @insert_user_form($HTTP_GET_VARS["userid"]); + @insert_user_form($_GET["userid"]); ?> <?php |