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

Item6542: User registration fails to save email in user topic

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Registration Normal New   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


At our site we usethe following settings:

$TWiki::cfg{PasswordManager} = 'none';

$TWiki::cfg{Register}{AllowLoginName} = 1;

Authentication is configured in apache and uses Kerberos.

When a member of TWikiAdminGroup registers a user this apparently succeeds but displays

an oops (see also bug 6541). The oops comes from a subtle caching bug in TWiki and is

triggered when TWiki::UI::Register::complete() stores the email address

using $users->setEmails().

What happens is that at some point in the call tree of complete() the function

TWiki::Users::getWikiName() is called with the wiki name of the user

as cUID. This is wrong of course, it should be called with the login. This call

uses the code at the end of getWikiName() which computes $cUID and

$wikiname to be the same and caches that fact.

When TWiki::Users::TWikiUserMapping::mapper_setEmails()

wants to store the email as the user it will fail because access control checks will use the

cached user entry and fails to look up the correct login for the wiki name.

There are several ways to fix this and I leave it to the wise to decide which is best in the long run:

  • Do not cache the data generated by the fallback code path in getWikiName().
  • Fixing setEmails() that it saves the information as TWikiRegistrationAgent and not as the user.
  • Flushing the cached user credentials at the end of TWiki::expandVariablesOnTopicCreation().
The third option is what I chose. I added

$this->{users}->{cUID2WikiName} = {};

$this->{users}->{cUID2Login} = {};

before the final return. This is ugly but I got rid of the oops.

Oh, and please remove that note in expandVariablesOnTopicCreation() about the user change

being safe because it obviously isn't in something as comples as TWiki.

-- TWiki:Main/StefanWalter - 2010-08-17

Summary User registration fails to save email in user topic
ReportedBy TWiki:Main.StefanWalter
Codebase 5.0.0
SVN Range TWiki-5.0.0, Tue, 06 Jul 2010, build 19208
AppliesTo Engine
Component Registration
Priority Normal
CurrentState New


TargetRelease n/a

Topic revision: r1 - 2010-08-17 - StefanWalter
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback