• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item3834: USERINFO{format="$groups"} always returns webDotWikiName identifiers

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   minor 4.2.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

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

ItemTemplate
Summary USERINFO{format="$groups"} always returns webDotWikiName identifiers
ReportedBy TWiki:Main.MichaelDaum
Codebase

SVN Range TWiki-4.1.2, Mon, 26 Mar 2007, build 13227
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:13285
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback