how can I retrieve the name of the logged in user and respective webgroup?
-
☆ A M B ☆
- 24,524 Posts
It’s in the SESSION, and there are API functions to retrieve the information.
http://wiki.modxcms.com/index.php/API:DocumentParser
You can see the SESSION array settings here:
http://www.sottwell.com/article-sessions.html
I used getUserDocGroups() but could only retrieve the ID.
-
☆ A M B ☆
- 24,524 Posts
You’ll need to use that ID to query the database (the webgroup_names table) to get the name of the webgroup by its ID.
Users can belong to more than one group; perhaps your purpose would be better served by using the isMemberOfWebGroup API function. You could use this in a switch statement to deal with doing different things for different groups.
http://wiki.modxcms.com/index.php/API:isMemberOfWebGroup