NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item11619: USERINFO does not work for BaseUserMapping IDs

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Enhancement Confirmed Engine FoswikiUsers, USERINFO  
These should return appropriate information, shouldn't they?

cuid

login

wikiname

-- MichaelDaum - 07 Mar 2012

Please add to the USERINFO testcase. test/unit/Fn_USERINFO.pm

Actually I think the issue is in the Mapper and the way that the BaseUserMapper sits along side the installed Mapper. Fixing it in the USERINFO macro would probably not be the right way to go. If USERINFO is wrong, it's because $this->{users}->getLoginName($user); is not returning the right information. I think this is probably related to a much deeper issue identified in Item11578. IMO much too risky for 1.1.5.

-- GeorgeClark - 07 Mar 2012

VarUSERINFO

I don't actually see anything in the docco that indicates what the _DEFAULT can be.

however - looking at the code:

my $cuid = $this->{users}->getCanonicalUserID($user);

Which does not convert a cuid into a cuid.

so - its plausibly working as designed - but needs changing.

The docco in the code and for the macro needs help too.

I think its worked this way since 4.0.3.

several things need to be done:
  1. more information in the docco
  2. unit tests
  3. add a way to convert cuid's into user facing text
  4. an error text - for 'user does not exist' customisation , atm, you get blank string for any error condition

-- SvenDowideit - 08 Mar 2012

added unit tests for current functionality

-- SvenDowideit - 08 Mar 2012

First problem I see is that the call to getMapping() is only checking for the $identifier as a login name, not using it as a WikiNAme or cUID. Strange, so it shouldn't even work for WikiNames? If it does why? Hm.

--- lib/Foswiki/Users.pm        (revision 14214)
+++ lib/Foswiki/Users.pm        (working copy)
@@ -470,7 +470,7 @@
     else {
 
         # See if a mapping recognises the identifier as a login name
-        my $mapping = $this->_getMapping( undef, $identifier, undef, 1 );
+        my $mapping = $this->_getMapping( $identifier, $identifier, $identifier, 1 );

-- MichaelDaum - 08 Mar 2012

that is not where the code should change. Doing so would change (ie break) a lot more things than USERINFO.

-- SvenDowideit - 10 Mar 2012

y

-- MichaelDaum - 10 Mar 2012
 
Topic revision: r8 - 10 Mar 2012, MichaelDaum
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads