Part of the message is hidden for the guests. Please log in or register to see it.
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')).
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.
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>
<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>
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
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
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:I hope that this solution will help you to create completely safe and locked Community.<?php if((JRequest::getVar('option') == "com_community") AND ($user->id == 0) AND (JRequest::getVar('view') != "register")) { ?>
<?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
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 ;)
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 :)
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>
<?php if(($jinput->get('option') == 'com_community') AND ($user->id == 0) AND (($jinput->get('view') != 'register') AND ($jinput->get('view') != 'frontpage'))) { ?>
A small bump so it will be gone from "No Answered" :)