summaryrefslogtreecommitdiffstats
path: root/app/model
diff options
context:
space:
mode:
Diffstat (limited to 'app/model')
-rw-r--r--app/model/common.mod.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index 3d8c200..07b86df 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -18,6 +18,7 @@ require_once "model/master.mod.php";
require_once "class/form.class.php";
require_once "class/setting.class.php";
require_once "class/user.class.php";
+require_once "class/group.class.php";
class CommonModel extends MasterModel
{
@@ -68,6 +69,7 @@ class CommonModel extends MasterModel
{
switch ($input['action'])
{
+ case "common-group-add": $this->addNewGroup($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;
@@ -77,6 +79,24 @@ class CommonModel extends MasterModel
}
/*
+ * Create a new user group
+ */
+ function addNewGroup($input)
+ {
+ $form = new Form();
+ $form->field_text("name");
+
+ if (!$form->populate($input))
+ {
+ $this->logFormErrors($form);
+ return;
+ }
+
+ $group = new Group();
+ $group->createNewGroup($form->name, $this->getCurrentUser());
+ }
+
+ /*
* Save changes to user account settings
*/
function saveSettingUser($input, $attachment)