Tags:
create new tag
, view all tags
The patch below fixes three issues in the ManageCgiScript pulled from cvs on 30Jul2002:

  • Missing support for useRcsDir variable in TWiki.cfg.
    • Added new code that checks to see if $TWiki::useRcsDir is non-zero and create RCS subdir. Not tested since I haven't (as yet) crafted a proper url for manage.
  • Double my declaration on $siteMapList
    • Eliminated the second my declaration just making it a normal assigment. This suppresses the error: [Tue Jul 30 18:56:58 2002] manage: "my" variable $siteMapList masks earlier declaration in same scope at data/www/twiki/bin/manage line 244.
  • Missing check for valid value of $newWeb when creating a new web without specifying all the parameters.
    • added default initalization to null string for all variables initalized from URL. I am not positive that this bug needs to be fixed, but the error: [Tue Jul 30 18:56:58 2002] manage: Use of uninitialized value in string eq at /data/www/twiki/bin/manage line 40. is annoying to say the least.

Index: manage
===================================================================
RCS file: /twiki/src/cvsroot/twiki/bin/manage,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 manage
*** manage   24 May 2002 23:42:35 -0000   1.1.1.2
--- manage   31 Jul 2002 20:22:44 -0000
***************
*** 65,81 ****
  #=========================
  sub createWeb
  {
!     my $thePathInfo = $query->path_info(); 
!     my $theRemoteUser = $query->remote_user();
!     my $theTopic = $query->param( 'topic' );
!     my $newWeb = $query->param( 'newweb' );
!     my $newTopic = $query->param( 'newtopic' );
!     my $baseWeb = $query->param( 'baseweb' );
!     my $webBgColor = $query->param( 'webbgcolor' );
!     my $siteMapWhat = $query->param( 'sitemapwhat' );
!     my $siteMapUseTo = $query->param( 'sitemapuseto' );
!     my $noSearchAll = $query->param( 'nosearchall' );
!     my $theUrl = $query->url;
      my $oopsTmpl = "oopsmngcreateweb";
  
      # initialize TWiki
--- 65,81 ----
  #=========================
  sub createWeb
  {
!     my $thePathInfo = $query->path_info() || ""; 
!     my $theRemoteUser = $query->remote_user() || "";
!     my $theTopic = $query->param( 'topic' ) || "";
!     my $newWeb = $query->param( 'newweb' ) || "";
!     my $newTopic = $query->param( 'newtopic' ) || "";
!     my $baseWeb = $query->param( 'baseweb' ) || "";
!     my $webBgColor = $query->param( 'webbgcolor' ) || "";
!     my $siteMapWhat = $query->param( 'sitemapwhat' ) || "";
!     my $siteMapUseTo = $query->param( 'sitemapuseto' ) || "";
!     my $noSearchAll = $query->param( 'nosearchall' ) || "";
!     my $theUrl = $query->url || "";
      my $oopsTmpl = "oopsmngcreateweb";
  
      # initialize TWiki
***************
*** 167,172 ****
--- 167,178 ----
          return( "Could not create $dir, error: $!" );
      }
  
+     if ( $TWiki::useRcsDir != 0 ) {
+    unless( mkdir( "$dir/RCS", 0775 ) ) {
+        return( "Could not create $dir/RCS, error: $!" );
+    }
+     }
+ 
      unless( open( FILE, ">$dir/.changes" ) ) {
          return( "Could not create changes file $dir/.changes, error: $!" );
      }
***************
*** 241,247 ****
      my( $meta, $text ) = &TWiki::Store::readTopic( $theWeb, $theTopic );
  
      my $siteMapList = "";
!     my $siteMapList = "on" if( $theSiteMapWhat );
      $text =~ s/(\s\* Set WEBBGCOLOR =)[^\n\r]*/$1 $theWebBgColor/os;
      $text =~ s/(\s\* Set SITEMAPLIST =)[^\n\r]*/$1 $siteMapList/os;
      $text =~ s/(\s\* Set SITEMAPWHAT =)[^\n\r]*/$1 $theSiteMapWhat/os;
--- 247,253 ----
      my( $meta, $text ) = &TWiki::Store::readTopic( $theWeb, $theTopic );
  
      my $siteMapList = "";
!     $siteMapList = "on" if( $theSiteMapWhat );
      $text =~ s/(\s\* Set WEBBGCOLOR =)[^\n\r]*/$1 $theWebBgColor/os;
      $text =~ s/(\s\* Set SITEMAPLIST =)[^\n\r]*/$1 $siteMapList/os;
      $text =~ s/(\s\* Set SITEMAPWHAT =)[^\n\r]*/$1 $theSiteMapWhat/os;

-- JohnRouillard - 31 Jul 2002

Cleaned up, in TWikiAlphaRelease at CVS:bin/manage.

-- PeterThoeny - 02 Aug 2002

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2002-08-04 - MartinCleaver
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.