X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fjoingroup.php;h=bf69b2ad1e40769df3b7c5c5278b3cd77303528b;hb=954335fa5e18b003e20cd43e71fb690181095101;hp=45470f0888be7e7edff2509fc9de9850aec6808e;hpb=4491e82762e498a02ec4f8a9f6c98cc194071e1f;p=quix0rs-gnu-social.git diff --git a/actions/joingroup.php b/actions/joingroup.php index 45470f0888..bf69b2ad1e 100644 --- a/actions/joingroup.php +++ b/actions/joingroup.php @@ -1,6 +1,6 @@ . * * @category Group - * @package Laconica - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @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')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ if (!defined('LACONICA')) { * for users. * * @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 JoingroupAction extends Action @@ -56,11 +56,6 @@ class JoingroupAction extends Action { parent::prepare($args); - if (!common_config('inboxes','enabled')) { - $this->serverError(_('Inboxes must be enabled for groups to work')); - return false; - } - if (!common_logged_in()) { $this->clientError(_('You must be logged in to join a group.')); return false; @@ -73,7 +68,7 @@ class JoingroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); - common_redirect(common_local_url('editgroup', $args), 301); + common_redirect(common_local_url('joingroup', $args), 301); return false; } @@ -91,11 +86,16 @@ class JoingroupAction extends Action $cur = common_current_user(); - if ($cur->isMember($group)) { + if ($cur->isMember($this->group)) { $this->clientError(_('You are already a member of that group'), 403); return false; } + if (Group_block::isBlocked($this->group, $cur->getProfile())) { + $this->clientError(_('You have been blocked from that group by the admin.'), 403); + return false; + } + return true; } @@ -143,7 +143,8 @@ class JoingroupAction extends Action $this->elementEnd('html'); } else { common_redirect(common_local_url('groupmembers', array('nickname' => - $this->group->nickname))); + $this->group->nickname)), + 303); } } } \ No newline at end of file