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.
 
 
 
 

105 lines
2.5 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. <form method="POST">
  55. Whole Domain: <input name="domain" size=50>
  56. <table>
  57. <tr><th><select name="op" value="0">
  58. <option value="0">Undecided</option>
  59. <option value="1">Accept</option>
  60. <option value="2">Block</option>
  61. </select>
  62. <input type="submit" value=">">
  63. </th>
  64. <th>Domain</th>
  65. <th>When Decided</th>
  66. </tr>
  67. <% item %>
  68. <tr>
  69. <td>
  70. <span style="float: left"><% c++ out() << r+content.page_size*(content.page-1); %>.</span>
  71. <center><input type=checkbox name="id" value="<%= domain.name %>"></center>
  72. </td>
  73. <td><%= domain.name %></td>
  74. <td><%= domain.decided %></td>
  75. </tr>
  76. <% end item %>
  77. <tr><td colspan="3">of <%= count %></td></tr>
  78. </table></form>
  79. <% include pager(page, pages) %>
  80. <% empty %>
  81. <h2>Nothing available</h2>
  82. <% end %>
  83. </div>
  84. </body></html>
  85. <% end template %>
  86. <% end view %>
  87. <% end skin %>