added: IP ban mechanism (not finished yet -- we need a winix function to remove a ban)

now after some incorrent login attempts your IP can be banned or blocked
       (see new config variables)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@902 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-10-27 07:44:26 +00:00
parent 53b4175d00
commit 099dd55d0c
54 changed files with 2691 additions and 1266 deletions

42
html/fun_ipban.html Normal file
View File

@@ -0,0 +1,42 @@
<div class="winix">
<h1>IP Banned</h1>
[if ipban_tab]
<table>
<tr>
<th>Id</th>
<th>IP address</th>
<th>login failures</th>
<th>Login allowed</th>
<th>Ban level</th>
<th>Active flag</th>
<th>Last used</th>
<th>Expires</th>
<th>Remove</th>
</tr>
[for ipban_tab]
<tr>
<td>[ipban_tab_id]</td>
<td>[ipban_tab_ip]</td>
<td>[ipban_tab_incorrect_login]</td>
<td>[if ipban_tab_is_logging_allowed]yes[else]no[end]</td>
<td>[ipban_tab_ban_level]</td>
<td>[if ipban_tab_has_active_flag]yes[end]</td>
<td>[ipban_tab_last_used]</td>
<td>[ipban_tab_expires]</td>
<td><a href="[doc_base_url][dir][if item_is][item_url]/[end]ipban/removeip:[ipban_tab_ip]">remove</a></td>
</tr>
[end]
</table>
[else]
<p>There are not any IP addresses banned at the moment.</p>
[end]
</div>

View File

@@ -6,29 +6,45 @@
<p>{logged_as_long}: [user_name]<br>
<a href="[doc_base_url][if-one dir_can_read_exec][dir][if-any item_is item_can_read][item_url]/[end][else]/[end]logout">{logout}</a></p>
[else]
<form method="post" action="[login_path]login">
<div class="winix_input_b">
<input class="winix_editshort" type="text" name="login">
</div>
[if login_cannot_login]
<p>{login_cannot_login_from_this_ip}<br>
{login_cannot_login_available} [login_when_available_login]</p>
[else]
<div class="winix_input_b">
<input class="editshort" type="password" name="password">
</div>
<form method="post" action="[login_path]login">
<div class="winix_input_b">
<input id="winix_login_rememberme_id" type="checkbox" name="rememberme">
<label for="winix_login_rememberme_id">{remember_me}</label>
</div>
<div class="winix_input_b">
<input type="text" name="login">
</div>
<input type="submit" value="{button_login}">
<div class="winix_input_b">
<input type="password" name="password">
</div>
<div class="winix_input_b">
<input id="winix_login_rememberme_id" type="checkbox" name="rememberme">
<label for="winix_login_rememberme_id">{remember_me}</label>
</div>
[if login_should_use_captcha]
<div class="winix_input_a">
<label for="winix_rebus_id">{rebus_how_is_it} [rebus_question]?</label>
<input id="winix_rebus_id" type="text" name="rebus">
</div>
[end]
<input type="submit" value="{button_login}">
[if winix_function_param_is "postredirect"]
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
[end]
</form>
[if winix_function_param_is "postredirect"]
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
[end]
</form>
[end]