]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Started adding back quota support.
authorBrett Profitt <brett.profitt@gmail.com>
Fri, 6 Apr 2012 17:30:26 +0000 (10:30 -0700)
committerBrett Profitt <brett.profitt@gmail.com>
Fri, 6 Apr 2012 17:30:26 +0000 (10:30 -0700)
actions/photos/image/ajax_upload.php
classes/TidypicsImage.php
languages/en.php

index d6b083cf68e857b2cc6179fdfbcfb128d3e4eea2..daa824c427843d35111544ab8190a3ea87e8faf8 100644 (file)
@@ -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') {
index c0b5de723923ac222c93183cfa4a1c0d90fb82b0..dd4324468168d892a6f7e95727a3be8f5f49c0a6 100644 (file)
@@ -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'));
+               }
        }
 
        /**
index 0d6ea2db87c80340759df862a58a9916ae39cfc1..b765508a61e4abf48e0d4410617646b896c91115 100644 (file)
@@ -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.",