diff options
author | Evan Prodromou <evan@status.net> | 2009-11-19 09:04:56 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-19 09:04:56 -0500 |
commit | b657e49ec772aec2b60ae193252edd53d85e1df5 (patch) | |
tree | 71f6054ac22b8355f434fd9bf4c2ccfc1afc5140 /actions/newgroup.php | |
parent | fa35dab2265aba78f7c704c34eaef4100bddfd70 (diff) | |
parent | 269781280903d80141788225ec858fbf6501971d (diff) |
Merge branch '0.9.x' into mapstraction
Diffstat (limited to 'actions/newgroup.php')
-rw-r--r-- | actions/newgroup.php | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/actions/newgroup.php b/actions/newgroup.php index 80da9861a..25da7f8fc 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -186,45 +186,13 @@ class NewgroupAction extends Action assert(!is_null($cur)); - $group = new User_group(); - - $group->query('BEGIN'); - - $group->nickname = $nickname; - $group->fullname = $fullname; - $group->homepage = $homepage; - $group->description = $description; - $group->location = $location; - $group->created = common_sql_now(); - - $result = $group->insert(); - - if (!$result) { - common_log_db_error($group, 'INSERT', __FILE__); - $this->serverError(_('Could not create group.')); - } - - $result = $group->setAliases($aliases); - - if (!$result) { - $this->serverError(_('Could not create aliases.')); - } - - $member = new Group_member(); - - $member->group_id = $group->id; - $member->profile_id = $cur->id; - $member->is_admin = 1; - $member->created = $group->created; - - $result = $member->insert(); - - if (!$result) { - common_log_db_error($member, 'INSERT', __FILE__); - $this->serverError(_('Could not set group membership.')); - } - - $group->query('COMMIT'); + $group = User_group::register(array('nickname' => $nickname, + 'fullname' => $fullname, + 'homepage' => $homepage, + 'description' => $description, + 'location' => $location, + 'aliases' => $aliases, + 'userid' => $cur->id)); common_redirect($group->homeUrl(), 303); } |