aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-04-06 10:30:26 -0700
committerBrett Profitt <brett.profitt@gmail.com>2012-04-06 10:30:26 -0700
commit7a4d1861e23798e2fda7d9d3c750b8d13b55c5a8 (patch)
treeb0b4600a178115c21b73aa09b46b1595b9ed569d
parent271e824fae382c2b605d73135597a42323f691a9 (diff)
downloadelgg-7a4d1861e23798e2fda7d9d3c750b8d13b55c5a8.tar.gz
elgg-7a4d1861e23798e2fda7d9d3c750b8d13b55c5a8.tar.bz2
Started adding back quota support.
-rw-r--r--actions/photos/image/ajax_upload.php2
-rw-r--r--classes/TidypicsImage.php5
-rw-r--r--languages/en.php1
3 files changed, 7 insertions, 1 deletions
diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php
index d6b083cf6..daa824c42 100644
--- a/actions/photos/image/ajax_upload.php
+++ b/actions/photos/image/ajax_upload.php
@@ -22,7 +22,7 @@ if (empty($_FILES)) {
exit;
}
-$file = $_FILES['Image'];
+$file = $_FILES[$file_var_name];
$mime = tp_upload_get_mimetype($file['name']);
if ($mime == 'unknown') {
diff --git a/classes/TidypicsImage.php b/classes/TidypicsImage.php
index c0b5de723..dd4324468 100644
--- a/classes/TidypicsImage.php
+++ b/classes/TidypicsImage.php
@@ -244,6 +244,11 @@ class TidypicsImage extends ElggFile {
trigger_error('Tidypics warning: image memory size too large for resizing so rejecting', E_USER_WARNING);
throw new Exception(elgg_echo('tidypics:image_pixels'));
}
+
+ // make sure file fits quota
+ if (!tp_upload_check_quota($data['size'], elgg_get_logged_in_user_guid())) {
+ throw new Exception(elgg_echo('tidypics:cannot_upload_exceeds_quota'));
+ }
}
/**
diff --git a/languages/en.php b/languages/en.php
index 0d6ea2db8..b765508a6 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -274,6 +274,7 @@ The photo can be viewed here: %s",
'image:downloadfailed' => "Sorry; this image is not available.",
'tidypics:nosettings' => "Admin of this site has not set photo album settings.",
'tidypics:exceed_quota' => "You have exceeded the quota set by the administrator",
+ 'tidypics:cannot_upload_exceeds_quota' => 'Image not uploaded. File size exceeds available quota.',
'images:notedited' => "Not all images were successfully updated",
'album:none' => "No albums have been created yet.",
'album:uploadfailed' => "Sorry; we could not save your album.",