Hello,
I am trying to build a registration and login system. I have come upon an issue that I'm not sure how to solve. One of the requirements that I have is that the users who do not have required access of an administrator and attempt to access any admin pages or such should get a 404 error. Basically page not found.
I have tried something like this in my _config.php file but that forces the 404 page every time. I need the admins to still be able to log in.
Keep in mind this doesn't check for admins, just checks if you are logged in (meant to be just for testing)
if(!Member::currentUserID() ) {
Director::addRules(30, array(
'admin' => '->page-not-found',
'interactive' => '->page-not-found',
'DevelopmentAdmin' => '->page-not-found',
'DatabaseAdmin' => '->page-not-found',
'db' => '->page-not-found',
));
}