aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-25 16:03:46 -0700
committerfriendica <info@friendica.com>2012-06-25 16:03:46 -0700
commitb044cd922d389b5bb9367ce1004d00a711562cf9 (patch)
tree57cd333508e4bb43b923fb74914b3d50904d4536 /mod
parent89ad19ce01f396ca71f4a991699871b26cf90b29 (diff)
downloadvolse-hubzilla-b044cd922d389b5bb9367ce1004d00a711562cf9.tar.gz
volse-hubzilla-b044cd922d389b5bb9367ce1004d00a711562cf9.tar.bz2
volse-hubzilla-b044cd922d389b5bb9367ce1004d00a711562cf9.zip
typos in bbcode, add service class restrictions to jot uploads
Diffstat (limited to 'mod')
-rw-r--r--mod/wall_attach.php13
-rw-r--r--mod/wall_upload.php13
2 files changed, 26 insertions, 0 deletions
diff --git a/mod/wall_attach.php b/mod/wall_attach.php
index 03d9f5105..f179b3ca5 100644
--- a/mod/wall_attach.php
+++ b/mod/wall_attach.php
@@ -60,6 +60,19 @@ function wall_attach_post(&$a) {
return;
}
+ $r = q("select sum(octet_length(data)) as total from attach where uid = %d ",
+ intval($page_owner_uid)
+ );
+
+ $limit = service_class_fetch($page_owner_uid,'attach_upload_limit');
+
+ if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
+ echo upgrade_message(true) . EOL ;
+ @unlink($src);
+ killme();
+ }
+
+
$filedata = @file_get_contents($src);
$mimetype = z_mime_content_type($filename);
$hash = random_string();
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 4b81f8d1c..5990f2834 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -79,6 +79,19 @@ function wall_upload_post(&$a) {
killme();
}
+ $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
+ intval($page_owner_uid)
+ );
+
+ $limit = service_class_fetch($page_owner_uid,'photo_upload_limit');
+
+ if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
+ echo upgrade_message(true) . EOL ;
+ @unlink($src);
+ killme();
+ }
+
+
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata, $filetype);