mirror of
https://github.com/LdesignMedia/moodle-availability_ipaddress.git
synced 2026-10-22 11:08:07 +02:00
Add Moodle 4.0 Support
This commit is contained in:
1 parent
9d6f7e51b9
commit
84ea4a9165
3 files changed
+8
-6
No files matched your search
@@ -82,15 +82,15 @@ class condition extends \core_availability\condition {
|
||||
public function is_available($not, info $info, $grabthelot, $userid) : bool {
|
||||
|
||||
if (empty($this->ipaddresses)) {
|
||||
return true;
|
||||
return !$not;
|
||||
}
|
||||
|
||||
// Check if ip-address matches.
|
||||
if (address_in_subnet(getremoteaddr(), trim($this->ipaddresses))) {
|
||||
return true;
|
||||
return !$not;
|
||||
}
|
||||
|
||||
return false;
|
||||
return $not;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user