Environment
- TWiki running on Apache HTTP server (or any CGI container)
- User authentication is done by Apache HTTP server (or the CGI container) and the authenticated IDs are login names, lowercase alphanumeric string up to 8 characters long
- A custom user mapping handler is used and canonical user IDs are login names preceded by "CM_"
- login names to wikinames mapping is provided by the custom user mapping handler
- Jane Smith's login name is janes, cUID CM_janes, wikiname JaneSmith
- Solar.PlanetMercury was saved by Jane Smith a long time ago when cUIDs weren't there. It's recorded as JaneSmith's rather than CM_janes's
Symptom
TWiki::Func::getRevisionInfo('Solar', 'PlanetMercury') returns JaneSmith as the user who saved it. After that, TWiki::Func::wikiToLoginName('JaneSmith') returns a null string.
Background
Before canonical user IDs (cUIDs) were introduced, wikinames were like those and RCS operations were conducted under the name of wikinames. Meanwhile, TWiki::Store::getRevisionInfo() has been returning the user identity recorded in RCS as it is. As such, with a topic saved before the introduction of cUIDs and haven't updated since, TWiki::Store::getRevisionInfo() returns a wikiname instead of a cUID.
The cause of the problem
TWiki::Func::getRevision() calls TWiki::Store::getRevisionInfo() and then calls TWiki::Users::getWikiName() to convert the user identity to a wikiname. Because TWiki::Users::getWikiName() assumes cUID, if it's given a wikiname, it ends up contaminating the mapping cache between login names and wikinames.
How to fix it
Call TWiki::Func::getWikiName() instead of TWiki::Users:getWikiName().
--
TWiki:Main/HideyoImazu
- 2013-04-23
Even though there is one check-in recorded here, as of 2014-10-05, {trunk,TWikiRelease06x00}/core/lib/TWiki/Func.pm are identical.
--
TWiki:Main.HideyoImazu
- 2014-10-05