Tutorial :Grabbing a user_group in MODx



Question:

Currently I have a Client login area. In this 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?


Solution:1

$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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »