Tags:
create new tag
view all tags

Question

In the previous version, in register.tmpl, I could do:

set ALLOWTOPICCHANGE = Main.%NEWWIKINAME%

to automatically protect new users pages to themself only.

I can't figure out how to do the same thing with NewUserTemplate ...

NEWWIKINAME seems to be gone... ??? Help ... ???

-- TomOehser - 07 Mar 2003

Answer

There must be a misunderstanding, NEWWIKINAME was never in a TWiki distribution. Try:

* Set ALLOWTOPICCHANGE = %WIKIUSERNAME%

FWIW, I do not recommend to restrict access to the user home pages, collaboration works best if there are as few roadblocks as possible. Read "An Important Control Consideration" in TWiki.TWikiAccessControl

-- PeterThoeny - 09 Mar 2003

Answer to Answer

The problem is, if I use

* Set ALLOWTOPICCHANGE = %WIKIUSERNAME%

in the NewUserTemplate, it doesn't get expanded into the wiki name they are currently registering, it just goes in as %WIKIUSERNAME%, which expands if you look at the user page to whatever id is viewing it. I want it to be expanded during registration to whatever the new wiki name being created is.

My old version of twiki had something in register that said:

$text =~ s/%NEWWIKINAME%/$wikiName/go;

Which I must have put in for this very problem.

For me, even if every other page in the place is wide open, I want a user's own wiki name page to default to being editable only by them.

Does this look OK, in register, allowing NEWWIKINAME in ALLOWTOPICCHANGE?


        $text = "$before$after";

# added by Tom Oehser
        $text =~ s/%NEWWIKINAME%/$wikiName/go;

        $meta->put( "TOPICPARENT", ( "name" => $TWiki::wikiUsersTopicname ) );
        &TWiki::Store::saveTopic( $webName, $wikiName, $text, $meta, "", 1 );

-- TomOehser - 11 Mar 2003

See Codev.ExpandVariablesInNewUserTemplate

-- PeterThoeny - 12 Mar 2003

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2003-03-12 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.