protected function elFinderVolumeDrupal::CalculateUserAllowedSpace in elFinder file manager 6.2
Same name and namespace in other branches
- 8.2 src/Controller/elFinderVolumeDrupal.php \elFinderVolumeDrupal::CalculateUserAllowedSpace()
- 7.3 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::CalculateUserAllowedSpace()
- 7.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::CalculateUserAllowedSpace()
1 call to elFinderVolumeDrupal::CalculateUserAllowedSpace()
File
- inc/
elfinder.drupalfs.driver.inc, line 475
Class
- elFinderVolumeDrupal
- elFinder driver for Drupal 6 filesystem.
Code
protected function CalculateUserAllowedSpace($checkuser = NULL) {
global $user;
$realUser = isset($checkuser) ? $checkuser : $user;
$currentSpace = $this
->CalculateUserUsedSpace($realUser);
$maxSpace = isset($this->options['userProfile']->settings['user_quota']) ? parse_size($this->options['userProfile']->settings['user_quota']) : NULL;
$diff = $maxSpace - $currentSpace;
//drupal_set_message('current space = '.$currentSpace.' max = ' . $maxSpace . ' diff = ' . $diff,'warning');
if (isset($maxSpace) && $maxSpace > 0) {
if ($diff > 0) {
return $diff;
}
else {
return 0;
}
}
return -1;
}