Hi, I want to restrict the access to a page (whit a password) for user registered and not.
How can I do?
Thanks to all
Sorry for my bad English

I want to protect a page whit a password for all users! also for users who weren’t registered, so I can’t use webgroups...
Sorry for my bad English

-
MODX Staff
- 12,272 Posts
You’ll need to either use .htaccess or to create a custom snippet to do that, then.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
MODX Staff
- 12,272 Posts
Think emulating an .htaccess password protected directory.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
The plugin would check for the user being logged in to a special web group; if he’s not (or isn’t logged in at all), replace the [*content*] tag with [!WebLogin!] tags, if he is add the WebLogin tags somewhere convenient to provide a logout link. It depends on your template and if you have a WebLogin form in the sidebar, you could just replace the content with the text "Restricted area. Please login."
If he’s logged in already as somebody else who isn’t a member of that group, put a message that they need to log out and log in again as the correct user for that area.
Or...if he’s already logged in as somebody else, serialize his existing web login information, save it to a SESSION variable, and clear the web login SESSION variables and continue as above, then he’ll need to login for that area, and next time he logs out (check the GET) trap it and replace the SESSION variables with the serialized data. If he logs out in the restricted area redirect him out of it, if he’s outside the restricted area let the page process normally after the SESSION manipulation.
Cannot we do this using a web user? I mean we can have one public web user account and assign it to a web group. All the protected pages can be assigned to a specific doc group, and this doc group will be assigned to the web group. That’s all right? Basically the page will be hidden from the world out there. If they want to access it, they can use the publi web user account or register a new account that will automatically sign them up to the right web group.
Am I thinking on a different problem/question?