".S_NO_PERMISSIONS."");
show_footer();
exit;
}
?>
[Success for '$hosts_ok']
[Failed for '$hosts_notok'","Cannot add item");
unset($_REQUEST["itemid"]);
}
else if($_REQUEST["register"]=="delete")
{
delete_item_from_templates($_REQUEST["itemid"]);
$result=delete_item($_REQUEST["itemid"]);
show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM);
unset($_REQUEST["itemid"]);
}
else if($_REQUEST["register"]=="Delete selected")
{
$result=DBselect("select itemid from items where hostid=".$_REQUEST["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_REQUEST[$row["itemid"]]))
{
delete_item_from_templates($row["itemid"]);
$result2=delete_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_DELETED, S_CANNOT_DELETE_ITEMS);
}
else if($_REQUEST["register"]=="Activate selected")
{
$result=DBselect("select itemid from items where hostid=".$_REQUEST["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_REQUEST[$row["itemid"]]))
{
$result2=activate_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_ACTIVATED, S_CANNOT_ACTIVATE_ITEMS);
}
if($_REQUEST["register"]=="Disable selected")
{
$result=DBselect("select itemid from items where hostid=".$_REQUEST["hostid"]);
while($row=DBfetch($result))
{
// $$ is correct here
if(isset($_REQUEST[$row["itemid"]]))
{
$result2=disable_item($row["itemid"]);
}
}
show_messages(TRUE, S_ITEMS_DISABLED, S_CANNOT_DISABLE_ITEMS);
}
}
?>
";
$h2=$h2.form_select("groupid",0,S_ALL_SMALL);
$result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
$result2=DBselect("select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid and h.status<>".HOST_STATUS_DELETED." group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
if(!check_right("Host","U",$row2["hostid"]))
{
continue;
}
$cnt=1; break;
}
if($cnt!=0)
{
$h2=$h2.form_select("groupid",$row["groupid"],$row["name"]);
}
}
$h2=$h2."";
$h2=$h2." ".S_HOST." ";
$h2=$h2."";
$h2=$h2." | ";
$h2=$h2."";
show_header2($h1, $h2, "