If a user isn't authorized to see a page, it doesn't exist for the user as far as MODX is concerned, so you always get the "page-not-found" page.
There are two solutions:
The easiest, IMO, is to just put this snippet in the template for those pages:
<?php
/* CheckStatus snippet */
if (! $modx->user->hasSessionContext($modx->context->get('key'))) {
$modx->sendUnauthorizedPage();
}
return "";
If you'd rather not use the unauthorized page, you can do it this way (where $loginId is the ID of the Login page):
[[!CheckStatus? &loginId=`12`]]
<?php
/* CheckStatus snippet */
if (! $modx->user->hasSessionContext($modx->context->get('key'))) {
$url = $modx->makeUrl($scriptProperties['loginId'], "", "", "full");
$modx->sendRedirect($url);
}
return "";
The other solution is described here
http://bobsguides.com/revolution-permissions.html (see the "Unauthorized Versus Error Page" section).
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 5 months ago.]