function imce_validate_quotas in IMCE 7
Same name and namespace in other branches
- 6.2 inc/imce.page.inc \imce_validate_quotas()
- 6 inc/page.inc \imce_validate_quotas()
Validate both directory and total user quota. Returns true/false not errors.
1 call to imce_validate_quotas()
- imce_resize_image in inc/
imce.page.inc - Resize an image in the file list. Also used for thumbnail creation.
File
- inc/
imce.page.inc, line 731 - Implements the file browser.
Code
function imce_validate_quotas($file, &$imce, $add = 0) {
$errors = imce_validate_quota($file, $imce['quota'], $imce['dirsize'] + $add);
if (empty($errors) && $imce['tuquota']) {
$errors = imce_validate_tuquota($file, $imce['tuquota'], file_space_used($imce['uid']) + $add);
}
if (!empty($errors)) {
drupal_set_message($errors[0], 'error');
return FALSE;
}
return TRUE;
}