Skip to content

Commit 27d4e3a

Browse files
committed
2.0.2
1 parent 777c0b9 commit 27d4e3a

7 files changed

+69
-12
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.svn*
1+
.DS_Store

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
module-ip-security-check
2-
========================
1+
## IP Security Check
32

4-
The IP Security Check module.
3+
The IP Security Check module provides an additional layer of security for your Form Tools installation. When someone
4+
tries logging in, their IP address is compared against an IP whitelist or blacklist. If their IP isn't permitted
5+
access, they are redirected to a denied page. This provides an effective means to forbid unwanted access.
6+
7+
### Documentation
8+
9+
[https://docs.formtools.org/modules/ip_security_check/](https://docs.formtools.org/modules/ip_security_check/)
10+
11+
### Form Tools Extensions
12+
13+
For further information about Form Tools modules, check out:
14+
[https://modules.formtools.org](https://modules.formtools.org)

code/Module.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class Module extends FormToolsModule
1414
protected $author = "Ben Keen";
1515
protected $authorEmail = "[email protected]";
1616
protected $authorLink = "https://formtools.org";
17-
protected $version = "2.0.1";
18-
protected $date = "2017-11-07";
17+
protected $version = "2.0.2";
18+
protected $date = "2017-11-11";
1919
protected $originLanguage = "en_us";
2020
protected $jsFiles = array(
21-
"scripts/tests.js",
21+
"scripts/security_check.js",
2222
"{FTROOT}/global/scripts/sortable.js",
2323
"{MODULEROOT}/scripts/security_check.js",
2424
"{FTROOT}/global/codemirror/lib/codemirror.js",
@@ -50,7 +50,7 @@ public function install($module_id)
5050
"denied_page_content" => "<div class=\"title\">Access Denied</div>\n<p>\n Sorry, you are not permitted access to the admin area.\n</p>"
5151
));
5252

53-
Hooks::registerHook("code", "ip_security_check", "main", "FormTools\\Users::login", "checkUser", 50, true);
53+
Hooks::registerHook("code", "ip_security_check", "main", "FormTools\\User->login", "checkUser", 50, true);
5454

5555
return array(true, $L["notify_module_installed"]);
5656
}

forbidden.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use FormTools\Modules;
66

7-
$module = Modules::initModulePage("admin");
7+
$module = Modules::initModulePage();
88

99
$settings = $module->getSettings();
1010
$denied_page_content = $settings["denied_page_content"];
1111

1212
$page_vars = array(
13+
"hide_header_bar" => true,
14+
"hide_nav_menu" => true,
1315
"denied_page_content" => $denied_page_content
1416
);
1517

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
if ($(".sortable_row").length == 0) {
5858
ip_ns.add_row();
5959
}
60-
$("#add_row_link").bind("click", function() {
60+
$("#add_row_link").bind("click", function() {
6161
return ip_ns.add_row();
6262
});
6363

module_config.php

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
$STRUCTURE = array();
4+
5+
$HOOKS = array(
6+
array(
7+
"hook_type" => "code",
8+
"action_location" => "main",
9+
"function_name" => "FormTools\\User->login",
10+
"hook_function" => "checkUser",
11+
"priority" => "50"
12+
),
13+
);
14+
15+
$FILES = array(
16+
"code/",
17+
"code/index.html",
18+
"code/Module.class.php",
19+
"css/",
20+
"css/index.html",
21+
"css/styles.css",
22+
"images/",
23+
"images/icon_ip_security_check.png",
24+
"images/index.html",
25+
"lang/",
26+
"lang/en_us.php",
27+
"lang/index.html",
28+
"scripts/",
29+
"scripts/index.html",
30+
"scripts/security_check.js",
31+
"templates/",
32+
"templates/denied.tpl",
33+
"templates/forbidden.tpl",
34+
"templates/help.tpl",
35+
"templates/index.html",
36+
"templates/index.tpl",
37+
"denied.php",
38+
"forbidden.php",
39+
"help.php",
40+
"index.php",
41+
"library.php",
42+
"LICENSE",
43+
"module_config.php",
44+
"README.md"
45+
);

templates/forbidden.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{ft_include file='header.tpl'}
1+
{ft_include file='modules_header.tpl'}
22

33
{$denied_page_content}
44

5-
{ft_include file='footer.tpl'}
5+
{ft_include file='modules_footer.tpl'}

0 commit comments

Comments
 (0)