插件本地插件

Tier plugin

local_tierJob Céspedes Ortiz

  • Moodle 4.5–5.0
  • 更新 2025-06-30

Tier plugin provides a solution to control user registrations, storage quotas, and administrative access restrictions system-wide in Moodle.
By implementing this plugin, site administrators gain the ability to set maximum limits on registered users, file creations, and access to administrative pages and sections based on custom-defined values defined in  config.php . Once these values are set, the intention is for them to be enforced for all users, even those with administrative roles.
User Registration Limitations: Administrators can set a maximum number of registered users. Once the user limit is reached, new users attempting to register will be automatically restricted.  FUNCTION NOT AVAILABLE  until  MDL-78777  is integrated in moodle core.
Site Storage Cap: Tier plugin enables administrators to assign a system wide storage quota based on total files and database size. When the storage quota is reached, users will not be able to add new files, unless storage is reduced by removing files. Total storage in used is calculated every minute in a cron schedule task, avoiding hitting the database to often.
Admin Page/Section Restriction: The plugin allows restricting admin settings sections and/or pages access. This helps prevent misconfiguring performance and optimization-related admin settings.
The following example shows how to set max registered users to 100, max site storage to 5 GB (in bytes) and restrict access to debugging admin section and cache configuration and test pages. Values are set  config.php
$CFG->forced_plugin_settings = [
“local_tier” => [
“max_storage_bytes” => “5000000000”,
“max_registered_users” => “100”,
“restrictedadminsettingssections” => “debugging”,
“restrictedadminpages” => “/cache/testperformance.php,/cache/admin.php”,
],
];
You also want to prevent this plugin scheduled task modifications by setting  $CFG->preventscheduledtaskchanges = true;  in  config.php  or by setting, also in  config.php :
$CFG->scheduled_tasks = [
‘local_tier*’ => [
‘schedule’ => ‘* * * * *’,
‘disabled’ => 0,
],

返回插件目录