Hi, I have used this similar setup, and my redirect works (thanks to everyone above), but the URL in the window stays at the login page url instead of the url of the page I am redirecting to. Anyone know why this is the case? Here is my snippet that I am using:
<?php
$username = $hook->getValue('username');
$pageId = '354';
switch ($username) {
case 'Cablevision':
$pageId = '407';
break;
case 'Cableone':
$pageId = '405';
break;
}
$landingPage = $modx->makeUrl($pageId, "", "", 'full');
$modx->sendRedirect($landingPage);
Thanks
Anthony
Quote from: BobRay at Nov 28, 2011, 02:47 PMTry putting this as line 3:
die( ' Username: ' . $username);
You may have to use one of these:
$username = $hook->getValue('username');
$username = $hook->getValue('login.username');
Also, always generate a full URL with makeUrl():
$landingPage = $modx->makeUrl($pageId, "", "", 'full');
[ed. note: [email protected] last edited this post 10 years, 6 months ago.]