function imce_validate_quotas in IMCE 6
Same name and namespace in other branches
- 6.2 inc/imce.page.inc \imce_validate_quotas()
- 7 inc/imce.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/
page.inc - Resize an image in the file list. Also used for thumbnail creation.
File
- inc/
page.inc, line 613
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_quota($file, $imce['tuquota'], file_space_used($imce['uid']) + $add, 1);
}
if (!empty($errors)) {
drupal_set_message($errors[0], 'error');
return FALSE;
}
return TRUE;
}