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

hide http: my site /users/ from Guest | Forum

nando nando
nando nando Mar 12 '15
Hello is there a way to hide from mon loge user or guest 

/users/ ( page ) 

ross Team
ross Mar 12 '15
Topic was moved from Bug reports and troubleshooting.
Taissa Team
Taissa Mar 13 '15
nando nando, you can hide only the buttons for the base pages like Main, Members, Forum, etc. via Admin Area > Pages & Menus, but if you have a permalink to these pages, you can easily open them.

If you want to close your site from the guests, you should go to Admin Area > Privacy & Permissions and set the No option for the Guests can view the site field. In this case a user will have to login to the site to see the content.

Otherwise, to hide permalink from the guests this is considered as the custom code modification. It may require introducing a new variable for logged in users and set "if-else" condition. If you don't have programming skills you can find a third-party developer here: http://www.oxwall.org/market/specialists
Patricia Zorrilla Leader
Patricia Zorrilla Mar 19 '15

I have the same problem.

I want my misite/events can be viewed without login, but misite/users and misite/index can not be.

Without login, misite/forum, misite/blogs, misite/photo/viewlist/latest for example does not allow access, so there is probably a way to do without defining new variables, something like

if not registered then exit

as custom code modification

Taissa Team
Taissa Mar 20 '15
Patricia Zorrilla Bcn, The mysite/forum, mysite/blogs, mysite/photo/viewlist/latest etc. pages this are the pages created by the plugins: forum, blogs, photo. The plugins allow to set visibility permissions in the settings.
But mysite/users page it's not a plugin's page and this is one of the reason why there are no privacy settings for it. As I said before this is considered as the custom code modification.
The Forum post is edited by Taissa Mar 25 '15
DeFender
DeFender Mar 21 '15
but users/search is hidden, and where is the problem to hide users?
Taissa Team
Taissa Mar 25 '15
Guys,

Let me explain. There are two ways how to manage the permissions for viewing the site content:
1. Hide the menu buttons. In this case only the users which have the permalink, will be able to open hidden pages.
2. Restricting access to the site content for a certain type of users via the User Roles settings.  
 
In case when you want to completely hide a page, you will need to change settings both in the Pages&Menus section and the User Roles section .
 
For the pages mysite/forum, mysite/blogs, mysite/events, mysite/video, mysite/users/search, mysite/photo/viewlist/latest etc. there are the settings in the Admin Area>Privacy&Permissions>Roles section which allow to hide or show the page content. These are the View topic/ View groups / View photo / View video etc. settings. I.e. if you want to hide the Video list page content, you will need to disable action "View video" in the Admin Area>Privacy&Permissions>Roles section. If you want to hide the menu button in the Main menu, then you need to uncheck "Guests" box in Admin Area>Pages&Menus section.  
 
Concerning, the Users' list page we have not added the possibility to hide these lists. Based on our experience, we could say that users are mostly looking for the active sites. And they determine the active sites by the number of existing users. That is why we believe this is an important factor to keep this page be public.
 
If you don't want to show the most of your site's content and prefer your site has been kept private, this is better to think about blocking any guest access.  As I said earlier, this can be done via the Admin Area>Privacy&Permissions section.
 
If your site concept requires not to show the users' lists for guests, as I said before, this is a custom code modification.  
 
Since, the default settings have no such existing action to hide the content of the users' list, then we can suggest to use already existing action, for example "View profiles".  
 
You need to make changes within two files:  
1. Go to ow_system_plugins/base/views/controllers/user_list_index.htm file.

Delete all code within it and paste this code:

{if isset($menu)}
    {$menu}    
{/if}

{if !empty($listType)}{add_content key="base.content.user_list_top" listType=$listType}{/if}
{if isset($authMessage)}
    <div class="ow_anno ow_std_margin ow_nocontent">{$authMessage}</div>
    
{else}
{$cmp}
{/if}

2. Go to /ow_system_plugins/base/controllers/user_list.php file find the following line:

 list($list, $itemCount) = $this->getData($listType, (($page - 1) * $this->usersPerPage), $this->usersPerPage);

and paste below it the following code:

if ( !OW::getUser()->isAuthorized('base', 'view_profile') )
        {
            $status = BOL_AuthorizationService::getInstance()->getActionStatus('base', 'view_profile');
            $this->assign('authMessage', $status['msg']);
            return;
        }


So the modified code will be:

list($list, $itemCount) = $this->getData($listType, (($page - 1) * $this->usersPerPage), $this->usersPerPage);

        if ( !OW::getUser()->isAuthorized('base', 'view_profile') )
        {
            $status = BOL_AuthorizationService::getInstance()->getActionStatus('base', 'view_profile');
            $this->assign('authMessage', $status['msg']);
            return;
        }


Once all changes are made don't forget to clear the browser cache and the smarty cache (DEV_MOD, use this manual: https://docs.oxwall.org/plugin-tuts:enable-debug ).
The Forum post is edited by Taissa Mar 25 '15
Taissa Team
Taissa Mar 25 '15
Topic was moved from General Questions.
falancas
falancas Jul 13 '17
Mobile version has the same problem. What file should be edited in mobile version?

Thank you
Taissa
Patricia Zorrilla Leader
Marc Vanwetswinkel
Marc Vanwetswinkel Jun 26 '20

I have enabled "view events" for guests in the User Roles settings and enabled "guest" in the Pages & Menus settings for events. Still, a guest can not see the events. They can see the tab "Events" but when they click, they are redirected to the registration page.

Any solutions?

Patricia Zorrilla Leader
Patricia Zorrilla Jun 26 '20
Please create a new topic for this new topic.
Quote from Marc Vanwetswinkel

I have enabled "view events" for guests in the User Roles settings and enabled "guest" in the Pages & Menus settings for events. Still, a guest can not see the events. They can see the tab "Events" but when they click, they are redirected to the registration page.

Any solutions?


Marc Vanwetswinkel
Marc Vanwetswinkel Jun 26 '20

Reading the title and posts #4 and @7, I thought I was on topic.

Thanks anyway.

Patricia Zorrilla Leader
Patricia Zorrilla Jun 26 '20

Well you're right, I did it wrong first, but 5 years ago. :)

Can you say the URL to see what can be seen from the outside that you want to hide?