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.

Restrict Jomsocial Page only to certain groups

10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

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.

10 years 1 month ago
Licenses:

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?


- 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
10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

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

10 years 1 month ago
Licenses:

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;
						}
				?>

This code is a condition "if user group is different than 2 ("Registered") display below content"
<?php if($group != '2') { ?>

... part of the template ...

<?php } ?>

Now you'll need to paste this code to certain JomSocial template.

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.


- 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
10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

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.

Attachment Capture_2014-03-21.JPG not found

Attachments:
10 years 1 month ago
Licenses:

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.


- 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
10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

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.

10 years 1 month ago
Licenses:

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') { ?>

above
<div class="cMain">

and this code"
<?php } ?>

below:
</div>

in line 72 (right above comment: <!-- end: .cMain -->).

Now main content will be not displayed for Joomla group with id 2 ("Registered").

Use this code in the same manner for other index pages. Look for cMain div - it displays main content area.

Also you may try to use this great extension: extensions.joomla.org/extensions/style-a...les-management/10307 and build several different menus - then display certain menu for certain Joomla! group only. After install go to Extensions -> Modules -> choose module (menu) -> edit it -> choose Assignments tab -> Users -> User Group Levels


- 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
Attachments:
The following user(s) said Thank You: Ronnie
10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

Thank you Michal - I will have a look at doing that :-)

much appreciated!

10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

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,

10 years 1 month ago
Licenses:

Hi, Ronnie.

it look ok for me... but I add developer to this thread. Let him look at it...


- 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
10 years 1 month ago
  • Ronnie's Avatar
    Topic Author
  • Ronnie
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Active

Thanks Michal,
I will await your response :-)

thanks again,

10 years 1 month ago
Licenses:

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.


- 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
10 years 1 month ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

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

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