I found these in output filters, are these more reliable, can they be used to redirect??
isloggedin Returns true if user is authenticated in this context. [[+modx.user.id:isloggedin]]
isnotloggedin Returns true if user is not authenticated in this context. [[+modx.user.id:isnotloggedin]]
Is it possible the problem is that it's a different context than 'web'??
-
☆ A M B ☆
- 3,141 Posts
Quote from: TomMLS at Jan 22, 2012, 02:08 PMThen it should be checked -- these are to be private pages.
If you check them, the snippet you put on it will never execute cause the page will be sent to the unauthorized page by MODX when the user doesn't have access to it, based on your ACL set up.
if ($modx->userLoggedIn()) {
//do something
How in php do I make the above IF statement an if NOT -- where does the bang go??
Does modx have a redirect to page that is redirect to a specific page??
Thank you...
if (!$modx->userLoggedIn()) {
-
☆ A M B ☆
- 3,141 Posts
Quote from: TomMLS at Jan 22, 2012, 02:11 PMI found these in output filters, are these more reliable, can they be used to redirect??
isloggedin Returns true if user is authenticated in this context. [[+modx.user.id:isloggedin]]
isnotloggedin Returns true if user is not authenticated in this context. [[+modx.user.id:isnotloggedin]]
Those output filters probably wrap the function are you using right now.
You cannot (easily) redirect from an output filter.
-
☆ A M B ☆
- 3,141 Posts
Quote from: TomMLS at Jan 22, 2012, 02:14 PMIs it possible the problem is that it's a different context than 'web'??
That's why you're getting the current context in the snippet you posted, and using that to check.
-
☆ A M B ☆
- 3,141 Posts
Nah if those packages installed normally it just means the transport packages aren't in core/packages, most likely an issue with the Articles build script.
I think the problem is that you have no access to the page or resource you're requesting, and that because of that you're being sent to the unauthorized or error page. See "Unauthorized Versus Error Page" on
http://bobsguides.com/revolution-permissions.html
-
☆ A M B ☆
- 3,141 Posts
It's not that difficult, but I think you're in too much of a rush to let it sink in and understand what Bob writes in the book and what has been said on this topic.
I also think you didn't set an unauthorized page through the system or context settings.
If #63 is protected, and you gave the "anonymous" user group access to "load" your resource group, the user who is not logged in will be forwarded to the unauthorized_page which should not be protected and probably needs a login form.