*** bin/save.orig Sun Feb 24 00:22:31 2002 --- bin/save Sun Feb 24 00:45:18 2002 *************** *** 35,40 **** --- 35,41 ---- my $theRemoteUser = $query->remote_user(); my $theTopic = $query->param( 'topic' ); my $theUrl = $query->url; + my $saveaction = $query->param( 'action' ); ( $topic, $webName, $dummy, $userName ) = &TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query ); *************** *** 76,81 **** --- 77,86 ---- my $text = $query->param( "text" ); my $unlock = $query->param( "unlock" ) || ""; my $dontNotify = $query->param( "dontnotify" ) || ""; + if ( $saveaction eq "Checkpoint" ) { + $dontNotify = "checked"; + $unlock = ""; + } # PTh 06 Nov 2000: check if proper use of save script if( ! ( defined $text ) ) { *************** *** 129,134 **** --- 134,156 ---- my $url = &TWiki::getOopsUrl( $webName, $topic, "oopssaveerr", $error ); TWiki::redirect( $query, $url ); } else { + if( $saveaction eq "Checkpoint" ) { + my $editURL = &TWiki::getScriptUrl( $webName, $topic, "edit" ); + my $randompart = &randomURL(); + TWiki::redirect( $query, "$editURL|$randompart" ); + } else { TWiki::redirect( $query, &TWiki::getViewUrl( "", $topic ) ); + } } + } + + ## Random URL: + # returns 4 random bytes in 0x01-0x1f range in %xx form + # ========================= + sub randomURL + { + my (@hc) = (qw (01 02 03 04 05 06 07 08 09 0b 0c 0d 0e 0f 10 + 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f)); + # srand; # needed only for perl < 5.004 + return "%$hc[rand(30)]%$hc[rand(30)]%$hc[rand(30)]%$hc[rand(30)]"; }