r4 - 13 Mar 2006 - 20:44:48 - RafaelAlvarezYou are here: TWiki >  Codev Web > AutomaticHomePageProtection
Tags:
cruft 1 Add my vote for this tag, , create new tag
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

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
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 SourceForge.net Logo