TWiki::User doesn't offer a way to get a list of users. That's a shame, because this is the only way I have of mapping from an email address back to a User object, which is needed in
MailInContrib.
Propose adding this:
sub getListOfWikiNames {
my $this = shift;
$this->{usermappingmanager}->cacheTWikiUsersTopic();
return keys $this->{W2U};
}
Arguably this should be exposed via Func as well.
I think it's important to do this before Sven goes too far with user mappings; otherwise he may make it impossible.
CC
agreed - I did already add %ALLUSERS%, but its not quite functional - as I'm frightened what it would do on a large site
on IRC CC mentioned that he really needed a TWiki::Users->findUserByEmail()
SD
That's right, I do need findUserByEmail; but I now find (in a different application) that I
also need a list of all registered users. Actually I need a full suite of user access functions, to determine group memberships etc. IIRC Meredith is also crying out for this. All it would take is the following additions to the
TWiki::Func
interface:
-
findUser( opts ) -> $user
where opts can be wikiname => $wn
or email => $em
or login => $ln
- basically anything that uniquely identifies the user.
-
getListOfUsers -> @userObjects
- let's stop pissing about with login names and just let the Func interface know about the user object
-
getListOfGroups -> @userObjects
-
getCurrentUser -> $userObject
I think the User object declares everything else I might need.
CC
I implemented Plugins:FuncUsersContrib as a demonstrator of this API, and soi I can use the functions with TWiki-4
CC