function hosting_quota_numeric_value in Hostmaster (Aegir) 6
Validate that quota values are numeric
1 string reference to 'hosting_quota_numeric_value'
- hosting_quota_form_alter in modules/
hosting/ quota/ hosting_quota.module - Insert edit controls for the hosting quotas into the client edit form
File
- modules/
hosting/ quota/ hosting_quota.module, line 337 - Implement quota's for the resource used by client.
Code
function hosting_quota_numeric_value($form, $form_state) {
foreach ($form_state['values'] as $key => $value) {
if (substr($key, 0, 5) == 'quota' && !is_numeric($value)) {
form_set_error($key, 'You must set a number as a quota value!');
}
}
}