The official, canonical postActiv repository. http://www.postactiv.com

groupbyid.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* ============================================================================
  3. * Title: GroupByID
  4. * Permalink for group
  5. *
  6. * postActiv:
  7. * the micro-blogging software
  8. *
  9. * Copyright:
  10. * Copyright (C) 2016-2018, Maiyannah Bishop
  11. *
  12. * Derived from code copyright various sources:
  13. * o GNU Social (C) 2013-2016, Free Software Foundation, Inc
  14. * o StatusNet (C) 2008-2012, StatusNet, Inc
  15. * ----------------------------------------------------------------------------
  16. * License:
  17. * This program is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License as published by
  19. * the Free Software Foundation, either version 3 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU Affero General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU Affero General Public License
  28. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. *
  30. * <https://www.gnu.org/licenses/agpl.html>
  31. * ----------------------------------------------------------------------------
  32. * About:
  33. * Permalink for group
  34. *
  35. * The group nickname can change, but not the group ID. So we use
  36. * an URL with the ID in it as the permanent identifier.
  37. *
  38. * PHP version:
  39. * Tested with PHP 7.0
  40. * ----------------------------------------------------------------------------
  41. * File Authors:
  42. * o Evan Prodromou
  43. * o Siebrand Mazeland <s.mazeland@xs4all.nl>
  44. * o Mikael Nordfeldth <mmn@hethane.se>
  45. * o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
  46. *
  47. * Web:
  48. * o postActiv <http://www.postactiv.com>
  49. * o GNU social <https://www.gnu.org/s/social/>
  50. * ============================================================================
  51. */
  52. // This file is formatted so that it provides useful documentation output in
  53. // NaturalDocs. Please be considerate of this before changing formatting.
  54. if (!defined('POSTACTIV')) { exit(1); }
  55. /**
  56. * Permalink for a group
  57. */
  58. class GroupbyidAction extends ShowgroupAction
  59. {
  60. /** group we're viewing. */
  61. protected $group = null;
  62. function isReadOnly($args)
  63. {
  64. return true;
  65. }
  66. protected function doPreparation()
  67. {
  68. $this->group = User_group::getByID($this->arg('id'));
  69. $this->target = $this->group->getProfile();
  70. if ($this->target->isLocal()) {
  71. common_redirect($this->target->getUrl());
  72. }
  73. }
  74. }
  75. // END OF FILE
  76. // ============================================================================
  77. ?>