Merge commit 'br3nda/0.8.x-attachmentfix' into 0.8.x

This commit is contained in:
Craig Andrews 2009-07-22 10:24:34 -04:00
commit 684fc5d002
2 changed files with 5 additions and 4 deletions

View File

@ -122,6 +122,7 @@ class File extends Memcached_DataObject
}
function isRespectsQuota($user,$fileSize) {
if ($fileSize > common_config('attachments', 'file_quota')) {
return sprintf(_('No file may be larger than %d bytes ' .
'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')) {
return sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota'));
}
$query .= ' month(modified) = month(now()) and year(modified) = year(now())';
$query .= ' AND EXTRACT(month FROM file.modified) = EXTRACT(month FROM now()) and EXTRACT(year FROM file.modified) = EXTRACT(year FROM now())';
$this->query($query);
$this->fetch();
$total = $this->total + $fileSize;

View File

@ -441,7 +441,6 @@ create table group_inbox (
group_id integer not null /* comment 'group receiving the message' references user_group (id) */,
notice_id integer not null /* comment 'notice received' references notice (id) */,
created timestamp not null default CURRENT_TIMESTAMP /* comment 'date the notice was created' */,
primary key (group_id, notice_id)
);
create index group_inbox_created_idx on group_inbox using btree(created);
@ -456,7 +455,9 @@ create table file (
size integer,
title varchar(255),
date integer,
protected integer
protected integer,
filename text /* comment 'if a local file, name of the file' */,
modified timestamp default CURRENT_TIMESTAMP /* comment 'date this record was modified'*/
);
create sequence file_oembed_seq;