ldesignmedia / moodle-availability_ipaddress Goto Github PK
View Code? Open in Web Editor NEWRestrict access by ip address for activities
Home Page: https://ldesignmedia.nl
License: GNU General Public License v3.0
Restrict access by ip address for activities
Home Page: https://ldesignmedia.nl
License: GNU General Public License v3.0
Hi, not really an issue but was wondering would it be possible to have something that restricted a whole course by IP?
Thanks
Good day,
The database field used by this plugin to store ip addresses is character varying(255).
This places a hard limit on the number of addresses that can be provided.
Full enumeration is useful, as subnets can include hosts that you don't intend for test use.
By the way I am happy to look into this issue and resolve it, but will need a little time.
Liam
The plugin uses address_in_subnet function for checking the ips. However the validation does not accept an IP range (x.x.x.x-y) which is very useful for controlling the access for small-medium classrooms.
Moodle provides the library /lib/classes/ip_utils.php that offers the following convenient functions for checking addresses:
Please excuse me for not contributing with a tested pull request, but I'm currently without a dev environment for some time.
I propose that the function is_valid_ipaddresses() be implemented as:
public static function is_valid_ipaddresses($ipaddresses) : bool {
$ipaddresses = implode(',', $ipaddresses);
foreach ($ipaddresses as $ipaddress) {
if ( is_ip_address($ipaddress) === false &&
is_ipv4_range($ipaddress) === false &&
is_ipv6_range($ipaddress) === false ) {
return false;
}
}
return true;
}
I hope this will help making this plugin more useful.
Greetings.
Moodle now implements a new privacy api - it would be nice if you could implement this in your plugin.
Sites that use continuous integration processes will not be able to use your plugin as Moodle now includes unit tests to check that all installed plugins contain appropriate privacy classes.
more information on the privacy api is here:
https://docs.moodle.org/dev/Privacy_API
please note - this is not a blocker for approval in the plugins db but would be nice to add at some point.
When you select the condition to restrict to ip's that differs from a specific one, it doesn't work. Its only behaviour is to SHOW the content to the select ip/ip range.
All my external connections to moodle come from the firewall IP, i need to block this specific IP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.