diff options
author | Evan Prodromou <evan@status.net> | 2010-02-25 08:44:15 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-25 08:44:15 -0500 |
commit | e6858d7203bd36923f6251968bede6f4b271bf84 (patch) | |
tree | daf24ce51064058af226eb8e296476a3f9155473 /actions/editgroup.php | |
parent | ddc3671b6aeb0b543d261251a1740a53469684c3 (diff) |
modify group actions so they use Local_group to look up by nickname
Diffstat (limited to 'actions/editgroup.php')
-rw-r--r-- | actions/editgroup.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/actions/editgroup.php b/actions/editgroup.php index ad0b6e185..bbbb7a0f4 100644 --- a/actions/editgroup.php +++ b/actions/editgroup.php @@ -86,10 +86,14 @@ class EditgroupAction extends GroupDesignAction } $groupid = $this->trimmed('groupid'); + if ($groupid) { $this->group = User_group::staticGet('id', $groupid); } else { - $this->group = User_group::staticGet('nickname', $nickname); + $local = Local_group::staticGet('nickname', $nickname); + if ($local) { + $this->group = User_group::staticGet('id', $local->group_id); + } } if (!$this->group) { @@ -259,6 +263,12 @@ class EditgroupAction extends GroupDesignAction $this->serverError(_('Could not create aliases.')); } + if ($nickname != $orig->nickname) { + common_log(LOG_INFO, "Saving local group info."); + $local = Local_group::staticGet('group_id', $this->group->id); + $local->setNickname($nickname); + } + $this->group->query('COMMIT'); if ($this->group->nickname != $orig->nickname) { @@ -272,7 +282,7 @@ class EditgroupAction extends GroupDesignAction function nicknameExists($nickname) { - $group = User_group::staticGet('nickname', $nickname); + $group = Local_group::staticGet('nickname', $nickname); if (!empty($group) && $group->id != $this->group->id) { |