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

Our whole TWiki site is going to be authenticated, so I'll always have $ENV{REMOTE_USER} set.

In this case, TWikiRegistration fails to properly update the users list TWikiUsers but correctly creates the user topic from the wiki name.

I haven't fully understood what's going on, this is how far I got:

  1. Rather early in the bin/register process TWiki::Users::findUser is called with the login name (as from $ENV{REMOTE_USER}) as $name and an undefined $wikiname.
  2. TWiki::Users::findUser tries to get the $wikiname from its user cache and then from TWikiUsers, which all fails since the user is just about to register.
  3. At the end of findUser it says:
    unless( $wikiname ) {
        # default to wikiname being the same as name.
        $this->{session}->writeWarning("$name does not exist in TWikiUsers - is this a bogus user?") unless( $name =~ /Group$/ );
        $wikiname = $name;

    return $this->_createUser( $name, $wikiname );
...hereby creating a user with explicitly having set $wikiname to $name.
  1. During TWiki::UI::Register::finish processing it does a _newUserFromTemplate with the query data (including the correct $wikiname)
  2. Then it calls findUser again, passing both $name and $wikiname.
  3. findUser however ignores $wikiname if it finds an entry for $name in the cache - which it has created itself in step 3.
  4. This cache entry still has $wikiname set to $name, and this is how the entry is created in TWikiUsers.

If /bin/register doesn't get $ENV{REMOTE_USER} from Apache, then the first call to TWiki::Users::findUser returns the entry for guest instead of creating one for the login userid, and no problem occurs.

-- TWiki:Main.HaraldJoerg

I'll try to get time over the weekend to look at this.

-- MC

I put in what should be a fix, but this needs confirmation from Harald that is does what is expected. Thanks Harald, for the excellent analysis above!

SVN 6770


Sorry, took some time, I'm not at all familiar with subversion.... but eventually I managed to grab lib/TWiki/UI/Register.pm and lib/TWiki/Users.pm and applied the patches therein to my installation. It is sooo easy once you've found the link. And I can confirm: Yes, with your fix applied the registration is OK, and TWikiUsers looks fine as well. Thanks! -- TWiki:Main.HaraldJoerg

Summary Dakar Beta1: TWikiRegistration doesn't work if bin/register is Apache-authenticated
ReportedBy TWiki:Main.HaraldJoerg
AppliesTo Engine
Priority Urgent
CurrentState Closed

Checkins 6770 6773
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r8 - 2005-10-05 - HaraldJoerg
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback