Hi guys,
I have a Snippet which checks to see if the user attempting to view a page in a website is currently logged into the MODx Manager as an Administrator. If they are, then they are allowed to view the page, it not they are shown the unauthorised page. This works fine... BUT, the site in question also allows website front end members to login, and if the website Administrator is logged in as a website user as well as being logged into the MODx Manager then this snippet fails, and reports that the user is not logged in as an admin user - it seems the website user is seen before the modx manager data. Any ideas on how to resolve this?
<?php
/* AdminOnly snippet */
if (! $modx->user->isMember('Administrator')) {
$modx->sendUnauthorizedPage();
}