summaryrefslogtreecommitdiff
path: root/actions/apigroupshow.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-22 14:19:08 -0500
committerEvan Prodromou <evan@status.net>2010-01-22 14:19:08 -0500
commitd25bd9b2923606a9e4786e8cab3c1bd384235164 (patch)
tree1b8a4c1999806d24fd39c72f298c34cfc8bed57f /actions/apigroupshow.php
parentc8bc598cfd67353f33d7785556374b5d6865a7d9 (diff)
parent00547ca898733973eea7375152a3cfc83b50ae20 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'actions/apigroupshow.php')
-rw-r--r--actions/apigroupshow.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php
index 7aa49b1bf..ef9cbf0e7 100644
--- a/actions/apigroupshow.php
+++ b/actions/apigroupshow.php
@@ -45,6 +45,7 @@ require_once INSTALLDIR . '/lib/apiprivateauth.php';
* @author Evan Prodromou <evan@status.net>
* @author Jeffery To <jeffery.to@gmail.com>
* @author Zach Copley <zach@status.net>
+ * @author Michele <macno@macno.org>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -68,6 +69,24 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->group = $this->getTargetGroup($this->arg('id'));
+ if (empty($this->group)) {
+ $alias = Group_alias::staticGet(
+ 'alias',
+ common_canonical_nickname($this->arg('id'))
+ );
+ if (!empty($alias)) {
+ $args = array('id' => $alias->group_id, 'format' => $this->format);
+ common_redirect(common_local_url('ApiGroupShow', $args), 301);
+ } else {
+ $this->clientError(
+ _('Group not found!'),
+ 404,
+ $this->format
+ );
+ }
+ return;
+ }
+
return true;
}
@@ -85,15 +104,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
{
parent::handle($args);
- if (empty($this->group)) {
- $this->clientError(
- _('Group not found!'),
- 404,
- $this->format
- );
- return;
- }
-
switch($this->format) {
case 'xml':
$this->showSingleXmlGroup($this->group);
@@ -105,7 +115,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->clientError(_('API method not found.'), 404, $this->format);
break;
}
-
}
/**