editfilter.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
  3. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
  4. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
  5. if (isset($_POST["editfilter"])) {
  6. $new['name'] = $_POST["f_name"];
  7. $new['dst'] = $_POST["f_dst"];
  8. $new['proto'] = $_POST["f_proto"];
  9. $new['dstport'] = str_replace(':', '-', $_POST["f_dstport"]);
  10. $new['srcport'] = str_replace(':', '-', $_POST["f_srcport"]);
  11. $new['comment'] = $_POST["f_comment"];
  12. update_record($db_link, "Filter_list", "id='$id'", $new);
  13. unset($_POST);
  14. header("Location: " . $_SERVER["REQUEST_URI"]);
  15. exit;
  16. }
  17. unset($_POST);
  18. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
  19. $filter = get_record($db_link, 'Filter_list','id='.$id);
  20. print_filters_submenu($page_url);
  21. print "<div id=cont>";
  22. print "<br> <b>".WEB_title_filter."</b> <br>";
  23. print "<form name=def action='editfilter.php?id=".$id."' method=post>";
  24. print "<input type=hidden name=id value=$id>";
  25. if (isset($filter['type']) and $filter['type'] == 0) {
  26. print "<table class=\"data\" cellspacing=\"0\" cellpadding=\"4\">";
  27. print "<tr><td><b>".WEB_cell_forename."</b></td>";
  28. print "<td colspan=2><b>".WEB_cell_comment."</b></td>";
  29. print "</tr>";
  30. print "<tr>";
  31. print "<td align=left><input type=text name=f_name value='".$filter['name']."'></td>";
  32. print "<td colspan=2><input type=text name=f_comment value='".$filter['comment']."'></td>";
  33. print "<td><input type=submit name=editfilter value='".WEB_btn_save."'></td>";
  34. print "</tr>";
  35. print "<tr>";
  36. print "<td ><b>".WEB_traffic_proto."</b></td>";
  37. print "<td ><b>".WEB_traffic_dest_address."</b></td>";
  38. print "<td ><b>".WEB_traffic_dst_port."</b></td>";
  39. print "<td ><b>".WEB_traffic_src_port."</b></td>";
  40. print "</tr>";
  41. print "<tr>";
  42. print "<td ><input type=text name=f_proto value='".$filter['proto']."'></td>";
  43. print "<td ><input type=text name=f_dst value='".$filter['dst']."'></td>";
  44. print "<td ><input type=text name=f_dstport value='".$filter['dstport']."'></td>";
  45. print "<td ><input type=text name=f_srcport value='".$filter['srcport']."'></td>";
  46. print "</tr>";
  47. print "</table>";
  48. } else {
  49. print "<table class=\"data\" cellspacing=\"0\" cellpadding=\"4\">";
  50. print "<tr><td><b>".WEB_cell_forename."</b></td>";
  51. print "<td><b>".WEB_cell_comment."</b></td>";
  52. print "<td><input type=submit name=editfilter value=".WEB_btn_save."></td>";
  53. print "</tr>";
  54. print "<tr>";
  55. print "<td align=left><input type=text name=f_name value='".$filter['name']."'></td>";
  56. print "<td ><input type=text name=f_comment value='".$filter['comment']."'></td>";
  57. print "<td ><input type=text name=f_dst value='".$filter['dst']."'></td>";
  58. print "</tr>";
  59. print "</table>";
  60. }
  61. print "</form>";
  62. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");