summaryrefslogtreecommitdiffstats
path: root/app/model
diff options
context:
space:
mode:
Diffstat (limited to 'app/model')
-rw-r--r--app/model/common.mod.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index b1aa0a0..96326dc 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -34,21 +34,21 @@ class CommonModel extends MasterModel
/*
* Handle form submissions from common views
*/
- function common_handleFormSubmissions($input)
+ function common_handleFormSubmissions($input, $attachment)
{
switch ($input['action'])
{
- case "common-setting-user": $this->saveSettingUser($input); 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); break;
}
}
/*
* Save changes to user account settings
*/
- function saveSettingUser($input)
+ function saveSettingUser($input, $attachment)
{
$form = new Form();
$form->field_bool("setPasswd");
@@ -102,6 +102,11 @@ class CommonModel extends MasterModel
}
$user->saveObj();
+
+ if ($form->saveFile($attachment, 5242880, array("image/jpg", "image/jpeg"), "assets/img/heads/" . $user->guid))
+ $this->logNotice("Image uploaded");
+ else
+ $this->logFormErrors($form);
}
/*