function hosting_quota_admin_defaults_form_submit in Hosting 7.3
Same name and namespace in other branches
- 6.2 quota/hosting_quota.admin.inc \hosting_quota_admin_defaults_form_submit()
- 7.4 quota/hosting_quota.admin.inc \hosting_quota_admin_defaults_form_submit()
Submit function for hosting_quota_admin_defaults_form
File
- quota/
hosting_quota.admin.inc, line 83 - hosting_quota.admin.inc Admin forms for the quota module.
Code
function hosting_quota_admin_defaults_form_submit($form, &$form_state) {
foreach ($form_state['values']['quota'] as $resource => $quota) {
// Set the default quota
variable_set("hosting_quota_default_{$resource}", $quota);
// Set quotas for clients that don't already have them
$client_result = db_query('SELECT nid FROM {hosting_client} WHERE nid not in (SELECT client FROM {hosting_client_quota})');
while ($row = $client_result
->fetch()) {
hosting_quota_set_limit($row->nid, $resource, $quota);
}
}
}