Hi All,
We are using dotCMS 1.7a and I am having difficulty getting the email addresses of users in the Administrator role.
This SQL works:
select user_.emailaddress
from user_
INNER JOIN users_roles
ON users_roles.userid = user_.userid
INNER JOIN role_
ON users_roles.roleid = role_.roleid
where role_.name = 'Administrator';
But this Velocity code doesn't:
<p>Start</p>
#set($found = $cmsuser.searchUsersAndUsersProxy(null, null, null, [], true,
["Administrator"], true, null, 1, 0))
<p>Finish</p>
<p>Found: $found [$found.size()].</p>
#set($theUsers = $found.get("users"))
<p>Got theUsers: $theUsers [$theUsers.size()].</p>
The output of the above code is:
Start
Finish
Found: {total=22, usersProxy=[], users=[], groupNames=[], roleNames=[]} [5].
Got theUsers: [] [0].
What is going wrong? Any help would be most appreciated!
Rob :)