I'm looking for a solution to get all user's groups and roles in my manager's custom page.
I can retrieve all users who belongs to a group but not the entire groups.
Any suggestions?
Thanks
-
☆ A M B ☆
- 3,141 Posts
If using ExtJS you can use the modx-combo-usergroups xtype.
Otherwise, just use something along these lines:
<?php
$data = array();
foreach ($modx->getIterator('modUserGroup') as $ug) {
$data[] = $ug->toArray();
}
var_dump($data);
I'm not clear on what you want. To you want the groups that a user belongs to and his or her role in each group? If so, look at the modUser aliases and the ones for the next two entries here:
http://bobsguides.com/modx-object-quick-reference.html#modUser.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html