protected function elFinderVolumeDrupal::CalculateUserAllowedSpace in elFinder file manager 7.3
Same name and namespace in other branches
- 8.2 src/Controller/elFinderVolumeDrupal.php \elFinderVolumeDrupal::CalculateUserAllowedSpace()
- 6.2 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 484 - elFinder driver for Drupal filesystem.
Class
- elFinderVolumeDrupal
- @file
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;
if (isset($maxSpace) && $maxSpace > 0) {
if ($diff > 0) {
return $diff;
}
else {
return 0;
}
}
return -1;
}