X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupdesignsettings.php;h=526226a285715914486ffc3eb0905f60c4ebf13c;hb=72460091ddc6763cb8d62f9d865390ea4973dd44;hp=cd86e3b0511d02f7b07728b835fe4870423ae0ba;hpb=a08c76a4342cfb4b3d772f6880ba0b8f3153b246;p=quix0rs-gnu-social.git diff --git a/actions/groupdesignsettings.php b/actions/groupdesignsettings.php index cd86e3b051..526226a285 100644 --- a/actions/groupdesignsettings.php +++ b/actions/groupdesignsettings.php @@ -64,11 +64,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction { parent::prepare($args); - if (!common_config('inboxes', 'enabled')) { - $this->serverError(_('Inboxes must be enabled for groups to work')); - return false; - } - if (!common_logged_in()) { $this->clientError(_('You must be logged in to edit a group.')); return false; @@ -86,7 +81,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction } if (!$nickname) { - $this->clientError(_('No nickname'), 404); + $this->clientError(_('No nickname.'), 404); return false; } @@ -95,18 +90,21 @@ class GroupDesignSettingsAction extends DesignSettingsAction 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) { - $this->clientError(_('No such group'), 404); + $this->clientError(_('No such group.'), 404); return false; } $cur = common_current_user(); if (!$cur->isAdmin($this->group)) { - $this->clientError(_('You must be an admin to edit the group'), 403); + $this->clientError(_('You must be an admin to edit the group.'), 403); return false; } @@ -178,17 +176,12 @@ class GroupDesignSettingsAction extends DesignSettingsAction function getWorkingDesign() { - $design = null; if (isset($this->group)) { $design = $this->group->getDesign(); } - if (empty($design)) { - $design = $this->defaultDesign(); - } - return $design; } @@ -202,7 +195,13 @@ class GroupDesignSettingsAction extends DesignSettingsAction function showContent() { - $this->showDesignForm($this->getWorkingDesign()); + $design = $this->getWorkingDesign(); + + if (empty($design)) { + $design = Design::siteDesign(); + } + + $this->showDesignForm($design); } /** @@ -288,7 +287,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction if (empty($id)) { common_log_db_error($id, 'INSERT', __FILE__); - $this->showForm(_('Unable to save your design settings!')); + $this->showForm(_('Unable to save your design settings.')); return; } @@ -298,7 +297,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction if (empty($result)) { common_log_db_error($original, 'UPDATE', __FILE__); - $this->showForm(_('Unable to save your design settings!')); + $this->showForm(_('Unable to save your design settings.')); $this->group->query('ROLLBACK'); return; }