Tags:
archive_me1Add my vote for this tag create new tag
, view all tags
Please, add the following line to the registration script, just before saving the user page topic generated:
    # create user topic if not exist
    if( ! &wiki::topicExists( $wiki::mainWebname, $wikiName ) ) {
        $text = &wiki::readTemplate( "register" );
        ( $before, $after) = split( /%FORMDATA%/, $text );
        for( $x = 0; $x < $formLen; $x++ ) {
            $name = $formDataName[$x];
            $value = $formDataValue[$x];
            $value =~ s/[\n\r]/ /go;
            if( ! (    ( $name eq "Wiki Name" )
                    || ( $name eq "Password" )
                    || ( $name eq "Confirm" ) ) ) {
                $before .= "   * $name\: $value\n";
            }
        }
        $text = "$before$after";
#AS to automagically add the proper ALLOWTOPICCHANGE entry
        $text =~ s/TWikiGuest/$wikiName/go; 
#AS
        $text =~ s/ {3}/\t/go;
        &wiki::saveTopic( $wikiName, $text, "" );
    }                                                                           

This will automatically protect the user's page.

This way we can give add to the redister.tmpl the following line:

   * Set ALLOWTOPICCHANGE = %WIKINAME%

-- AndreaSterbini - 10 Nov 2000

I prefer to keep that optional to keep it in line with the WikiCulture. Therefore I added this to the register.tmpl file:

  • Optionally write protect your home page: (set it to your WikiName)
    • Set ALLOWTOPICCHANGE =

Commited to TWikiAlphaRelease.

-- PeterThoeny - 10 Nov 2000

I agree, thanks for the lesson (I mean it!).

-- AndreaSterbini - 13 Nov 2000

Topic revision: r4 - 2006-03-13 - RafaelAlvarez
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.