Availability restriction by IP address

Availability restriction ::: availability_ipaddress
Maintained by Luuk VerhoevenLuuk Verhoeven, Vincent Cornelis, hamza tamyachte
Moodle availability plugin which lets users restrict resources and activities with IP address
Latest release:
558 sites
146 downloads
23 fans
Current versions available: 2

Moodle - availability ip address plugin

Enhance activity security by restricting access based on IP address. This plugin allows you to control the availability of any chosen activity, making it accessible only to users from specified IP addresses.

Author

  • Author: Luuk Verhoeven, ldesignmedia.nl
  • Min. required: Moodle 4.0
  • Supports PHP: 7.4

Moodle400 Moodle401 Moodle402 Moodle403 Moodle404 Moodle405

PHP7.4 PHP8.0 PHP8.1

List of features

  • Supports comma separate list of ip-addresses
  • Subnet support, eg 192.168.1.0/24
  • Inline ip-address validation
  • Turning on/off with eye icon, without lossing the input value.

Installation

  1. Copy this plugin to the availability\condition\ipaddress folder on the server
  2. Login as administrator
  3. Go to Site Administrator > Notification
  4. Install the plugin

Usage

  1. Add or edit an activity in a Moodle course.
  2. Go to the section "Restrict access"
  3. Click IP address in the modal
  4. There's a new input field that supports a list of comma separated ip address e.g. 127.0.0.1, 192.168.1.0/24
    1. The users with matching ip addresses can view the activity.
  5. Save the activity

Security

If you discover any security related issues, please email luuk@ldesignmedia.nl instead of using the issue tracker.

License

The GNU GENERAL PUBLIC LICENSE. Please see License File for more information.

Contributing

Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on Github.

Changelog

  • 2025040400 Tested on Moodle 4.5
  • 2024072000 Tested on Moodle 4.4
  • 2022021100 Thanks for adding ip-range support @juacas
  • 2022052800 Fixed the issue 6 @hamzatamyachte
  • 2022052801 Test in Moodle 4.0 @hamzatamyachte

Screenshots

Screenshot #0

Contributors

Luuk Verhoeven
Luuk Verhoeven (Lead maintainer)
Vincent Cornelis
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Wed, 15 May 2019, 5:00 PM
    Approval issue created: CONTRIB-7721
  • Muhammad Faizan Azam
    Mon, 18 Nov 2019, 12:29 PM
    Hello there can you guide me how to install this plugin breifly. Thanks!
  • Daniel Dubbeldam
    Tue, 19 Nov 2019, 8:56 PM
    Hi muhammad,

    You can download the plugin, unzip it and place it in the /availability folder.
    After that go trough the install process on your site (login as an administrator) and install the plugin. You can then use it in your activities.
  • AMC Academic Moodle Cooperation
    Wed, 29 July 2020, 4:20 PM
    Hi,
    is there a documentation for this plugin?
    Cheers Kasia
  • Luuk Verhoeven
    Fri, 14 Aug 2020, 1:39 AM
    Hi Kasia,

    This very basic restriction plugin;

    1. Add or edit an activity in a Moodle course.
    2. Go to the section "Restrict access"
    3. Select IP address in the modal
    4. There's a new input field that supports a list of comma separated ip address e.g. 127.0.0.1, 192.168.1.0/24
    4.1 The users with matching ip addresses can view the activity.
    5. Save the activity
  • Richard Pardo
    Thu, 5 May 2022, 6:59 PM
    When do you plan to publish the version compatible with Moodle 4.0
  • stefano federici
    Fri, 27 May 2022, 9:56 PM
    This is going to be very useful. When you say "ip address e.g. 127.0.0.1, 192.168.1.0/24" do you mean that by 192.168.1.0/24 you can specify a full range from 192.168.1.0 to 192.168.1.24? Thanks in advance.
  • stefano federici
    Mon, 30 May 2022, 9:48 PM
    So, if I need to extend the visibility to four addresses starting from 134.145.0.1, I can say 134.145.0.1/2, but if I need instead only three addresses I need to list them as 134.145.0.1, 134.145.0.2, and 134.145.0.1. Is that correct?
  • hamza tamyachte
    Mon, 30 May 2022, 11:00 PM
    Hi everyone,

    For answering the question of @stefano federici and for clarify .


    "192.168.1.0/24":

    192.168.1.0 is the ip address part it can be (IPv4 or IPv6).
    24 is the number of bits in the net mask.

    2^8 = 256 possible ip adresses.

    In the case of submitting this value '192.168.1.0/24' in the input. only the users who connected by the ip addresses from
    192.168.1.0 to 192.168.1.255 can have the access to the activity.

    Example 1 : "134.145.3.1/16":

    2^16 = 65536 possible ip adresses.
    In this case only the users who had ip addresses from 134.145.0.1 to 134.145.255.255 can view the activity.

    Example 2 : "134.145.0.1/29":

    2^3 = 6 possible ip adresses.
    In this case only the users who had ip addresses from 134.145.0.1 to 134.145.0.6 can view the activity.


    Thanks.
  • Yasantha subash Samarasekara
    Mon, 17 Oct 2022, 1:08 PM
    I have a proxy server in our network. I wanted to enable quizzes only to a few computers in the network. but in Ip restrictions, it only accepts proxy addresses, not internal IP addresses. how to solve this?
  • Richard Pardo
    Tue, 6 Dec 2022, 4:47 AM
    hello
    I have questionnaires restricted by IP in many courses, my provider has changed my IP and I have to change the IP in all the courses. Is there a way to make this change in bulk?
    In which database table is the IP value stored to change it?
    Thank you
  • hamza tamyachte
    Tue, 20 Dec 2022, 8:41 PM
    Hi Richard Pardo ,

    The answer of your first question. No there is no way for now to change the ip addresses for all activity modules restriction in bulk, maybe in the future.

    And about your second question. Yes you can make the changes if you want. you can search by course id in course modules database table in the availability column.


    Best regards.
  • Bruce Markowitz
    Wed, 9 Aug 2023, 12:21 AM
    Would this plugin only restrict access to specific activities or can it be used to prevent students from logging in at all except from certain IPs?
  • Luuk Verhoeven
    Wed, 9 Aug 2023, 3:59 AM
    This plugin only restricts access to specific activities
  • Csaba Vágvölgyi
    Fri, 4 Apr 2025, 10:07 PM
    I have a suggestion for further development, although I don't know if it is possible within the availability restriction.
    Many teachers have problems using IP address ranges. This plugin (quiz access rule) offers a solution to this problem, as it is sufficient to select a location from a list and not need to know the exact IP range:
    https://moodle.org/plugins/quizaccess_ipaddresslist
    Would a similar solution be possible with this plugin? You would have to choose from a predefined list of locations/IP ranges set by the administrator and not have to enter them manually.
Please login to post comments