I want any user who isn't the master user to be redirected to a separate page at /profiles
.
I've achieved this by editing the admin sprinkle, adding this simple statement to the pageDashboard
function in AdminController.php:
if(!$currentUser->isMaster()){
header("Location: /profiles");
exit;
}
I want to move this to my own sprinkle, but I'm not clear on how best to do this. Would I create my own controller that extends AdminController, and just replace the function? Or is there a neater way of doing it? What I have now works but obviously isn't future-proof as this file will be overwritten in future updates.