<![CDATA[ ACL Context problems - My Forums]]> https://forums.modx.com/thread/?thread=104952 <![CDATA[ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564327

I started installing MODx for some domains. My structure is as follows:

- root (MODx web context) --> mysite.com
- subdomains/members --> members.mysite.com
- core

Changing the structure was no problem, because of the really nice documentation, but I have one problem I couldn't solve on my own:

The regular behavior of the web-context is:

- Show all pages including unpublished pages, if the user is an admin (and logged in, of course).

The behavior of the context, let's call it "members" is:

- If I try to view a page in the frontend while I'm logged in as admin while the page is OFFLINE (site_status of the context = No), I only can view the error page.
- If I try to view a UNPUBLISHED page in the frontend (again, logged in as admin) and the page / context ist ONLINE, I get redirected to the "unauthorized_page"

I already followed the suggestions from https://forums.modx.com/thread/103279/using-context-new-context-redirect-to-default-context

Any ideas?

Thanks for the help!
Simon


]]>
simonh Mar 07, 2019, 05:48 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564327
<![CDATA[Re: ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564362
Thanks again smiley]]>
simonh Mar 10, 2019, 06:39 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564362
<![CDATA[Re: ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564355

FYI, if users will be going back and forth between contexts, you can use something like this in the Login tag to log them in to all contexts at once:

&contexts=`web,context1,context2,context3`


Also turning on the allow_forward_across_contexts System Setting is sometimes necessary.]]>
BobRay Mar 08, 2019, 11:18 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564355
<![CDATA[Re: ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564354 Quote from: BobRay at Mar 08, 2019, 05:11 PM
Did you include &contexts in your Login tag?

Not this time.

I changed session_cookie_domain for the context (members.mysite.com) to mysite.com and now everything works like expected.

Thank you, Bob!]]>
simonh Mar 08, 2019, 07:23 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564354
<![CDATA[Re: ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564353 BobRay Mar 08, 2019, 05:11 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564353 <![CDATA[Re: ACL Context problems]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564342
Thank you for your answer.

MODx created context-permissons with the "Context" policy and the Admin group, with an authority of 9999.
After a few tests I changed this to the Admin policy and the Admin group with an authority of 0.

I tried to mirror the web context as good as I could.

So I was logged in as admin in web/mgr/mycontext, I guess.

Quote from: BobRay at Mar 07, 2019, 09:55 PM

What happens if the context is offline, you go to edit the page in the Manager, and then click on the "View" button at the upper right?

I'll get redirected to the site_unavailable_page.

Best,
Simon

EDIT: I installed the Login Extra to be sure, that I'm logged in to the context in the frontend.
I switched the context to on, logged in and turned the context off - after this it works as expected. It seems like the session doesn't include subdomains (without having a look at it).]]>
simonh Mar 08, 2019, 06:42 AM https://forums.modx.com/thread/104952/context-problems#dis-post-564342
<![CDATA[Re: ACL Context problems (Best Answer)]]> https://forums.modx.com/thread/104952/context-problems#dis-post-564336 If I try to view a page in the frontend while I'm logged in as admin while the page is OFFLINE (site_status of the context = No), I only can view the error page.
Logged in *where* as the admin?

If you're logged in to the Manager and view the front end, you're still logged into the 'mgr' context, but you're not logged in to the front-end context unless you explicitly log in there. Your status when not logged in to the front-end context is somewhat ambiguous.

What happens if the context is offline, you go to edit the page in the Manager, and then click on the "View" button at the upper right?

TBH, I'm not sure what the expected behavior is for Manager users viewing pages of a site that's off-line.

If nothing else works, you could leave the site on-line and create a custom snippet that would redirect most users (but not you) to the error page when a certain System Setting (created by you - you could call it maintenance_mode) was set.

]]>
BobRay Mar 07, 2019, 09:55 PM https://forums.modx.com/thread/104952/context-problems#dis-post-564336