You are here: Foswiki>Tasks Web>Item11619 (06 Jul 2015, GeorgeClark)Edit Attach

Item11619: USERINFO does not work for BaseUserMapping IDs

pencil
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: major
Applies To: Engine
Component: FoswikiUsers, USERINFO
Branches: Release01x01 trunk
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
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: r10 - 06 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy