Index: lib/TWiki.pm =================================================================== --- lib/TWiki.pm (revision 3249) +++ lib/TWiki.pm (working copy) @@ -49,7 +49,7 @@ $debugFilename $warningFilename $htpasswdFilename $logFilename $remoteUserFilename $wikiUsersTopicname $userListFilename $doMapUserToWikiName - $twikiWebname $mainWebname $mainTopicname $notifyTopicname + $twikiWebname $mainWebname $usersWebname $mainTopicname $notifyTopicname $wikiPrefsTopicname $webPrefsTopicname $statisticsTopicname $statsTopViews $statsTopContrib $doDebugStatistics $numberOfRevisions $editLockTime $scriptSuffix @@ -297,11 +297,13 @@ # tag in the tables below, and either does a literal # expansion or calls the relevant _handle method for # the tag. + %staticInternalTags = ( ENDSECTION => "", HOMETOPIC => $mainTopicname, MAINWEB => $mainWebname, + USERSWEB => $usersWebname, NOTIFYTOPIC => $notifyTopicname, PUBURLPATH => $pubUrlPath, SCRIPTSUFFIX => $scriptSuffix, Index: lib/TWiki.cfg =================================================================== --- lib/TWiki.cfg (revision 3249) +++ lib/TWiki.cfg (working copy) @@ -333,6 +333,8 @@ $siteWebTopicName = ""; # %MAINWEB% : Name of Main web, default "Main" : $mainWebname = "Main"; +# %USERSWEB% : Name of Users web, default "Main" : +$usersWebname = "Main"; # %TWIKIWEB% : Name of TWiki system web, default "TWiki" : $twikiWebname = "TWiki"; # Pathname of debug file : Index: lib/TWiki/User.pm =================================================================== --- lib/TWiki/User.pm (revision 3249) +++ lib/TWiki/User.pm (working copy) @@ -203,7 +203,7 @@ my ( $wikiName, $remoteUser ) = @_; my $today = &TWiki::formatTime(time(), "\$day \$mon \$year", "gmtime"); my $topicName = $TWiki::wikiUsersTopicname; - my( $meta, $text ) = &TWiki::Store::readTopic( $TWiki::mainWebname, $topicName ); + my( $meta, $text ) = &TWiki::Store::readTopic( $TWiki::usersWebname, $topicName ); my $result = ""; my $status = "0"; my $line = ""; @@ -247,7 +247,7 @@ $result .= "$line\n"; } - TWiki::Store::saveTopic( $TWiki::mainWebname, $topicName, $result, $meta, "", 1 ); + TWiki::Store::saveTopic( $TWiki::usersWebname, $topicName, $result, $meta, "", 1 ); return $topicName; } @@ -389,7 +389,7 @@ Translates intranet username (e.g. jsmith) to WikiName (e.g. JaneSmith) -Unless $dontAddWeb is set, "Main." is prepended to the returned WikiName. +Unless $dontAddWeb is set, "$TWiki::usersWebname." is prepended to the returned WikiName. If you give an invalid username, we just return that (no appending Main. blindy) @@ -412,7 +412,7 @@ if( $dontAddWeb ) { return $wUser; } - return "$TWiki::mainWebname.$wUser"; + return "$TWiki::usersWebname.$wUser"; } =pod Index: lib/TWiki/Prefs.pm =================================================================== --- lib/TWiki/Prefs.pm (revision 3249) +++ lib/TWiki/Prefs.pm (working copy) @@ -31,6 +31,7 @@ package TWiki::Prefs; +use TWiki; use TWiki::Prefs::PrefsCache; use vars qw( @@ -86,11 +87,10 @@ sub initializeUserPrefs { my( $theWikiUserName ) = @_; + $theWikiUserName = "$TWiki::userWebName.TWikiGuest" unless $theWikiUserName; - $theWikiUserName = "Main.TWikiGuest" unless $theWikiUserName; - if( $theWikiUserName =~ /^(.*)\.(.*)$/ ) { - $requestPrefs = TWiki::Prefs::PrefsCache->new("request", $webPrefs{$requestWeb}, $TWiki::topicName, $2); + $requestPrefs = TWiki::Prefs::PrefsCache->new("request", $webPrefs{$requestWeb}, $TWiki::topicName, $theWikiUserName); } return; Index: lib/TWiki/Access.pm =================================================================== --- lib/TWiki/Access.pm (revision 3249) +++ lib/TWiki/Access.pm (working copy) @@ -202,7 +202,7 @@ { my( $theUserName ) = @_; - my $userTopic = _getWebTopicName( $TWiki::mainWebname, $theUserName ); + my $userTopic = _getWebTopicName( $TWiki::usersWebname, $theUserName ); my @grpMembers = (); my @listOfGroups = getListOfGroups(); my $group; @@ -232,8 +232,8 @@ { my( $theUserName, $theGroupTopicName ) = @_; - my $usrTopic = _getWebTopicName( $TWiki::mainWebname, $theUserName ); - my $grpTopic = _getWebTopicName( $TWiki::mainWebname, $theGroupTopicName ); + my $usrTopic = _getWebTopicName( $TWiki::usersWebname, $theUserName ); + my $grpTopic = _getWebTopicName( $TWiki::usersWebname, $theGroupTopicName ); my @grpMembers = (); if( $grpTopic !~ /.*Group$/ ) { @@ -266,7 +266,7 @@ my @resultList = (); # extract web and topic name my $topic = $theGroupTopicName; - my $web = $TWiki::mainWebname; + my $web = $TWiki::usersWebname; $topic =~ /^([^\.]*)\.(.*)$/; if( $2 ) { $web = $1; @@ -329,7 +329,7 @@ { my( $theWebName, $theTopicName ) = @_; # SMELL: this is a hack, isn't it? What should really be going on here? - $theTopicName =~ s/%MAINWEB%/$theWebName/go; + $theTopicName =~ s/%USERSWEB%/$theWebName/go; $theTopicName =~ s/%TWIKIWEB%/$theWebName/go; if( $theTopicName =~ /[\.]/ ) { $theWebName = ""; # to suppress warning @@ -346,13 +346,13 @@ { my( $theItems, $expand ) = @_; # comma delimited list of users or groups - # i.e.: "%MAINWEB%.UserA, UserB, Main.UserC # something else" + # i.e.: "%USERSWEB%.UserA, UserB, Main.UserC # something else" $theItems =~ s/(<[^>]*>)//go; # Remove HTML tags # TODO: i18n fix for user name $theItems =~ s/\s*([a-zA-Z0-9_\.\,\s\%]*)\s*(.*)/$1/go; # Limit list my %list; foreach( split( /[\,\s]+/, $theItems )) { - my $e = _getWebTopicName( $TWiki::mainWebname, $_ ); + my $e = _getWebTopicName( $TWiki::usersWebname, $_ ); if ( $expand ) { map { $list{$_} = 1; } getUsersOfGroup( $e ); } else { Index: bin/register =================================================================== --- bin/register (revision 3249) +++ bin/register (working copy) @@ -153,31 +153,8 @@ } } - # send email confirmation - my $skin = $query->param( "skin" ) || TWiki::Prefs::getPreferencesValue( "SKIN" ); - $text = TWiki::Templates::readTemplate( "registernotify", $skin ); - $text =~ s/%FIRSTLASTNAME%/$firstLastName/go; - $text =~ s/%WIKINAME%/$wikiName/go; - $text =~ s/%EMAILADDRESS%/$emailAddress/go; - ( $before, $after) = split( /%FORMDATA%/, $text ); - for( $x = 0; $x < $formLen; $x++ ) { - $name = $formDataName[$x]; - $value = $formDataValue[$x]; - if( ( $name eq "Password" ) && ( $TWiki::doHidePasswdInRegistration ) ) { - $value = "*******"; - } - if( $name ne "Confirm" ) { - $before .= " * $name\: $value\n"; - } - } - $text = "$before$after"; - $text = &TWiki::handleCommonTags( $text, $wikiName ); - $text =~ s/( ?) *<\/?(nop|noautolink)\/?>\n?/$1/gois; # remove and tags - - my $senderr = &TWiki::Net::sendEmail( $text ); - # create user topic if it does not exist - if( ! &TWiki::Store::topicExists( $TWiki::mainWebname, $wikiName ) ) { + if( ! &TWiki::Store::topicExists( $TWiki::usersWebname, $wikiName ) ) { my $meta = ""; my $row = ""; ( $meta, $text ) = TWiki::UI::readTemplateTopic( "NewUserTemplate" ); @@ -199,12 +176,36 @@ $text = "$before$after"; my $userName = $remoteUser || $wikiName; - $text = TWiki::expandVariablesOnTopicCreation( $text, $userName, $wikiName, "$webName.$wikiName" ); + $text = TWiki::expandVariablesOnTopicCreation( $text, $userName, $wikiName, "$TWiki::usersWebname.$wikiName" ); $meta->put( "TOPICPARENT", ( "name" => $TWiki::wikiUsersTopicname ) ); - &TWiki::Store::saveTopic( $webName, $wikiName, $text, $meta, "", 1 ); + &TWiki::Store::saveTopic( $TWiki::usersWebname, $wikiName, $text, $meta, "", 1 ); } + # send email confirmation + my $skin = $query->param( "skin" ) || TWiki::Prefs::getPreferencesValue( "SKIN" ); + $text = TWiki::Templates::readTemplate( "registernotify", $skin ); + $text =~ s/%FIRSTLASTNAME%/$firstLastName/go; + $text =~ s/%WIKINAME%/$wikiName/go; + $text =~ s/%EMAILADDRESS%/$emailAddress/go; + ( $before, $after) = split( /%FORMDATA%/, $text ); + for( $x = 0; $x < $formLen; $x++ ) { + $name = $formDataName[$x]; + $value = $formDataValue[$x]; + if( ( $name eq "Password" ) && ( $TWiki::doHidePasswdInRegistration ) ) { + $value = "*******"; + } + if( $name ne "Confirm" ) { + $before .= " * $name\: $value\n"; + } + } + $text = "$before$after"; + $text = &TWiki::handleCommonTags( $text, $wikiName ); + $text =~ s/( ?) *<\/?(nop|noautolink)\/?>\n?/$1/gois; # remove and tags + my $senderr = &TWiki::Net::sendEmail( $text ); + + + # Plugin callback to set cookies. Contrib by SvenDowideit &TWiki::Plugins::registrationHandler( $webName, $wikiName, $remoteUser ); @@ -213,7 +214,7 @@ # write log entry if( $TWiki::doLogRegistration ) { - TWiki::writeLog( "register", "$webName.$wikiName", $emailAddress, $wikiName ); + TWiki::writeLog( "register", "$TWiki::usersWebname.$wikiName", $emailAddress, $wikiName ); } if( $senderr ) {