This is another artefact of TWiki thinking it uses the default TWikiUserMapping. There's no reason
to prepend
Main
to TWikiGroups coming from LDAP.
So given you are member of some LDAP group called
company_security_team
then
%USERINFO{format="$groups"}%
will return
Main.company_security_team
... which it shouldn't. It should just return
company_security_team
and no more.
The error is in the
TWiki::_USERINFO()
function which hard-codes the call to
TWiki::User::webDotWikiName()
.
Here's the patch:
$info =~ s/\$emails/$emails/g;
}
if ($info =~ /\$groups/) {
- my @groupNames = map {$_->webDotWikiName();} $user->getGroups();
+ my @groupNames = map {$_->wikiName();} $user->getGroups();
my $groups = join(', ', @groupNames);
$groups .= ' isAdmin()' if $user->isAdmin();
$info =~ s/\$groups/$groups/g;
Probably needs some testcase adjustments.
--
TWiki:Main/MichaelDaum
- 02 Apr 2007
%GROUPS was also prepending the web name, so needed a similar fix.
CC