Dear members,
I found I script here to get the name of the group of a"not logged in" user
<?php
$userid= $GET['userid'];
$user = (!empty($userId)) ? $modx->getObject('modUser', $userId) : $modx->user;
if (is_object($user)) {
$modx->toPlaceHolder('usr.toJSON', $user->toJSON());
$profile = $user->getOne('Profile');
$arry = $user->getUserGroupNames();
$modx->toPlaceHolder('usr.groupnames', $arry[0]);
}
By using the placeholder
[[+usr.groupnames]]
the placeholder seems to return MY groupname (Administrator), instead I want the groupname of userid=x which is definitely found in the link-string so something goes wrong and I dont know what. Any suggestions?