summaryrefslogtreecommitdiff
path: root/actions/editgroup.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-26 09:35:28 -0800
committerBrion Vibber <brion@pobox.com>2010-02-26 09:35:28 -0800
commit8dfc8f1635940b096e7f4025e3aef0ca4f909eb2 (patch)
tree9fce4aa765d56496031698f219da2f0f82b33e80 /actions/editgroup.php
parent8914b69d5055c1bc7d0604ee338ffdaf6b0a8606 (diff)
parentb331e971b055386a126aaec27d661f26ba3b813c (diff)
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'actions/editgroup.php')
-rw-r--r--actions/editgroup.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/actions/editgroup.php b/actions/editgroup.php
index ad0b6e185..4b596cade 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) {
@@ -245,6 +249,7 @@ class EditgroupAction extends GroupDesignAction
$this->group->homepage = $homepage;
$this->group->description = $description;
$this->group->location = $location;
+ $this->group->mainpage = common_local_url('showgroup', array('nickname' => $nickname));
$result = $this->group->update($orig);
@@ -259,6 +264,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,10 +283,10 @@ 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) {
+ $group->group_id != $this->group->id) {
return true;
}