| TWiki version: | TWikiRelease01Sep2004 |
| TWiki plugins: | DefaultPlugin, EmptyPlugin, InterwikiPlugin |
| Server OS: | |
| Web server: | |
| Perl version: | |
| Client OS: | |
| Web Browser: |
onlynewtopic flag and also for onlywikiname flag is now in SVN.
Index: Save.pm
===================================================================
--- Save.pm (revision 1740)
+++ Save.pm (working copy)
@@ -76,12 +76,32 @@
my $dontNotify = $query->param( "dontnotify" ) || "";
my $changeform = $query->param( 'submitChangeForm' ) || "";
my $theParent = $query->param( 'topicparent' ) || "";
+ my $onlyWikiName = $query->param( 'onlywikiname' ) || "";
+ my $onlyNewTopic = $query->param( 'onlynewtopic' ) || "";
my $formTemplate = $query->param( "formtemplate" );
+ my $topicExists = TWiki::Store::topicExists( $webName, $topic );
+
return 0 unless TWiki::UI::webExists( $webName, $topic );
return 0 if TWiki::UI::isMirror( $webName, $topic );
+ # Prevent saving existing topic?
+ if( $onlyNewTopic && $topicExists ) {
+ # Topic exists and user requested oops if it exists
+ TWiki::UI::oops( $webName, $topic, "createnewtopic" );
+ return 0;
+ }
+
+ # prevent non-Wiki names?
+ if( ( $onlyWikiName )
+ && ( ! $topicExists )
+ && ( ! ( &TWiki::isWikiName( $topic ) || &TWiki::isAbbrev( $topic ) ) ) ) {
+ # do not allow non-wikinames, redirect to view topic
+ TWiki::UI::redirect( TWiki::getViewUrl( $webName, $topic ) );
+ return 0;
+ }
+
my $wikiUserName = TWiki::userToWikiName( $userName );
return 0 unless TWiki::UI::isAccessPermitted( $webName, $topic,
"change", $wikiUserName );
-- PeterThoeny - 16 Sep 2004| ChangeProposalForm | |
|---|---|
| TopicClassification | BugReport |
| TopicSummary | Direct save is not honoring the onlynewtopic and onlwikiname flags |
| CurrentState | MergedToCore |
| OutstandingIssues | |
| RelatedTopics | |
| InterestedParties | KarenAiken |
| ProposedFor | DakarRelease |
| TWikiContributors | PeterThoeny |
| HasPriority | 100 |