Add Moodle 4.0 Support

This commit is contained in:
Hamza Tamyachte
2022-05-30 11:38:27 +02:00
parent 9d6f7e51b9
commit 84ea4a9165
3 changed files with 8 additions and 6 deletions

View File

@@ -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;
}
/**