X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupbyid.php;h=de87ec5c672e20da7632ef8f29e99c9411e4a91a;hb=aac6a21c4e53ed5952d195a6d39e6dbd0537637f;hp=7d327d56ccf4525c4e2c010dd83e7d184a80abe1;hpb=5ff8d8d447f306f4ad654d56b47cc6f740321c38;p=quix0rs-gnu-social.git diff --git a/actions/groupbyid.php b/actions/groupbyid.php index 7d327d56cc..de87ec5c67 100644 --- a/actions/groupbyid.php +++ b/actions/groupbyid.php @@ -1,6 +1,6 @@ . * * @category Group - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!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 @@ -42,67 +37,28 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * an URL with the ID in it as the permanent identifier. * * @category Group - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ - -class GroupbyidAction extends Action +class GroupbyidAction extends ManagedAction { /** 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; - } - - common_debug("Got ID $id"); - - $this->group = User_group::staticGet('id', $id); - - if (!$this->group) { - $this->clientError(_('No such group'), 404); - return false; - } - - return true; + $this->group = User_group::getByID($this->arg('id')); } - /** - * Handle the request - * - * Shows a profile for the group, some controls, and a list of - * group notices. - * - * @return void - */ - - function handle($args) + public function showPage() { common_redirect($this->group->homeUrl(), 303); } -} \ No newline at end of file +}