Skip to content

Commit

Permalink
Extend IP Whitelist functionality to all logins catalyst#14
Browse files Browse the repository at this point in the history
  • Loading branch information
aspark21 committed Jun 22, 2020
1 parent ee065d6 commit 41d1655
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ public function loginpage_hook() {

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

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

$this->log(__FUNCTION__ . ' password good');
complete_user_login($user);
Expand All @@ -128,6 +129,8 @@ public function loginpage_hook() {
} else {
$this->log(__FUNCTION__ . " continuing onto " . qualified_me() );
}
} elseif (!empty($whitelistips) || !remoteip_in_list($whitelistips) ) {
$this->log(__FUNCTION__ . " - IP address is not in the whitelist: ". getremoteaddr());
} else {
$this->log(__FUNCTION__ . ' password bad');
}
Expand Down

0 comments on commit 41d1655

Please sign in to comment.