BFM: show_blocked_ips.sh and unblock_ip.sh (SKINS)

Version 1.4

Feature
Finished

Two new items for the brute force monitor: 1) show_blocked_ips.sh If you create it, it's output should generate a list of IPs which are blocked. The format will be 1 IP per line, but should also have an = at the end to allow for more data to be associated with the IPs in the future (eg: if we add blocked time or info, etc..) So for now, make the output like: havedata=1|0 1.2.3.4= 2.3.4.5= etc... or 1.2.3.4=dateblocked=12345678&info=he%20was%20being%20mean 2.3.4.5=dateblocked=12346789&info=definitely%20a%20meany The havedata=1 value is optional. If you include in the the output, then DA will expect dateblocked=123456 (unix timestamp) along with the IP, as well as info=. Note that either "dateblocked" or "info" can be blank. DA will ensure there is something in the variable before chewing on it. The havedata=1 value simply changes the table to show more cells, ie: the data you're giving it. 2) unblock_ip.sh Related for automated unblocking: http://www.directadmin.com/features.php?id=1376 Called by DA if it exists and will pass the environmental variable: ip=1.2.3.4 so that you can remove an IP from your block list. ----------------------------- SKINS admin/brute_force_monitor.html very top of file: |*if HAVE_SHOW_BLOCKED_IPS_SH="1"| |?BODY=onLoad="sizeTheDiv();"| |*endif| after the skip list: |*if HAVE_SHOW_BLOCKED_IPS_SH="1"| <br> <form name=tableform5 action='CMD_BRUTE_FORCE_MONITOR' method=POST> <input type=hidden name=action value="unblock"> <b>Blockd IPs</b> <div id="blockedipsdiv" style="overflow: auto; height: 450px; width: 300px; border: 1px solid grey;"> |BLOCKED_IPS| </div> |*endif| |*if HAVE_UNBLOCK_SH="1"| <table id="blockbuttontable" class=list style='width: 50%' cellpadding=3 cellspacing=1> <tr><td class=listtitle align='right' colspan='5'> <input type='submit' value='UnBlock' name=unblock></td ></tr> </table> </form> |*endif| |*if HAVE_SHOW_BLOCKED_IPS_SH="1"| <script type="text/javascript"> <!-- function sizeTheDiv() { var tblwidth=document.getElementById('blockedipstable').offsetWidth; if (tblwidth>0) { if (tblwidth < 300) { tblwidth = 300; document.getElementById('blockedipstable').style.width=tblwidth; } document.getElementById('blockedipsdiv').style.width=tblwidth+19; if (document.getElementById('blockbuttontable')) document.getElementById('blockbuttontable').style.width=tblwidth+21; } } sizeTheDiv(); // --> </script> |*endif|

Interested to try DirectAdmin? Get a 30-day Free Trial!