diff options
Diffstat (limited to 'include/reddav.php')
-rw-r--r-- | include/reddav.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/reddav.php b/include/reddav.php index a6c550e2d..d00980011 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -163,6 +163,7 @@ class RedDirectory extends DAV\Node implements DAV\ICollection { intval($c[0]['channel_account_id']) ); if(($x) && ($x[0]['total'] + $size > $limit)) { + logger('reddav: service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit); attach_delete($c[0]['channel_id'],$hash); return; } @@ -321,13 +322,18 @@ class RedFile extends DAV\Node implements DAV\IFile { function put($data) { logger('RedFile::put: ' . basename($this->name), LOGGER_DEBUG); + + $c = q("select * from channel where channel_id = %d limit 1", + intval($this->auth->owner_id) + ); + $r = q("select flags, data from attach where hash = '%s' and uid = %d limit 1", dbesc($this->data['hash']), intval($c[0]['channel_id']) ); if($r) { if($r[0]['flags'] & ATTACH_FLAG_OS) { - $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] . '/' : ''); + $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] : ''); @file_put_contents($f, $data); $size = @filesize($f); logger('reddav: put() filename: ' . $f . ' size: ' . $size, LOGGER_DEBUG); @@ -367,6 +373,7 @@ class RedFile extends DAV\Node implements DAV\IFile { intval($c[0]['channel_account_id']) ); if(($x) && ($x[0]['total'] + $size > $limit)) { + logger('reddav: service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit); attach_delete($c[0]['channel_id'],$this->data['hash']); return; } |