Grabbing a user_group in MODx
Currently I have a Client login area. In th开发者_如何学Gois login area I was going to create a snippet that shows certain information for 'Admin' users.
I had a feeling I could use
<?php
if ($modx->getLoginUserType()) {
echo 'hi';
} else {}
?>
However, all User Types are web.
I was also looking around and found a script that prints out web-users of a web-group: http://modxcms.com/forums/index.php/topic,43139.0.html
Any Advice?
$test = $modx->isMemberOfWebGroup( array(
'Editors'
));
if ($test === true) {
// Is a member of the group
} else {
// Is not a member of the group
}
see: http://wiki.modxcms.com/index.php/API:isMemberOfWebGroup
精彩评论