summaryrefslogtreecommitdiffstats
path: root/app/model/common.mod.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-04-30 16:18:24 -0400
committerMalf Furious <m@lfurio.us>2016-05-01 01:34:23 -0400
commitbe1a82affdaa1e87015a0a49979e9230cdc61b4d (patch)
tree69ce67f561de08ce7ba4bcf706d7c3b742686507 /app/model/common.mod.php
parentae7ab126733f1d2c59e327f6120a2bbe792b3476 (diff)
downloadscrott-be1a82affdaa1e87015a0a49979e9230cdc61b4d.tar.gz
scrott-be1a82affdaa1e87015a0a49979e9230cdc61b4d.zip
Update form handler for common/setting-modal, all users tab
Now supports file upload to replace the user's head image
Diffstat (limited to 'app/model/common.mod.php')
-rw-r--r--app/model/common.mod.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index a177c13..080c78e 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -44,10 +44,10 @@ class CommonModel extends MasterModel
{
switch ($input['action'])
{
- case "common-setting-user": $this->saveSettingUser($input, $attachment); break;
- case "common-setting-admin": $this->saveSettingAdmin($input); break;
- case "common-setting-allusers-adduser": $this->saveSettingAllusersAdduser($input); break;
- case "common-setting-allusers-edituser": $this->saveSettingAllusersEdituser($input); break;
+ case "common-setting-user": $this->saveSettingUser($input, $attachment); break;
+ case "common-setting-admin": $this->saveSettingAdmin($input); break;
+ case "common-setting-allusers-adduser": $this->saveSettingAllusersAdduser($input); break;
+ case "common-setting-allusers-edituser": $this->saveSettingAllusersEdituser($input, $attachment); break;
}
}
@@ -196,7 +196,7 @@ class CommonModel extends MasterModel
/*
* Allow an admin to edit user accounts
*/
- function saveSettingAllusersEdituser($input)
+ function saveSettingAllusersEdituser($input, $attachment)
{
$form = new Form();
$form->field_text("guid");
@@ -247,6 +247,11 @@ class CommonModel extends MasterModel
$user->setEmail($form->email);
$user->saveObj();
+
+ 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);
}
}