summaryrefslogtreecommitdiffstats
path: root/app/model
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-04-30 16:04:00 -0400
committerMalf Furious <m@lfurio.us>2016-05-01 01:34:23 -0400
commitae7ab126733f1d2c59e327f6120a2bbe792b3476 (patch)
treec5e943909f366c69b22aaf77ce4d42b9dd66a3ef /app/model
parent423fa09e3f524c8139d18c3e8652f542bcf2cd44 (diff)
downloadscrott-ae7ab126733f1d2c59e327f6120a2bbe792b3476.tar.gz
scrott-ae7ab126733f1d2c59e327f6120a2bbe792b3476.zip
Define constants for head-image upload parameters
Created class-scope vars to define allowable sizes and types for uploaded user images
Diffstat (limited to 'app/model')
-rw-r--r--app/model/common.mod.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index 96326dc..a177c13 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -7,6 +7,12 @@ require_once "class/user.class.php";
class CommonModel extends MasterModel
{
+ var $HEAD_IMG_MAX_SIZE = 1048576; // 1MB
+ var $HEAD_IMG_MIME = array(
+ "image/jpg",
+ "image/jpeg"
+ );
+
/*
* Default action
*/
@@ -103,7 +109,7 @@ class CommonModel extends MasterModel
$user->saveObj();
- if ($form->saveFile($attachment, 5242880, array("image/jpg", "image/jpeg"), "assets/img/heads/" . $user->guid))
+ if ($form->saveFile($attachment, $this->HEAD_IMG_MAX_SIZE, $this->HEAD_IMG_MIME, "assets/img/heads/" . $user->guid))
$this->logNotice("Image uploaded");
else
$this->logFormErrors($form);