GithubHelp home page GithubHelp logo

ldesignmedia / moodle-availability_ipaddress Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 3.0 82 KB

Restrict access by ip address for activities

Home Page: https://ldesignmedia.nl

License: GNU General Public License v3.0

PHP 100.00%
luukverhoeven mfreak moodle moodle-availability moodle-plugin

moodle-availability_ipaddress's People

Contributors

hamzatamyachte avatar juacas avatar luukverhoeven avatar vincentcornelis avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mrmuehle juacas

moodle-availability_ipaddress's Issues

Restrict whole course by IP?

Hi, not really an issue but was wondering would it be possible to have something that restricted a whole course by IP?

Thanks

Hard limit on number of IP Addresses that can be entered

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

Support address ranges

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:

  • is_ip_address($address)
  • is_ipv4_range($addressrange)
  • is_ipv6_range($addressrange)

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.

ip validation

IP validation seems too permissive I was able to submit following value.
image

missing privacy api class

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.

must and must not does the same thing

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.