We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Allow access to Blogs only | Forum

Pedro Machado
Pedro Machado Jun 30 '14
Hi, all.


My site with Oxwall is blocked for guests. In Global Privacy I marked that Guests cannot view the site. 

But I want allow access to Blog only for guests and users.


Is there any way to allow access to Blog, without allow access to the rest of the site?


I tried to allow access to the site for guests and make hide the pages for guests, but any pages (like users) still accessible by the address bar. 

Alia Team
Alia Jul 1 '14
Pedro, it is possible.
You will need to add an exception into ow_core/application.php, similar to the way this is done for "Terms of use" page:

 if ( UTIL_String::removeFirstAndLastSlashes($value->getUri()) == 'terms-of-use' )
            {
                OW::getRequestHandler()->addCatchAllRequestsExclude('base.members_only', $staticPageDispatchAttrs['controller'], $staticPageDispatchAttrs['action'], array('documentKey' => $value->getKey()));
            }

But in your case, you will need to adjust addCatchAllRequestsExclude to work with attributes of "Blogs" plugin.
Pedro Machado
Pedro Machado Jul 1 '14

Thanks for reply

But.. Ooo.. It's very difficult for me. I looked the code and I don't understand what should be changed. Because this code only work for static pages. And for Blog is more complex I thought. 

Pedro Machado
Pedro Machado Jul 3 '14

Hi, Aliia.


I added an extra condition in line 279, where is checked if the site is visible to visitors and if the user is logged. It is a ugly hack but it works.


if ((int) $baseConfigs['guests_can_view'] === BOL_UserService::PERMISSIONS_GUESTS_CANT_VIEW && !OW::getUser()->isAuthenticated() && ( UTIL_String::truncate(OW::getRequest()->getRequestUri(),5,'')) != 'blogs')



Alia Team
Alia Jul 9 '14
Thanks for sharing Pedro.