* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
-
-require_once INSTALLDIR.'/lib/noticelist.php';
-require_once INSTALLDIR.'/lib/feedlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Permalink for a group
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
-class GroupbyidAction extends Action
+class GroupbyidAction extends ShowgroupAction
{
/** group we're viewing. */
- var $group = null;
-
- /**
- * Is this page read-only?
- *
- * @return boolean true
- */
+ protected $group = null;
function isReadOnly($args)
{
return true;
}
- function prepare($args)
+ protected function doPreparation()
{
- parent::prepare($args);
-
- if (!common_config('inboxes','enabled')) {
- $this->serverError(_('Inboxes must be enabled for groups to work'));
- return false;
- }
-
- $id = $this->arg('id');
-
- if (!$id) {
- $this->clientError(_('No ID'));
- return false;
- }
+ $this->group = User_group::getByID($this->arg('id'));
+ $this->target = $this->group->getProfile();
- common_debug("Got ID $id");
-
- $this->group = User_group::staticGet('id', $id);
-
- if (!$this->group) {
- $this->clientError(_('No such group'), 404);
- return false;
+ if ($this->target->isLocal()) {
+ common_redirect($this->target->getUrl());
}
-
- return true;
}
-
- /**
- * Handle the request
- *
- * Shows a profile for the group, some controls, and a list of
- * group notices.
- *
- * @return void
- */
-
- function handle($args)
- {
- common_redirect($this->group->homeUrl(), 303);
- }
-}
\ No newline at end of file
+}