插件限制访问

User Agent

availability_useragentNicolas Dunand

  • Moodle 4.4–4.5
  • 更新 2024-11-29

This plugin provides a way to restrict access to Moodle activities and resources based on the user’s browser user agent.
This plugin provides a way to restrict access to Moodle activities and resources based on the user’s browser user agent.
Example usage to check for minimal navigator version
Use case: check and dispay a message to the user on the course page of the user is not at least on Chrome 120, Firefox 130, or Safari 18.
Create a Label containing the test “Your browser version is unsupported.” (or equivalent message).
Add a “User agent” access restriction rule with the following RegExp: ^.*(Firefox.*13d|Chrome.*12d|18..*Safari).*$
Chose the must not option instead of the must option to invert the access condition.
Click the eye icon next to the access rule to make it that the Label is not displayed when the condition is met.
The effect is that the label containing the warning is only displayed if the client browser versoin does not match the criterion.

返回插件目录