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.

Global community items Public but ALL items set as Registered!

4 years 9 months ago
Licenses:
JomSocial Active


Part of the message is hidden for the guests. Please log in or register to see it.

4 years 9 months ago
Licenses:

HI, Xristoph.

I just tested setting "Members Only" for main activity stream. Even if I posted a public status, it's not visible after I log out.
Activity stream is just not displayed... as whole.

:) Code is opposite :) Then you just need to change signs from == to != ;)

Please, try it now. this is just general idea, you may use it in your main template or just in JS pages layout (then you'll not have to use this part: (JRequest::getInt('Itemid') == '501')).


- 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
4 years 9 months ago
Licenses:
JomSocial Active

Michal,
We've had that setting configured to "Members Only" from day one of site launch, but still presented with exposed pages as noted in previous post. For the Events they do not show "if" Event or Group is marked as "Hide from groups list" and the "Invite only" feature is enabled....this prevents publicly exposed detail pages but then means our registered 200 users don't see the Events either. I've temporarily had to configure every Group to be Private, which prevents Registered users from viewing details of each group on the main listing.

Warning: Spoiler! [ Click to expand ]


Do you think the extension ACL Manager for Joomla would allow us to properly configure (lock down) to meet our needs?

4 years 9 months ago
Licenses:

Hi, Xristoph.

Warning: this code is valid for Joomla! 3.2.x ONLY
Here is code for Joomla! 3.8.x: www.jomsocial.com/forum/events/28553-glo...ered?start=14#180355

Ok, let's start over. Joomla! access permissions are based on menu item IDs.
If you're smart enough you may predict and construct Joomla! URL that doesn't use menu item ID thus avoid any permission restrictions.

So the best way to secure your site against unauthorized access will be to implement in main template or in certain page layout files a php condition that checks if certain user is logged in or not.

The question is if you want to secure only selected pages or whole site?
I guess that at least few ages like "New registration", "Login", all pages under "Terms & Conditions" and "Home" should be public.

Then the best way will be to secure certain pages only... but not using menu item ID... Still there could be a lot of file to customize. So i have solution that require to customize only one file: current template index.php

Take a look;

<div id="t3-mainbody" class="container t3-mainbody">
<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>
<jdoc:include type="modules" name="no-entry" style="xhtml" />
	<?php } else { ?>
	<div class="row">

		<!-- MAIN CONTENT -->
		<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
			<?php if($this->hasMessage()) : ?>
			<jdoc:include type="message" />
			<?php endif ?>
			<div class="t3-content-block">
				<jdoc:include type="component" />
			</div>
		</div>
		<!-- //MAIN CONTENT -->

		<!-- SIDEBAR 1 -->
		<div class="t3-sidebar t3-sidebar-1 col-xs-12 col-sm-6 col-md-3  col-md-pull-6 <?php $this->_c($vars['sidebar1']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar1']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 1 -->
	
		<!-- SIDEBAR 2 -->
		<div class="t3-sidebar t3-sidebar-2 col-xs-12 col-sm-6 col-md-3 <?php $this->_c($vars['sidebar2']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar2']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 2 -->
	
	</div>
<?php } ?>
</div>

Above code was prepared for Socialize template but will work for any template. Below is the crucial part:
<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>

If user tried to load pages that contain option=com_community (it doesn't matter if you use SEF URLs or not) AND is NOT logged in then certain module position is loaded e.g login form or some notice. Condition excludes view=register so your members could still view register pages :)

ELSE - in any other case (logged/non-logged in) or accessing different page - main content is loaded as usual.

There is no way to avoid this check as it's in template core, so no URL fiddling will help to display page content for non authorized user.

I hope that this solution will help you to create completely safe and locked Community.


- 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: Xristoph Conrad
4 years 9 months ago
Licenses:
JomSocial Active

I will implement now, and thank you.

Just FYI, perhaps you mean them to be public but I can still see the following on your test site without logging in;

How To Use
Author
Teacher List
Course Categories
Category List

4 years 9 months ago
Licenses:
JomSocial Active

Log-in credentials don't seem to be working

Warning
Username and password do not match or you do not have an account yet.


and

Notice
Login failed

4 years 9 months ago
Licenses:
JomSocial Active

Michał wrote: Hi, Xristoph.
a solution that require to customize only one file: current template index.php

Take a look;

<div id="t3-mainbody" class="container t3-mainbody">
<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>
<jdoc:include type="modules" name="no-entry" style="xhtml" />
	<?php } else { ?>
	<div class="row">

		<!-- MAIN CONTENT -->
		<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
			<?php if($this->hasMessage()) : ?>
			<jdoc:include type="message" />
			<?php endif ?>
			<div class="t3-content-block">
				<jdoc:include type="component" />
			</div>
		</div>
		<!-- //MAIN CONTENT -->

		<!-- SIDEBAR 1 -->
		<div class="t3-sidebar t3-sidebar-1 col-xs-12 col-sm-6 col-md-3  col-md-pull-6 <?php $this->_c($vars['sidebar1']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar1']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 1 -->
	
		<!-- SIDEBAR 2 -->
		<div class="t3-sidebar t3-sidebar-2 col-xs-12 col-sm-6 col-md-3 <?php $this->_c($vars['sidebar2']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar2']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 2 -->
	
	</div>
<?php } ?>
</div>

Above code was prepared for Socialize template but will work for any template. Below is the crucial part:
<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>
I hope that this solution will help you to create completely safe and locked Community.


Michał,
Here is the contents of my templates index.php file...can you please instruct me what & where to place?
<?php

/**
 *
 * Main file
 *
 * @version             3.0.0
 * @package             Gavern Framework
 * @copyright			Copyright (C) 2010 - 2012 GavickPro. All rights reserved.
 *               
 */
 
// No direct access.
defined('_JEXEC') or die;
if(!defined('DS')){ define('DS',DIRECTORY_SEPARATOR); }

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// enable showing errors in PHP
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT);
ini_set('display_errors','On');
// include framework classes and files
require_once('lib/gk.framework.php');
// run the framework
$tpl = new GKTemplate($this, $GK_TEMPLATE_MODULE_STYLES);

// EOF

4 years 9 months ago
Licenses:

Hi, Xristoph.

It seems that you use one of club templates built on framework. Above file is not suitable to implement my code.
Such a templates are more tricky to customize.
Please, edit first post in this thread and provide SU credentials to your site backend.
If your server settings allow to modify files directly in template - I'll implement code for you ;)


- 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: Xristoph Conrad
4 years 9 months ago
Licenses:

HI.

As for my test site, sorry, wrong credentials, please, try:

u: guma
p: test 12

Those link you posted meant to be public as they are from Guru :)


- 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
3 years 8 months ago
Licenses:

Hi, Xristoph.

Updated for Joomla! 3.8.x

If you're smart enough you may predict and construct Joomla! URL that doesn't use menu item ID thus avoid any permission restrictions.

So the best way to secure your site against unauthorized access will be to implement in main template or in certain page layout files a php condition that checks if certain user is logged in or not.

The question is if you want to secure only selected pages or whole site?
I guess that at least few ages like "New registration", "Login", all pages under "Terms & Conditions" and "Home" should be public.

Then the best way will be to secure certain pages only... but not using menu item ID... Still there could be a lot of file to customize. So i have solution that require to customize only one file: current template index.php

Take a look;

<div id="t3-mainbody" class="container t3-mainbody">
<?php
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
?>
<?php if(($jinput->get('option') == 'com_community') AND ($user->id == 0) AND (($jinput->get('view') != 'register') AND ($jinput->get('view') != 'frontpage'))) { ?>
<jdoc:include type="modules" name="no-entry" style="xhtml" />
	<?php } else { ?>
	<div class="row">

		<!-- MAIN CONTENT -->
		<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
			<?php if($this->hasMessage()) : ?>
			<jdoc:include type="message" />
			<?php endif ?>
			<div class="t3-content-block">
				<jdoc:include type="component" />
			</div>
		</div>
		<!-- //MAIN CONTENT -->

		<!-- SIDEBAR 1 -->
		<div class="t3-sidebar t3-sidebar-1 col-xs-12 col-sm-6 col-md-3  col-md-pull-6 <?php $this->_c($vars['sidebar1']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar1']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 1 -->
	
		<!-- SIDEBAR 2 -->
		<div class="t3-sidebar t3-sidebar-2 col-xs-12 col-sm-6 col-md-3 <?php $this->_c($vars['sidebar2']) ?>">
			<jdoc:include type="modules" name="<?php $this->_p($vars['sidebar2']) ?>" style="T3Xhtml" />
		</div>
		<!-- //SIDEBAR 2 -->
	
	</div>
<?php } ?>
</div>

Above code was prepared for Socialize template but will work for any template. Below is the crucial part:
<?php if(($jinput->get('option') == 'com_community') AND ($user->id == 0) AND (($jinput->get('view') != 'register') AND ($jinput->get('view') != 'frontpage'))) { ?>

If user tried to load pages that contain option=com_community (it doesn't matter if you use SEF URLs or not) AND is NOT logged in then certain module position is loaded e.g login form or some notice. Condition excludes view=register and view=frontpage so your members could still view register pages :)

ELSE - in any other case (logged/non-logged in) or accessing different page - main content is loaded as usual.

There is no way to avoid this check as it's in template core, so no URL fiddling will help to display page content for non authorized user.

I hope that this solution will help you to create completely safe and locked Community.

Demo with explanation for Joomla 3.8 Protostar available as attachment ZIP.


- 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

This message has an attachment file.
Please log in or register to see it.

3 years 8 months ago
Licenses:

A small bump so it will be gone from "No Answered" :)


- 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
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