diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-11-07 17:18:56 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-11-07 17:18:56 +0100 |
commit | 961ff01a93dd69cb12196a1b8507cce925e74fbc (patch) | |
tree | 4956c9a42d6286b0851ca73641439e5c002f6a9a /lib/fileproxy | |
parent | 4b940955ddb3266f625eae83da412a655efef319 (diff) | |
parent | 5cad2d7ccc3d2b4ccd9e1b090e28787f1c28b6ca (diff) | |
download | nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.tar.gz nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.zip |
merge master into filesystem
Diffstat (limited to 'lib/fileproxy')
-rw-r--r-- | lib/fileproxy/quota.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index cd9a2f4a192..b359b9ae023 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -38,8 +38,10 @@ class OC_FileProxy_Quota extends OC_FileProxy{ if(in_array($user, $this->userQuota)) { return $this->userQuota[$user]; } + $userQuota=OC_Preferences::getValue($user, 'files', 'quota', 'default'); $userQuota=OC_Preferences::getValue($user,'files','quota','default'); if($userQuota=='default') { + $userQuota=OC_AppConfig::getValue('files', 'default_quota', 'none'); $userQuota=OC_AppConfig::getValue('files','default_quota','none'); } if($userQuota=='none') { @@ -57,7 +59,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{ * @return int */ private function getFreeSpace($path) { - list($storage,)=\OC\Files\Filesystem::resolvePath($path); + $storage=OC_Filesystem::getStorage($path); $owner=$storage->getOwner($path); $totalSpace=$this->getQuota($owner); @@ -73,33 +75,33 @@ class OC_FileProxy_Quota extends OC_FileProxy{ return $totalSpace-$usedSpace; } - public function postFree_space($path,$space) { + public function postFree_space($path, $space) { $free=$this->getFreeSpace($path); if($free==0) { return $space; } - return min($free,$space); + return min($free, $space); } - public function preFile_put_contents($path,$data) { + public function preFile_put_contents($path, $data) { if (is_resource($data)) { $data = '';//TODO: find a way to get the length of the stream without emptying it } return (strlen($data)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } - public function preCopy($path1,$path2) { + public function preCopy($path1, $path2) { if(!self::$rootView){ self::$rootView = new \OC\Files\View(''); } return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==0); } - public function preFromTmpFile($tmpfile,$path) { + public function preFromTmpFile($tmpfile, $path) { return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } - public function preFromUploadedFile($tmpfile,$path) { + public function preFromUploadedFile($tmpfile, $path) { return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } } |