The Poor Man's (or Woman's) Intrusion Detection System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

115 lines
3.0 KiB

  1. <% c++ // Why isn't this done automatically?!?! %>
  2. <% c++ #include <cppcms/view.h> %>
  3. <% c++ #include "data.h" %>
  4. <% skin mainskin %>
  5. <% view domain_list uses ::DomainList %>
  6. <% template title() %><%= filter %> Domain List<% end %>
  7. <% template menu() %>
  8. <b>Filters: </b>
  9. <a href="<% url "" %>">To Be Decided</a> |
  10. <a href="<% url "accepted" %>">Accepted</a> |
  11. <a href="<% url "blocked" %>">Blocks</a>
  12. <% end template %>
  13. <% template pager(int no, int ct) %>
  14. <% if (ct>1) %><div class="pager">
  15. <% if (no>1) %>
  16. <a href="?pg=1">|<</a>
  17. <a href="?pg=<% c++ out() << no-1; %>"><<</a>
  18. <% end if %>
  19. <%= no %> of <%= ct %>
  20. <% if (no<ct) %>
  21. <a href="?pg=<% c++ out() << no+1; %>">>></a>
  22. <a href="?pg=<%= ct %>">>|</a>
  23. <% end if %>
  24. </div><% end if %>
  25. <% end template %>
  26. <% template render() %>
  27. <html><head>
  28. <title><% include title() %></title>
  29. <style>
  30. h1 { text-align: center; }
  31. table {
  32. margin-top: 1em;
  33. border-bottom: 2px solid black;
  34. }
  35. table th {
  36. border-top: 2px solid black;
  37. border-bottom: 2px solid black;
  38. }
  39. div.menu {
  40. border-top: 2px solid black;
  41. border-bottom: 2px solid black;
  42. padding: 0.25em;
  43. }
  44. div.pager {
  45. font-weight: bold;
  46. }
  47. </style>
  48. </head><body>
  49. <div class="menu"><% include menu() %></div>
  50. <h1><% include title() %></h1>
  51. <div id="content">
  52. <% foreach domain rowid r from 1 in list %>
  53. <% include pager(page, pages) %>
  54. <% if not empty error %>
  55. <p style="color: red"><i><b><%= error %></b></i></p>
  56. <% end %>
  57. <form method="POST">
  58. Whole Domain: <input name="domain" size=50>
  59. <p><i><b>NOTE:</b> the root domain name listed here will match any records in
  60. this list with the same suffix and record the decision as chosen below.
  61. <% if ( content.filter == "undecided" ) %>
  62. Whole domains can be blocked by prefixing them with "*.". This means that
  63. even if the exact host name or subdomain is not listed here it will get
  64. blocked.
  65. <% end %>
  66. <table>
  67. <tr><th><select name="op" value="0">
  68. <option value="0">Undecided</option>
  69. <option value="1">Accept</option>
  70. <option value="2">Block</option>
  71. </select>
  72. <input type="submit" value=">">
  73. </th>
  74. <th>Domain</th>
  75. <th>When Decided</th>
  76. </tr>
  77. <% item %>
  78. <tr>
  79. <td>
  80. <span style="float: left"><% c++ out() << r+content.page_size*(content.page-1); %>.</span>
  81. <center><input type=checkbox name="id" value="<%= domain.name %>"></center>
  82. </td>
  83. <td><%= domain.name %></td>
  84. <td><%= domain.decided %></td>
  85. </tr>
  86. <% end item %>
  87. <tr><td colspan="3">of <%= count %></td></tr>
  88. </table></form>
  89. <% include pager(page, pages) %>
  90. <% empty %>
  91. <h2>Nothing available</h2>
  92. <% end %>
  93. </div>
  94. </body></html>
  95. <% end template %>
  96. <% end view %>
  97. <% end skin %>