Skip to content

Commit 0f70f0b

Browse files
committed
Implement #87 (whitelist: add notes column, remove date)
1 parent f37a7be commit 0f70f0b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

helpers/db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function isIPBlocked($ipaddress)
177177

178178
public function isIPWhiteListed($ipaddress)
179179
{
180-
$sqlCheckPattern = "SELECT id, ipaddress, crdate from #__bfstop_whitelist WHERE %s";
180+
$sqlCheckPattern = "SELECT id, ipaddress from #__bfstop_whitelist WHERE %s";
181181
$sqlIPCheck = sprintf($sqlCheckPattern, $this->ipAddressMatch($ipaddress));
182182
$sqlSubNetIPv4Check = sprintf($sqlCheckPattern, $this->ipSubNetIPv4Match($ipaddress));
183183
$entryCount = $this->checkForEntries($sqlIPCheck, "Whitelisted");

sql/install.mysql.utf8.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ CREATE TABLE IF NOT EXISTS #__bfstop_failedlogin (
44
id int(10) NOT NULL auto_increment,
55
username varchar(25) NOT NULL,
66
ipaddress varchar(45) NOT NULL,
7-
error varchar(255) NOT NULL,
87
logtime datetime NOT NULL,
98
origin int NOT NULL,
109
handled BOOLEAN NOT NULL DEFAULT 0,
@@ -49,6 +48,6 @@ CREATE TABLE IF NOT EXISTS #__bfstop_unblock_token (
4948
CREATE TABLE IF NOT EXISTS #__bfstop_whitelist (
5049
id int(10) NOT NULL auto_increment,
5150
ipaddress varchar(45) NOT NULL,
52-
crdate datetime NOT NULL,
51+
notes varchar(255) NOT NULL DEFAULT '',
5352
PRIMARY KEY (id)
5453
) DEFAULT CHARSET=utf8;

sql/updates/1.4.0.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
ALTER TABLE `#__bfstop_failedlogin` DROP COLUMN error;
2+
3+
ALTER TABLE `#__bfstop_whitelist` DROP COLUMN crdate;
4+
5+
ALTER TABLE `#__bfstop_whitelist` ADD COLUMN notes varchar(255) NOT NULL DEFAULT '';

0 commit comments

Comments
 (0)