fixed SQL in checking for monthly quota - works in postgres and mysql
This commit is contained in:
parent
36754f8323
commit
28b62f357d
@ -122,6 +122,7 @@ class File extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isRespectsQuota($user,$fileSize) {
|
function isRespectsQuota($user,$fileSize) {
|
||||||
|
|
||||||
if ($fileSize > common_config('attachments', 'file_quota')) {
|
if ($fileSize > common_config('attachments', 'file_quota')) {
|
||||||
return sprintf(_('No file may be larger than %d bytes ' .
|
return sprintf(_('No file may be larger than %d bytes ' .
|
||||||
'and the file you sent was %d bytes. Try to upload a smaller version.'),
|
'and the file you sent was %d bytes. Try to upload a smaller version.'),
|
||||||
@ -135,8 +136,7 @@ class File extends Memcached_DataObject
|
|||||||
if ($total > common_config('attachments', 'user_quota')) {
|
if ($total > common_config('attachments', 'user_quota')) {
|
||||||
return sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota'));
|
return sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota'));
|
||||||
}
|
}
|
||||||
|
$query .= ' AND EXTRACT(month FROM file.modified) = EXTRACT(month FROM now()) and EXTRACT(year FROM file.modified) = EXTRACT(year FROM now())';
|
||||||
$query .= ' AND month(modified) = month(now()) and year(modified) = year(now())';
|
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
$this->fetch();
|
$this->fetch();
|
||||||
$total = $this->total + $fileSize;
|
$total = $this->total + $fileSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user