diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-12-14 15:15:05 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-12-14 15:15:05 +0000 |
commit | 5fe61296981343a3f877618aeecfc33ea7fed3c1 (patch) | |
tree | 919ea533c8d98f71f7c77d534eb0595207d22a17 /lib/fileproxy | |
parent | 4facd766e3712d4c714f2e1bf2ad4be41461a7cc (diff) | |
parent | f0893fb8fe7f0642ae30de2e1168472377c127e2 (diff) | |
download | nextcloud-server-5fe61296981343a3f877618aeecfc33ea7fed3c1.tar.gz nextcloud-server-5fe61296981343a3f877618aeecfc33ea7fed3c1.zip |
Merge master into ocs_api, fix conflicts.
Diffstat (limited to 'lib/fileproxy')
-rw-r--r-- | lib/fileproxy/fileoperations.php | 2 | ||||
-rw-r--r-- | lib/fileproxy/quota.php | 34 |
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php index 23fb63fcfb1..516629adaec 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/fileproxy/fileoperations.php @@ -28,7 +28,7 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{ static $rootView; public function premkdir($path) { - if(!self::$rootView){ + if(!self::$rootView) { self::$rootView = new OC_FilesystemView(''); } return !self::$rootView->file_exists($path); diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 012be582a51..742e02d471b 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -38,12 +38,12 @@ 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') { - $this->userQuota[$user]=0; + $this->userQuota[$user]=-1; }else{ $this->userQuota[$user]=OC_Helper::computerFileSize($userQuota); } @@ -61,8 +61,8 @@ class OC_FileProxy_Quota extends OC_FileProxy{ $owner=$storage->getOwner($path); $totalSpace=$this->getQuota($owner); - if($totalSpace==0) { - return 0; + if($totalSpace==-1) { + return -1; } $rootInfo=OC_FileCache::get('', "/".$owner."/files"); @@ -77,33 +77,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) { + if($free==-1) { 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); + return (strlen($data)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==-1); } - public function preCopy($path1,$path2) { - if(!self::$rootView){ + public function preCopy($path1, $path2) { + if(!self::$rootView) { self::$rootView = new OC_FilesystemView(''); } - return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==0); + return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==-1); } - public function preFromTmpFile($tmpfile,$path) { - return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); + public function preFromTmpFile($tmpfile, $path) { + return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==-1); } - public function preFromUploadedFile($tmpfile,$path) { - return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); + public function preFromUploadedFile($tmpfile, $path) { + return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==-1); } } |