How are you relating users with their pages, is that something you would configure manually for each?
Do they register themselves or are you setting them up?
Your snippet code is a little off, you’re looking for something more like this (untested):
<?php
$username = $hook->getValue('username');
switch ($username) {
case 'Josh' :
$pageid = '4'; // Josh's login page
break;
case 'Michael' :
$pageid = '12'; // Michael's login page
break;
case 'Kate' :
$pageid = '14'; // Kate's login page
break;
}
$userpage = $modx->makeUrl($pageid);
$modx->sendRedirect($userpage);
Ideally you wouldn’t have to manually set the pages in the snippet; there should be some kind of relationship between each user and their login page that we can access via modx.
Do users register themselves or are you setting them up? Is there a profile field or similar where the login page id is held?