Hello,
I have read the articles on ACL not being implemented within Jomsocial before but there are some topics like this one, where the permissions to the page are discussed.
I just need an "all or nothing" option for the landing page in Jomsocial. and at the moment everything seems to be disabled except the wal, which shows ALL the posts to anyone who has logged in.
I have made the page and toolbar only available to "AllowedAccessGroup" which does not include the default "Registered" users, just like it is suggested on post
#28244
But this does not work.
1. The landing page presents guests and public the core Joomla login page.
when a registered user logs in - they see the message "You are not authorised to view this resource." but also see the wall.
Can you give me an option on how to block the whole page and its content to registered users. i don't need the detailed ACL due in 3.3 - just the joomla page permissions to work.
many thanks in advance.
Hi, Ronnie.
I'm not sure if I understand you well...
You want to disable access to JomSocial (whole or just part of it) for registered users?
Or you just want to hide Main Activity stream for registered users?
Hi Michal,
Either would be good to know how, but due to the fact that ACL is not here yet, I prefer disabling access to Jomsocial to everyone except a specific group would be the best option.
I say this because I noticed that even when I don't have any privileges on the account , going to /jomsocial/search for example, still gives me access to search everyone - so disabling everything would be good.
many thanks,
Ronnie
Hi, Ronnie.
If you want to hide certain content for some user group e.g for users that are in "Registered" group in Joomla use this code:
This code determines current user group.
<?php $user = JFactory::getUser();
$groups = $user->get('groups');
foreach($groups as $group) {
$group;
}
?>
<?php if($group != '2') { ?>
... part of the template ...
<?php } ?>
On what you said about
"Also you could create new Joomla group and add some users to that group. Then create new access level in Joomla and assign it to your new group. Then set this new access level to JomSocial menu items."
I have done this. I created an access group call Nexus.
Then created a Group Call Nexus which only allows a group called Members and a group called InvitedGuests to see it.
I applied the ACL to JomSocial Menu Items (everything in the JomSocial toolbar menu) but it still does not work.
Hi, Ronnie.
It works but in limited way - just hide links but user can browse be clicking links in profile.
So it means that you'll need to apply my code into templates.
Ok - Michal thank you, but this is where I am a leetle out of my depth :-)
1. what page would I put that code in?
2. is it possibly to put some code in that would do complete page redirect to a separate menuitem if they did not belong to a group.
can you help me with that ?
thanks again for your time.
Hi, Ronnie.
I can show you how to use it on one example - hiding main activity stream for Registered group:
Copy this file: ROOT/components/com_community/templates/default/frontpage.index.php
to: templates/your_current_template/html/com_community (if you don't have "html" or "com_community" folders feel free to create them)
Edit the file in line 30, add this:
<?php $user = JFactory::getUser();
$groups = $user->get('groups');
foreach($groups as $group) {
$group;
}
?>
<?php if($group != '2') { ?>
<div class="cMain">
<?php } ?>
</div>
Hello Michal,
Thank you for the previous code - i got somewhere but not quite there. I have a last request on this:
Some of the users that need to see the page may have registered users assigned to them as a role, so I only want to show the recent activity to users which belong to one of two groups.
This is the code I used but it does not seem to apply ... can you just glance your eye on it to let me know if I am using it correctly?
<?php $user = JFactory::getUser();
$groups = $user->get('groups');
}
?>
<?php print_r ($groups); { ?> This shows a result of Array ( [20] => 20 [22] => 22 [24] => 24 )
<?php if(strpos($groups, '38') !== false || strpos($groups, '14') !== false) { ?>
<!-- begin: .cMain -->
.....
Note: everything else is hidden from the user using the normal ACL's from Joomla, just the Recent Activity is showing.
thanks,
Hi, Ronnie.
it look ok for me... but I add developer to this thread. Let him look at it...
Hi, Ronnie.
I'm really sorry that you had to wait so long. It was due our forum malfunction so threads to which our developer was assigned ware not viable on his list. Now this is fixed so hopefully he'll take a look on this topic soon.
Hi Ronnie,
well, this issue is complicated, and the simple hack is not a solution.. you should edit lot of code for this especially the activitystream issue.. I suggest you hire the 3rd party to continue this, you can contact them from here
www.jomsocial.com/jomsocial-developers
:)
thank you