X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupbyid.php;h=de87ec5c672e20da7632ef8f29e99c9411e4a91a;hb=64b72a3c9b8c9ee2d8716a3271834293d1e863f8;hp=f18e4540c05ac84b2d6db5a9c5d81e253eb43486;hpb=7a9777df053a9007b5eaa71f5437584065b615a5;p=quix0rs-gnu-social.git diff --git a/actions/groupbyid.php b/actions/groupbyid.php index f18e4540c0..de87ec5c67 100644 --- a/actions/groupbyid.php +++ b/actions/groupbyid.php @@ -28,12 +28,7 @@ * @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 @@ -47,55 +42,22 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * @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 ManagedAction { /** group we're viewing. */ - var $group = null; + protected $group = null; - /** - * Is this page read-only? - * - * @return boolean true - */ function isReadOnly($args) { return true; } - function prepare($args) + protected function doPreparation() { - parent::prepare($args); - - $id = $this->arg('id'); - - if (!$id) { - // TRANS: Client error displayed referring to a group's permalink without providing a group ID. - $this->clientError(_('No ID.')); - return false; - } - - common_debug("Got ID $id"); - - $this->group = User_group::staticGet('id', $id); - - if (!$this->group) { - // TRANS: Client error displayed referring to a group's permalink for a non-existing group ID. - $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); }