Details
Description
An option needs to be added to the core for the add/edit module group pages that are generated for modules.
A checkbox should appear under the Add Order option for module groups called "Force *** Limits" where *** is the module row noun (e.g. "Server" from Module::moduleRowName)
This checkbox is to be used by modules at their sole discretion to determine whether to treat any limits as hard limits or soft limits. A hard limit cannot be exceeded at all, while a soft limit can be exceeded if there is no other choice.
Consider the cPanel module and it's "First non-full server" Add Order. The module will attempt to add the account to a server with free space according to its account limit setting, but if all servers are full, it will choose one of the servers to add the account onto, thus exceeding it's own account limit. This is the soft limit.
A hard limit would fail to add the account altogether if all servers in the group have reached their account limits, as no module will be retrieved to add it to via Module::selectModuleRow and an error will be returned during creation.
Limits only apply when the package uses a specific module row group, rather than choosing a specific module row.
Update the table:
`module_groups`, add column `force_limits` tinyint(1) unsigned, (0 or 1)
Files to update:
/app/controllers/admin_company_modules.php
- AddGroup
- EditGroup
/app/models/module_manager.php
- AddGroup
- EditGroup
- getGroup
- getGroups
/app/views/admin/default/admin_company_modules_addgroup.pdt
/app/views/admin/default/admin_company_modules_editgroup.pdt
Issue Links
- relates to
-
CORE-2139 cPanel: Add server group add order to evenly distribute accounts
- Closed
-
CORE-2140 DirectAdmin: Add server group add order to evenly distribute account
- Closed
-
CORE-2141 Interworx: Add server group add order to evenly distribute accounts
- Closed
-
CORE-2199 Module group add order for round robin should consider the limit
- Closed