summaryrefslogtreecommitdiffstats
path: root/app/model
diff options
context:
space:
mode:
Diffstat (limited to 'app/model')
-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);
}
}