Browse files

Remaining attempt interval fix, improve default val, version -> 0.9.9

  • Loading branch information...
1 parent 1904234 commit 26afb6226b4f2477c709759e16addc819373194b @codeling committed Apr 5, 2013
Showing with 21 additions and 8 deletions.
  1. +7 −0 CHANGELOG
  2. +8 −2 bfstop.php
  3. +3 −3 bfstop.xml
  4. +1 −1 deploy.sh
  5. +2 −2 language/en-GB/en-GB.plg_system_bfstop.sys.ini
View
7 CHANGELOG
@@ -1,3 +1,10 @@
+0.9.9 (2013-04-05)
+ - adds a configurable "automatic unblock time", i.e. a time after which an IP
+ address will be automatically allowed to do further login attempts.
+ this replaces the previous "block interval"
+ - implements optional notification about the number of remaining login
+ attempts before the IP address will be blocked
+
0.9.8 (2013-01-23)
- corrects small problems with logging which prevented previous versions
to be installable on Joomla! 3.0. This should now be possible. In case you
View
10 bfstop.php
@@ -170,9 +170,14 @@ function block($logEntry, $interval)
}
}
+ function getBlockInterval()
+ {
+ return min( 1440, (int) $this->params->get('blockDuration'));
+ }
+
function blockIfTooManyAttempts($logEntry)
{
- $interval = min( 1440, (int) $this->params->get('blockDuration'));
+ $interval = $this->getBlockInterval();
$maxNumber = (int)$this->params->get('blockNumber');
// -1 to block for the blockNumber'th time already
if (!$this->moreThanGivenEvents($interval, $maxNumber-1, $logEntry->logtime,
@@ -282,7 +287,8 @@ public function onUserLoginFailure($user, $options=null)
{
$attemptsLeft = (int)$this->params->get('blockNumber')
- $this->getNumberOfFailedLogins(
- $interval, $logEntry->ipaddress, $logEntry->logtime);
+ $this->getBlockInterval(),
+ $logEntry->ipaddress, $logEntry->logtime);
$application = JFactory::getApplication();
$application->enqueueMessage(JText::sprintf("X_ATTEMPTS_LEFT", $attemptsLeft));
}
View
6 bfstop.xml
@@ -9,7 +9,7 @@
<homepage>https://github.com/codeling/bfstop</homepage>
<authorEmail>bfstop@bfroehler.info</authorEmail>
<authorUrl>https://github.com/codeling/bfstop</authorUrl>
- <version>0.9.8</version>
+ <version>0.9.9</version>
<files>
<filename plugin="bfstop">bfstop.php</filename>
<filename>index.html</filename>
@@ -72,7 +72,7 @@
</field>
<field name="blockedMessage" type="text" size="40" default="" label="BLOCKEDMESSAGELABEL" description="BLOCKEDMESSAGEDESC" />
<field name="delayDuration" type="integer" default="0" first="0" last="60" step="5" label="DELAYDURATIONLABEL" description="DELAYDURATIONDESC" />
- <field name="notifyBlockedNumber" type="list" default="-1" label="NOTIFYBLOCKEDNUMBERLABEL" description="NOTIFYBLOCKEDNUMBERDESC">
+ <field name="notifyBlockedNumber" type="list" default="5" label="NOTIFYBLOCKEDNUMBERLABEL" description="NOTIFYBLOCKEDNUMBERDESC">
<option value="-1">NOTIFY_UNLIMITED</option>
<option value="0">NOTIFY_NEVER</option>
<option value="1">1</option>
@@ -81,7 +81,7 @@
<option value="4">4</option>
<option value="5">5</option>
</field>
- <field name="notifyFailedNumber" type="list" default="1" label="NOTIFYFAILEDNUMBERLABEL" description="NOTIFYFAILEDNUMBERDESC">
+ <field name="notifyFailedNumber" type="list" default="0" label="NOTIFYFAILEDNUMBERLABEL" description="NOTIFYFAILEDNUMBERDESC">
<option value="-1">NOTIFY_UNLIMITED</option>
<option value="0">NOTIFY_NEVER</option>
<option value="1">1</option>
View
2 deploy.sh
@@ -15,7 +15,7 @@ langfiles="language"
docs="CHANGELOG LICENSE.txt README"
plgtype="system"
langs="de-DE en-GB"
-version=0.9.8
+version=0.9.9
if [ "$1" == "zip" ]
then
View
4 language/en-GB/en-GB.plg_system_bfstop.sys.ini
@@ -10,9 +10,9 @@ SELECTUSERLABEL="Select a User"
SELECTUSERSDESC="Select the user you would like to have notifications to be sent."
ENTEREMAILLABEL="Email Address"
ENTEREMAILDESC="Enter the Email Address where you would like to have notifications to be sent."
-NOTIFYFAILEDNUMBERLABEL="Max. # of failed msgs per day"
+NOTIFYFAILEDNUMBERLABEL="Failed msgs per day"
NOTIFYFAILEDNUMBERDESC="How often to notify about a failed login during one day"
-NOTIFYBLOCKEDNUMBERLABEL="Max. # of blocked msgs per day"
+NOTIFYBLOCKEDNUMBERLABEL="Blocked msgs per day"
NOTIFYBLOCKEDNUMBERDESC="How often to notify about a blocked IP during one day"
DELAYDURATIONLABEL="Delay"
DELAYDURATIONDESC="Delay (in seconds) on a failed login attempt"

0 comments on commit 26afb62

Please sign in to comment.