We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You must opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
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

Topic revision: r4 - 12 Mar 2003 - 06:36:20 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback