From: Rob H. <for...@us...> - 2001-11-24 11:34:48
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv3300/bin Modified Files: sandweb.cgi Log Message: hooked create_file, create_folder and checkout to their respective backends. there seems to be a bug with location that makes create_file and create_folder not very useful. checkout is basically a stub. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.70 retrieving revision 1.71 diff -U2 -r1.70 -r1.71 --- sandweb.cgi 2001/11/24 09:46:03 1.70 +++ sandweb.cgi 2001/11/24 11:34:45 1.71 @@ -330,10 +330,4 @@ my $file_type; - if ($filename) { - if (! -f "$location/$filename" ) { - set_error = "File does not exist!"; - browse_menu(); - } - } my $file = SandWeb::File->new( @@ -342,4 +336,10 @@ ); if ( $command eq 'info' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } print header; print '<pre>'; @@ -350,4 +350,10 @@ } elsif ( $command eq 'view' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } unless ( $file->get_file_type() eq "Text" ) { $error = "This does not appear to be a text file."; @@ -375,4 +381,10 @@ } elsif ( $command eq 'edit' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } unless ( $file->get_file_type() eq "Text" ) { $error = "This does not appear to be a text file."; @@ -434,4 +446,12 @@ exit 0; } + elsif ( $command eq 'created_file' ) { + $file->create_file(); + browse_menu(); + } + elsif ( $command eq 'created_folder' ) { + $file->create_folder(); + browse_menu(); + } elsif ( $command eq 'upload' ) { my $content = $ui->upload_file( @@ -450,8 +470,28 @@ exit 0; } + elsif ( $command eq 'checkout' ) { + my $content = $ui->get_checkout( + LOCATION => $location, + PROGNAME => $progname, + ); + print header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> 'SandWeb : Checkout', + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => 'checkout file', + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; + } else { $error = "Invalid selection."; } } + +# all VCS actions are caught by this subroutine, and dealt +# with accordingly. The Repository object is created and used. +# sub vcsaction { |