Groups?
Permalink$u = new User();
$loggedIn = $u->checkLogin();
if($loggedIn) {
$groups = $u->getUserGroups();
if(count($groups) > 0) {
for($i = 0; $i < count($groups); $i++) {
echo $groups[$i] . "<br>";
}
}
}
This returns (in this users's case) "Guest" and "Registered Users", but not "Client", which is the custom group that I created and this user belongs to. Is there something that I have to do in order to get C5 to recognize a user's custom group membership? If I can only return C5 default groups (i.e. Administrator, etc.) from this method, that seems very limited, but I am sure that I am just missing something.
Thanks in advance.
$g = Group::getByID($gID); if ($u->inGroup($g)){ // in group }
http://www.concrete5.org/documentation/developers/system/events...
-Steve
http://www.concrete5.org/marketplace/addons/login-attribute-redirec...
Your code appears about right for listing groups, so maybe double check the user you are testing is in the group.
On the overall logic, do you always want to send them to the redirected page? or just immediately after they log in?