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:
446 sites
88 downloads
21 fans
Current versions available: 1

Moodle - availability IP address plugin

Restrict access to any activity by IP-address. This plugin can be used to make any chosen activity unavailable based on the user's IP.

Author

MFreak.nl

  • Author: Luuk Verhoeven
  • Min. required: Moodle 3.5.x

Build Status Moodle35Moodle36Moodle37Moodle38Moodle39Moodle310Moodle40PHP7.2PHP7.3

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@MFreak.nl instead of using the issue tracker.

Contributing

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

Changelog

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 Jul 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
Please login to post comments