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

Require Login for Members page?! How? | Forum

Stara
Stara Jan 10
I have Members page set to only members to view. The widget is hidden (in admin panel>pages>manage pages) but if a guest types in site.com/users then they can still see the page without login. 

Is there a way to make this page also require registration to view?
Marcus
Marcus Jan 11
You need a simple pluging to check the url or route then with controller check the rest. 
Marcus
Marcus Jan 11
That's a custom job if you want me to do this for ya drop me a line. 
Marcus
Marcus Jan 11
Basically what I would do is... If guest then redirect to sign-in page
Marcus
Marcus Jan 11
Or even better.... Since your page got sign-in button above a assume Im gonna replace content of page with text of your choice... Will add lang key... Where you can say some like register or login to view this page. 
The Forum post is edited by Marcus Jan 11
Catkin
Catkin Jan 11
Pfffffft, just disallow access to the page in your .htaccess?
Marcus
Marcus Jan 11
James and how do you gonna know whether the user is a member or guest.? Htaccess won't work 
Catkin
Catkin Jan 11
It will just block everyone, it's a fast solve. I mean, working with Oxwall is just all about botching things and holding everything together with the code equivalent of tape. 
Patricia Zorrilla Leader
Add this line:

if ( !OW::getUser()->isAuthenticated() ){ throw new AuthenticateException(); }

in the file:

ow_system_plugins/base/controllersuser_list.php

after the line 41, after this:

parent::__construct();





Patricia Zorrilla Leader
Did it work for you?


Stara
Stara Jan 17
Thank you, Patricia! It was great help! You are a good person and so helpful. Thank you very much.
Patricia Zorrilla Leader

It has nothing to do with the theme.

Here it is working fine and you can change the subject

On the websites where it doesn't work, did you put them in debug mode? https://wiki.oxwall.com/plugin-tuts:enable-debug

Patricia Zorrilla Leader

This warning refers to the use of an index of an array that does not exist.

You have to set a breakpoint at this point and inspect the variables involved to see what they contain and find out why they do not contain the referenced data.

There is no generic way to know what happens without doing this, you already say that with a similar configuration another website does work 

Bob Bob
Bob Bob Jan 29
It looks to me like the referenced function ( theme_service.php, line 634 ) attempts to process the CSS file. It seems to be breaking down the CSS key-value pairs, using the colon ( : ) separator. 


So it seems like to me, the problem is probably being caused by something in the CSS file (a missing punctuation mark, perhaps, or a similar issue). That's my best guess, anyway.

The Forum post is edited by Bob Bob Jan 29
Patricia Zorrilla Leader

It can't be a code error since Rob says he has two websites with identical settings and the other one is going well.

They may not be as identical and have different themes installed (even if you have the same theme active). 

Patricia Zorrilla Leader
There https://owspain.com are two languages here, and it is working fine, you cannot see the list of members if you do not login even if you access directly by URL to https://owspain.com/users/ or https://owspain.com/admin/users/

You can also change the theme on this site, and this does not affect.
Now I have to go to work, on my return I try to close the site to visitors, vary the number of languages and try more things about this.

Eduard
Eduard Feb 2

Quote from Patricia Zorrilla Add this line:

if ( !OW::getUser()->isAuthenticated() ){ throw new AuthenticateException(); }

in the file:

ow_system_plugins/base/controllersuser_list.php

after the line 41, after this:

parent::__construct();






Works like a charm. Thank you!
Chris_W
Chris_W Jun 24
I have four Oxwall sites and none of them have the file ow_system_plugins/base/controllersuser_list.php
Quote from Patricia Zorrilla Add this line:

if ( !OW::getUser()->isAuthenticated() ){ throw new AuthenticateException(); }

in the file:

ow_system_plugins/base/controllersuser_list.php

after the line 41, after this:

parent::__construct();






Attachments:
  no-file.png (101Kb)
Patricia Zorrilla Leader

yes that is


We The People United We Stand

Question is there a way to block just the username list, but still have the search for users and online users still viewable?


lets say you would;

Block website/user; but

Allow website/user/online

Allow website/user/search


Thanks.

Pages: 1 2 »