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