You are here: Foswiki>Tasks Web>Item14369 (01 Jun 2017, GeorgeClark)Edit Attach

Item14369: Document parameters for USERNAME, WIKINAME and WIKIUSERNAME macros.

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.4
Target Release: patch
Applies To: Engine
Component:
Branches: Release02x01 master Item14288
Reported By: VickiBrown
Waiting For:
Last Change By: GeorgeClark
%USERNAME% returns the username of the current user.

It would be convenient if %USERNAME{SomeBody}% would return the username of the user with WIKINAME = SomeBody.

I realize that this information can be gotten from %USERINFO%, but not quite as conveniently.

-- VickiBrown - 03 Apr 2017

Note that not on only USERNAME but also WIKINAME and WIKIUSERNAME should receive the same treatment if at all. While your feature proposal seems and obvious suggestion, please keep in mind that USERINFO combines and supersedes all of the individual macros such as USERNAME, WIKINAME, and WIKIUSERNAME. It is more in line with GROUPINFO as well.

-- MichaelDaum - 04 Apr 2017

Actually these macros are all marked as Deprecated, in Foswiki 1.1.0, and planned to be removed in Foswiki 2.0, and moved to a compatibility plugin. At least that seems to be in the code comments. The way going forward is to use the USERINFO macro. I've not found the feature proposal though where this was announced, and it's not in the release notes. So some work is needed there.

There is a lot of security checking in USERINFO to make sure that inappropriate information does not leak to guests or other users.

-- GeorgeClark - 04 Apr 2017

And... looking at how they are actually implemented. All they are is aliases to USERINFO with an override on the format= parameter. It appears that they will already accept a parameter.
  • %USERNAME{WikiGuest}% guest
  • %WIKIUSERNAME{WikiGnome}% WikiGnome
  • %WIKINAME{guest}% WikiGuest

-- GeorgeClark - 04 Apr 2017

And one more comment. As there seems to have been no formal deprecation announced, and these macros are all widely used, I don't see any real benefit to their deprecation.

I suggest that we remove the deprecation notices from the code, and update the documentation to state that they are aliases for USERINFO with a fixed format, and can take a wikiname or login username as a parameter.

Note that they are also marked as deprecated in the TWiki code, planned for removal in TWiki 5.x. This was done prior to the Foswiki fork.

-- GeorgeClark - 04 Apr 2017

Please remove the plan to deprecate. SImple macros are easier to use.

MIchael - I know about USERINFO. I said so in my original report, but I forgot the <nop>

Also, why would WIKINAME need to be modified? What would it return? %WIKINAME{WikiName}% makes no sense.

-- VickiBrown - 04 Apr 2017

George: "I suggest that we remove the deprecation notices from the code, and update the documentation to state that they are aliases for USERINFO with a fixed format, and can take a wikiname or login username as a parameter."

I love this!

-- VickiBrown - 04 Apr 2017

> > they are also marked as deprecated in the TWiki code, planned for removal in TWiki 5.x.

It didn't happen. wink

-- VickiBrown - 04 Apr 2017

Vicki, WIKINAME{loginName} does make, sense don't you think?

-- MichaelDaum - 04 Apr 2017

Michael - I suppose it might be useful to someone. I wouldn;t complain if it was possible. However, it doesn't make sense to me. smile I'm in the wiki. I have FirstLast as WikiNames. I neither want nor need login names in the wiki,

But when LDAP shoves user login names into the author metadata, I need to convert back.

-- VickiBrown - 05 Apr 2017
 

ItemTemplate edit

Summary Document parameters for USERNAME, WIKINAME and WIKIUSERNAME macros.
ReportedBy VickiBrown
Codebase
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:b081dd9c2831
TargetRelease patch
ReleasedIn 2.1.4
CheckinsOnBranches Release02x01 master Item14288
trunkCheckins
masterCheckins distro:b081dd9c2831
ItemBranchCheckins distro:b081dd9c2831
Release02x01Checkins distro:b081dd9c2831
Release02x00Checkins
Release01x01Checkins
Topic revision: r10 - 01 Jun 2017, 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