Forked from goldsky/login.redirect.usergroups.plugin.php
Last active
August 29, 2015 14:17
-
-
Save Kokil/576f591bcffba1899ede to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($modx->event->name !== 'OnWebLogin') | |
return; | |
$usergroups = $user->getUserGroupNames(); | |
if(empty($usergroups)) | |
return; | |
switch (TRUE) { | |
case in_array('Web Administrators', $usergroups): | |
$_REQUEST['redirectBack'] = '14'; | |
break; | |
case in_array('Platinum Members', $usergroups): | |
$_REQUEST['redirectBack'] = '19'; | |
break; | |
case in_array('Gold Members', $usergroups): | |
$_REQUEST['redirectBack'] = '16'; | |
break; | |
case in_array('Silver Members', $usergroups): | |
$_REQUEST['redirectBack'] = '18'; | |
break; | |
default: | |
$_REQUEST['redirectBack'] = '1'; | |
break; | |
} | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment