Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Disallow group members to leave

10 years 4 months ago
  • Daniel's Avatar
    Topic Author
  • Daniel
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Licenses:
JomSocial Active

Hello,
is it possible to prevent a user from leaving a group? I understand the onGroupLeave event, but I can only revert the change there. However, JomSocial will still display that the user left the group. So I would need an option to prevent this message or even let the menu item disappear for anyone but group admins and super users.

Are there other options to implement this feature?

10 years 4 months ago
Licenses:

Hi, Ralph.

Sure thing, the best solution will be to just hide "Leave" option.

Copy this file:

ROOT/components/com_community/templates/default/groups.viewgroup.php

to:

ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)

Change this (line 149):

<?php if( ($isMember) && (!$isMine) && !($waitingApproval) && (COwnerHelper::isRegisteredUser()) ) { ?>
                <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.groups.leave('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_LEAVE');?></a></li>
                  <?php } ?>

to this:
<?php if($isSuperAdmin) { ?>
                <li><a tabindex="-1" href="javascript:void(0);" onclick="joms.groups.leave('<?php echo $group->id;?>');"><?php echo JText::_('COM_COMMUNITY_GROUPS_LEAVE');?></a></li>
                  <?php } ?>

Or simply remove original lines.

This will hide or remove "Leave group" option.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: Daniel
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW