• 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.

Item7288: Wikify login name if no user mapper available

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension TWikiUserMappingContrib Enhancement Closed   major 6.0.0

Edit Form Data

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

Detail

Proposed change by TWiki:Main.MichaelBerger2012 in TWiki:Support.LdapAuthenticationHowTo:
The problem in TWiki 5.1.4 is:

  • Login name is "user.name" and TWiki says: username, not UserName.

The fix for this is:

/path/to/your/twiki/lib/Twiki/Users /

diff -uNr a/TWikiUserMapping.pm b/TWikiUserMapping.pm
--- a/TWikiUserMapping.pm       2013-02-17 00:10:50.000000000 +0100
+++ b/TWikiUserMapping.pm       2013-06-27 14:00:18.000000000 +0200
@@ -453,7 +453,9 @@
         if ($wikiname) {
             # sanitise the generated WikiName
             $wikiname =~ s/$TWiki::cfg{NameFilter}//go;
-            $wikiname =~ s/\.//go;
+           $wikiname =~ s/((^\w)|(\.\w))/\U$1/xg;//go;
+           $wikiname =~ s/\.//go;
         }
     }

after this patch, the Username login with user.name is: UserName smile

-- Michael Berger - 2013-07-04

This makes sense. Specifically, if no user mapping manager is available, the login name is now wikified provided it has a first.last pattern.

-- TWiki:Main/PeterThoeny - 2013-07-04

I had to change the patch because it rendered this Bugs web inoperable with error:

Use of uninitialized value in pattern match (m//) at /home/twiki4/twikisvn/core/lib/TWiki/Users/TWikiUserMapping.pm line 457.

-- TWiki:Main.PeterThoeny - 2013-07-05

This is now in SVN trunk and 5.1 branch.

Patch:

--- lib/TWiki/Users/TWikiUserMapping.pm   (revision 26009)
+++ lib/TWiki/Users/TWikiUserMapping.pm   (working copy)
@@ -453,10 +453,12 @@
         if ($wikiname) {
             # sanitise the generated WikiName
             $wikiname =~ s/$TWiki::cfg{NameFilter}//go;
+            # Item7288: Wikify login name if no user mapper available -- MichaelBerger2012
+            $wikiname =~ s/(^|[^\w])(\w)/$1 . uc($2)/ge;
             $wikiname =~ s/\.//go;
         }
     }
-   
+
     return $wikiname;
 }

-- TWiki:Main.PeterThoeny - 2013-07-05

ItemTemplate
Summary Wikify login name if no user mapper available
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4, 5.1.4
SVN Range TWiki-5.1.3-trunk, Thu, 27 Jun 2013, build 26021
AppliesTo Extension
Component TWikiUserMappingContrib
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins TWikirev:26038 TWikirev:26039 TWikirev:26040 TWikirev:26041 TWikirev:26042 TWikirev:26043 TWikirev:26044
TargetRelease major
ReleasedIn 6.0.0
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2013-10-15 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback