]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showgroup.php
Resolve Group Aliases in showgroup.php
[quix0rs-gnu-social.git] / actions / showgroup.php
index 5d9ee26a286bd0df617e91bfe0ab981a96e63c4a..b0cc1dbc7df61ab4d720f49debc39c4a83fdc119 100644 (file)
@@ -130,8 +130,18 @@ class ShowgroupAction extends GroupDesignAction
         $this->group = User_group::staticGet('nickname', $nickname);
 
         if (!$this->group) {
-            $this->clientError(_('No such group'), 404);
-            return false;
+            $alias = Group_alias::staticGet('alias', $nickname);
+            if ($alias) {
+                $args = array('id' => $alias->group_id);
+                if ($this->page != 1) {
+                    $args['page'] = $this->page;
+                }
+                common_redirect(common_local_url('groupbyid', $args), 301);
+                return false;
+            } else {
+                $this->clientError(_('No such group'), 404);
+                return false;
+            }
         }
 
         common_set_returnto($this->selfUrl());
@@ -331,8 +341,8 @@ class ShowgroupAction extends GroupDesignAction
                                       $this->group->nickname)),
                      new Feed(Feed::ATOM,
                               common_local_url('api',
-                                               array('apiaction' => 'statuses',
-                                                     'method' => 'group_timeline',
+                                               array('apiaction' => 'groups',
+                                                     'method' => 'timeline',
                                                      'argument' => $this->group->nickname.'.atom')),
                               sprintf(_('Notice feed for %s group (Atom)'),
                                       $this->group->nickname)));
@@ -440,8 +450,9 @@ class ShowgroupAction extends GroupDesignAction
             $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
                 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .
                 'short messages about their life and interests. '.
-                '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
-                     $this->group->nickname);
+                '[Join now](%%%%action.%s%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
+                     $this->group->nickname,
+                     (!common_config('site','openidonly')) ? 'register' : 'openidlogin');
         } else {
             $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
                 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .