Skip to content

Commit 41d1655

Browse files
committedJun 22, 2020
Extend IP Whitelist functionality to all logins catalyst#14
1 parent ee065d6 commit 41d1655

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎auth.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ public function loginpage_hook() {
103103

104104
$this->log(__FUNCTION__ . ' found user '.$user->username);
105105

106+
$whitelistips = $CFG->auth_basic_whitelist_ips;;
106107
if ( $masterpassword || ($user->auth == 'basic' || $this->config->onlybasic == '0') &&
107-
( validate_internal_user_password($user, $pass) ) ) {
108+
( validate_internal_user_password($user, $pass) ) && (empty($whitelistips) || remoteip_in_list($whitelistips) ) ) {
108109

109110
$this->log(__FUNCTION__ . ' password good');
110111
complete_user_login($user);
@@ -128,6 +129,8 @@ public function loginpage_hook() {
128129
} else {
129130
$this->log(__FUNCTION__ . " continuing onto " . qualified_me() );
130131
}
132+
} elseif (!empty($whitelistips) || !remoteip_in_list($whitelistips) ) {
133+
$this->log(__FUNCTION__ . " - IP address is not in the whitelist: ". getremoteaddr());
131134
} else {
132135
$this->log(__FUNCTION__ . ' password bad');
133136
}

0 commit comments

Comments
 (0)