You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(28) |
Nov
(58) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(222) |
Mar
(274) |
Apr
(51) |
May
(22) |
Jun
(50) |
Jul
(15) |
Aug
(33) |
Sep
(11) |
Oct
(29) |
Nov
(17) |
Dec
(1) |
2003 |
Jan
(100) |
Feb
(21) |
Mar
(7) |
Apr
(45) |
May
|
Jun
(43) |
Jul
(27) |
Aug
(24) |
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
(1) |
Feb
|
Mar
(13) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Rob H. <for...@us...> - 2001-12-20 20:29:45
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv17176/lib/SandWeb Modified Files: File.pm Log.pm Log Message: added debugging to the File class Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -U2 -r1.21 -r1.22 --- File.pm 2001/12/20 02:58:02 1.21 +++ File.pm 2001/12/20 20:29:41 1.22 @@ -16,4 +16,5 @@ my $filename = $args{'filename'}; + my $log_obj = $args{'log_obj'}; my $location = $args{'location'}; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, @@ -24,5 +25,5 @@ 'filename' => $filename, 'location' => $location, - 'log_obj' => $log, + 'log_obj' => $log_obj, 'mode' => $mode, 'uid' => $uid, @@ -100,6 +101,13 @@ my $filename = $self->{'filename'}; my $contents = $args{'contents'}; + my $log = $self->{'log_obj'}; - my $return = _do_file_write( 'contents' => "$contents" ); + $log->debug("creating file : $location/$filename"); + my $return = _do_file_write( + 'location' => $location, + 'filename' => $filename, + 'contents' => "$contents", + 'log_obj' => $log, + ); return $return; @@ -112,6 +120,13 @@ my $log = $self->{'log_obj'}; - my $return = mkdir( "$location/$filename", "0336" ); + $log->debug("creating folder : $location/$filename"); + if (mkdir( "$location/$filename", "0336" )) { + $return = 1; + } else { + $log->debug("could not create folder $location/$filename : $!"); + $return = 0; + } + return $return; } @@ -123,4 +138,6 @@ my $log = $self->{'log_obj'}; + $log->debug("removing file : $location/$filename"); + my $return = unlink("$location/$filename" ); @@ -134,4 +151,6 @@ my $log = $self->{'log_obj'}; + $log->debug("removing folder : $location/$filename"); + my $return = rmdir("$location/$filename" ); @@ -147,4 +166,6 @@ my $tofile = $args{'tofile'}; + $log->debug("copying file : $location/$filename to $tofile"); + my $file = SandWeb::File->new( 'location' => "$location", @@ -153,5 +174,10 @@ my @fromfile = _do_file_read(); - _do_file_write( 'contents' => "@fromfile" ); + _do_file_write( + 'filename' => $filename, + 'location' => $location, + 'contents' => "@fromfile", + 'log_obj' => $log, + ); return $return; @@ -165,4 +191,6 @@ my $log = $self->{'log_obj'}; my $tofile = $args{'tofile'}; + + $log->debug("renaming file : $location/$filename to $tofile"); my $return = rename( "$location/$filename", "$tofile" ); @@ -180,4 +208,5 @@ 'location' => "$location", 'filename' => "$filename", + 'log_obj' => $log, ); @@ -199,4 +228,5 @@ 'filename' => "$filename", 'contents' => "$contents", + 'log_obj' => $log, ); @@ -221,8 +251,18 @@ my $filename = $args{'filename'}; my $contents = $args{'contents'}; + my $log = $args{'log_obj'}; + my $return; - open (FILE, ">$location/$filename"); - print FILE $contents; - my $return = close FILE; + if (open (FILE, ">$location/$filename")) { + print FILE $contents; + } else { + $log->debug("error opening $location/$filename for writing: $!"); + } + if (close FILE) { + $return = 1; + } else { + $log->debug("error closing $location/$filename from writing: $!"); + $return = 0; + } return $return; @@ -233,4 +273,5 @@ my $location = $args{'location'}; my $filename = $args{'filename'}; + my $log = $args{'log_obj'}; open (FILE, "< $location/$filename"); Index: Log.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Log.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -U2 -r1.5 -r1.6 --- Log.pm 2001/10/06 07:51:56 1.5 +++ Log.pm 2001/12/20 20:29:41 1.6 @@ -1,6 +1,4 @@ -# SandWeb logging facility. this would use the standard perl -# module for logging stuff -# here is one standard module, do we need any in addition to this? -# http://www.perl.com/pub/doc/manual/html/lib/Sys/Syslog.html +# SandWeb logging facility +# package SandWeb::Log; @@ -39,5 +37,5 @@ my ($caller) = caller(); - $self->_write_to_log("DEBUG: $caller $msg"); + $self->_write_to_log("DEBUG: $caller $msg\n"); $self->_stack_debug("($caller) $msg"); } |
From: Rob H. <for...@us...> - 2001-12-20 02:58:05
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv14791 Modified Files: File.pm Log Message: internal stuff. _do_file_read needs to treat <FILE> as array, not scalar. Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- File.pm 2001/12/20 02:51:13 1.20 +++ File.pm 2001/12/20 02:58:02 1.21 @@ -96,9 +96,10 @@ sub create_file { my $self = shift; + my %args = @_; my $location = $self->{'location'}; my $filename = $self->{'filename'}; - my $log = $self->{'log_obj'}; + my $contents = $args{'contents'}; - my $return = _do_file_write( 'contents' => "test" ); + my $return = _do_file_write( 'contents' => "$contents" ); return $return; @@ -175,5 +176,4 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; - my $log = $self->{'log_obj'}; my $contents = _do_file_read( @@ -182,4 +182,6 @@ ); + + return $contents; } @@ -223,4 +225,5 @@ print FILE $contents; my $return = close FILE; + return $return; } @@ -231,7 +234,9 @@ my $filename = $args{'filename'}; - open (FILE, "<$location/$filename"); - my $contents = <FILE>; - return $contents; + open (FILE, "< $location/$filename"); + my @contents = <FILE>; + close FILE; + + return "@contents"; } |
From: Rob H. <for...@us...> - 2001-12-20 02:51:16
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv12514 Modified Files: File.pm Log Message: ah.. much better :) private methods invoked by public methods. no more creating file objects inside file objects. object orientation kicks ass. Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -U2 -r1.19 -r1.20 --- File.pm 2001/12/20 02:34:46 1.19 +++ File.pm 2001/12/20 02:51:13 1.20 @@ -100,12 +100,6 @@ my $log = $self->{'log_obj'}; + my $return = _do_file_write( 'contents' => "test" ); - my $file = SandWeb::File->new( - 'location' => "$location", - 'filename' => "$filename", - ); - - $file->file_write( 'contents' => "test" ); - return $return; } @@ -157,6 +151,6 @@ ); - my @fromfile = $file->file_read(); - $file->file_write( 'contents' => "@fromfile" ); + my @fromfile = _do_file_read(); + _do_file_write( 'contents' => "@fromfile" ); return $return; @@ -183,7 +177,8 @@ my $log = $self->{'log_obj'}; - open (FILE, "< $location/$filename"); - my $contents = <FILE>; - close FILE; + my $contents = _do_file_read( + 'location' => "$location", + 'filename' => "$filename", + ); return $contents; @@ -196,10 +191,12 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; - my $contents = $args{'contents'}; - open (FILE, ">$location/$filename"); - print FILE $contents; - my $return = close FILE; + my $return = _do_file_write( + 'location' => "$location", + 'filename' => "$filename", + 'contents' => "$contents", + ); + return $return; } @@ -215,4 +212,26 @@ 'download', ); +} + +sub _do_file_write { + my %args = @_; + my $location = $args{'location'}; + my $filename = $args{'filename'}; + my $contents = $args{'contents'}; + + open (FILE, ">$location/$filename"); + print FILE $contents; + my $return = close FILE; + return $return; +} + +sub _do_file_read { + my %args = @_; + my $location = $args{'location'}; + my $filename = $args{'filename'}; + + open (FILE, "<$location/$filename"); + my $contents = <FILE>; + return $contents; } |
From: Rob H. <for...@us...> - 2001-12-20 02:34:48
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv9176 Modified Files: Browse.pm File.pm Log Message: browse doesn't use UI, so it shouldn't have "use SandWeb::UI" at the top ;) Browse just uses HTML::Template to return content to the main CGI, which puts it all together using UI. Also, File now uses itself ( which is, admittedly, weird ). What I probably need to be doing is adding a public method for file_read and file_write, which just call the private methods doing the actual work. hmm.. yeah, that'll be better. I'll do it now. Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -U2 -r1.22 -r1.23 --- Browse.pm 2001/12/18 02:12:06 1.22 +++ Browse.pm 2001/12/20 02:34:46 1.23 @@ -7,5 +7,4 @@ use strict; use lib '../lib'; -use SandWeb::UI; use SandWeb::File; use HTML::Template; Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -U2 -r1.18 -r1.19 --- File.pm 2001/12/20 02:26:24 1.18 +++ File.pm 2001/12/20 02:34:46 1.19 @@ -152,13 +152,11 @@ my $tofile = $args{'tofile'}; - open ( FROM_FILE, "< $location/$filename" ); - my @fromfile = (<FROM_FILE>); - close FROM_FILE; - - open ( TO_FILE, "> $tofile" ); - foreach my $line (@fromfile) { - print TO_FILE "$line"; - } - close TO_FILE; + my $file = SandWeb::File->new( + 'location' => "$location", + 'filename' => "$filename", + ); + + my @fromfile = $file->file_read(); + $file->file_write( 'contents' => "@fromfile" ); return $return; |
From: Rob H. <for...@us...> - 2001-12-20 02:30:39
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv8819 Modified Files: sandweb.cgi Log Message: started adding debugging, when I realized that instead of doing tons of error checking and debugging statements all over the place, this stuff should really be encapsulated and handled by the File class. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.98 retrieving revision 1.99 diff -U2 -r1.98 -r1.99 --- sandweb.cgi 2001/12/18 09:47:14 1.98 +++ sandweb.cgi 2001/12/20 02:30:37 1.99 @@ -75,5 +75,5 @@ # unable to load user with cookie, or cookie expired set_error("unable to get cookie"); - $log->debug("unable to get valid cookie: '$cookie'"); + $log->debug("unable to get valid cookie: '$cookie'\n"); login_menu(); exit 0; @@ -93,4 +93,5 @@ # User is logged in; load prefs load_prefs(1); + $log->debug("loading prefs\n"); my $username = $auth->get_userinfo('username'); @@ -172,5 +173,5 @@ my $page = param('action'); my $msg = "Invalid page - $page!"; - $log->error("$msg"); + $log->error("$msg\n"); set_error("$msg"); debug_menu( cookie => $cookie ); @@ -180,5 +181,5 @@ else { # no cookie, default login_menu - $log->debug("no cookie found: '$cookie'"); + $log->debug("no cookie found: '$cookie'\n"); login_menu(); } @@ -197,4 +198,6 @@ my %args = @_; + $log->debug("entering login menu\n"); + my $content = $ui->get_menu( MENU => 'login', @@ -217,4 +220,7 @@ sub main_menu { my %args = @_; + + $log->debug("entering main menu\n"); + my $cookie = $args{'cookie'}; unless ($cookie) { @@ -227,5 +233,5 @@ } - $log->debug("cookie: '$cookie'"); + $log->debug("cookie: '$cookie'\n"); print header( -cookie => $cookie ); @@ -244,4 +250,7 @@ sub debug_menu { my %args = @_; + + $log->debug("entering debug menu\n"); + my $cookie = $args{'cookie'}; unless ($cookie) { @@ -269,4 +278,7 @@ sub browse_menu { my %args = @_; + + $log->debug("entering browse menu"); + my $cookie = $args{'cookie'}; unless ($cookie) { @@ -290,4 +302,5 @@ if ( $repo_type eq 'CVS' ) { + $log->debug("repo type is CVS, setting up CVSROOT\n"); if ( $connection eq 'local' ) { $vcsroot = "$root"; @@ -297,4 +310,5 @@ } + $log->debug("creating Repository object\n"); my $repository = SandWeb::Repository->new( root => "$vcsroot", @@ -303,4 +317,5 @@ ); + $log->debug("creating Browse object\n"); my $browse = SandWeb::Browse->new( username => $username, @@ -309,5 +324,8 @@ ); - my $file = SandWeb::File->new(); + $log->debug("creating File object\n"); + my $file = SandWeb::File->new( + 'log_obj' => $log, + ); my $username = $auth->get_userinfo('username'); @@ -340,4 +358,6 @@ my %args = @_; + $log->debug("entering file handling routine\n"); + my $cookie = $args{'cookie'}; unless ($cookie) { @@ -352,5 +372,7 @@ my $file_command = $args{'file_command'}; + $log->debug("file command is : $file_command\n"); my $location = $args{'location'}; + $log->debug("location is : $location\n"); my @filename = (); my $count = 0; @@ -360,4 +382,5 @@ } my $filename = "@filename"; + $log->debug("filename(s) : $filename"); my $save = param('save'); my $username = $auth->get_userinfo('username'); @@ -374,4 +397,5 @@ if ( $file_command eq 'remove' ) { unless (@filename) { + $log->debug("no files selected for removal\n"); set_error("Please select file(s) or folder(s) to remove."); browse_menu( @@ -382,10 +406,13 @@ foreach my $entry (@filename) { - + + $log->debug("creating File object"); my $file = SandWeb::File->new( + 'log_obj' => $log, 'filename' => $entry, 'location' => "$users_dir/$username$location", ); + $log->debug("removing file"); if ($file) { if ( $file->get_file_type() eq 'Directory' ) { @@ -404,4 +431,5 @@ if ( $repo_type eq 'CVS' ) { + $log->debug("repo type is CVS, setting up CVSROOT"); if ( $connection eq 'local' ) { $vcsroot = "$root"; @@ -411,4 +439,5 @@ } + $log->debug("creating Repository object"); my $repository = SandWeb::Repository->new( root => $vcsroot, @@ -423,5 +452,7 @@ if ($filename) { + $log->debug("creating file object"); $file = SandWeb::File->new( + 'log_obj' => $log, 'filename' => $filename, 'location' => "$users_dir/$username$location", @@ -430,4 +461,5 @@ if ( $file_command eq 'info' ) { + $log->debug("calling file info routine"); # can't give the leading / to the VCS $filename =~ s/\///; @@ -455,5 +487,7 @@ } elsif ( $file_command eq 'view' ) { + $log->debug("viewing file : $filename\n"); if ( $file->get_file_type() ne "Text" ) { + $log->debug("User wants to view non-text file.\n"); set_error("This does not appear to be a text file."); browse_menu( @@ -461,10 +495,8 @@ path => $location, ); - } - my @tmp; - open (FILE, "$users_dir/$username/$location/$filename"); - foreach my $line (<FILE>) { - push @tmp, $line; } + + my @tmp = $file->file_read(); + my $content = $ui->get_menu( MENU => 'view_file', @@ -485,11 +517,28 @@ } elsif ( $file_command eq 'edit' ) { + $log->debug("editing file : $filename \n"); if ($save) { my $data = param('data'), my $filename = $file->get_filename(); + $log->debug("saving edited file : $filename \n"); - open ( FILE, "> $users_dir/$username$location/$filename" ); + $log->debug("opening $users_dir/$username$location/$filename\n"); + unless (open ( FILE, "> $users_dir/$username$location/$filename" )) { + $log->error("could not open $users_dir/$username$location/$filename for writing : $!\n"); + browse_menu( + cookie => $cookie, + path => $location, + ); + } print FILE "$data"; - close FILE; + unless (close FILE) { + my $error = "could not save $users_dir/$username$location/$filename : $!"; + $log->error("$error\n"); + set_error("$error\n"); + browse_menu( + cookie => $cookie, + path => $location, + ); + } browse_menu( @@ -499,4 +548,5 @@ } if ( $file->get_file_type() ne "Text" ) { + $log->debug("User wants to edit non-text file : $filename\n"); set_error("This does not appear to be a text file."); browse_menu( @@ -506,8 +556,27 @@ } my @tmp; - open (FILE, "$users_dir/$username/$location/$filename"); + $log->debug("opening $users_dir/$username/$location/$filename\n"); + unless (open (FILE, "< $users_dir/$username/$location/$filename") ) { + my $error = "could not open $users_dir/$username/$location/$filename for reading : $!"; + $log->error("$error\n"); + set_error("$error"); + browse_menu( + cookie => $cookie, + path => $location, + ); + } foreach my $line (<FILE>) { push @tmp, $line; } + unless (close FILE) { + my $error = "could not close $users_dir/$username/$location/$filename : $!"; + $log->error("$error\n"); + set_error("$error"); + browse_menu( + cookie => $cookie, + path => $location, + ); + } + $log->debug("closing $users_dir/$username/$location/$filename\n"); my $content = $ui->get_menu( MENU => 'edit_file', @@ -618,4 +687,33 @@ ERROR => $error, ); + exit 0; + } + elsif ( $file_command eq 'download' ) { + open FILE,"< $users_dir/$username/$location/$filename"; + my @file = <FILE>; + close FILE; + my @file_split = split(/\./, $filename); + my $file_extension = $file_split[$#file_split]; + my $content_type; + open FILE,"< /usr/local/apache/conf/mime.types"; + my @mimes = <FILE>; + close FILE; + foreach my $mime_type (@mimes) { + unless ( $mime_type =~ /^#/) { + my @mime_string = split(/\s+/, $mime_type); + if ($mime_string[1]) { + if ( $file_extension eq $mime_string[1] ){ + $content_type = $mime_string[0]; + } + } + } + } + unless ($content_type) { + $content_type = "binary/unknown"; + } + print "content-type:$content_type\n\n"; + foreach my $line (@file) { + print "$line"; + } exit 0; } |
From: Rob H. <for...@us...> - 2001-12-20 02:26:29
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv7863 Modified Files: File.pm Log Message: created file_write and file_read methods these are public methods that will handle file reads and creation, and set the debug and error logs accordingly. Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -U2 -r1.17 -r1.18 --- File.pm 2001/12/18 20:24:12 1.17 +++ File.pm 2001/12/20 02:26:24 1.18 @@ -7,5 +7,6 @@ # standard modules # -# this one is for the get_age() method +# POSIX is for the get_age() method + use POSIX qw(strftime); @@ -23,4 +24,5 @@ 'filename' => $filename, 'location' => $location, + 'log_obj' => $log, 'mode' => $mode, 'uid' => $uid, @@ -81,5 +83,4 @@ sub get_size { my $self = shift; - return $self->{'size'}; } @@ -97,7 +98,13 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; - open (FILE, ">$location/$filename"); - my $return = close FILE; + + my $file = SandWeb::File->new( + 'location' => "$location", + 'filename' => "$filename", + ); + + $file->file_write( 'contents' => "test" ); return $return; @@ -108,4 +115,5 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; my $return = mkdir( "$location/$filename", "0336" ); @@ -118,4 +126,5 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; my $return = unlink("$location/$filename" ); @@ -128,4 +137,5 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; my $return = rmdir("$location/$filename" ); @@ -139,4 +149,5 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; my $tofile = $args{'tofile'}; @@ -159,8 +170,38 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; my $tofile = $args{'tofile'}; my $return = rename( "$location/$filename", "$tofile" ); + return $return; +} + +sub file_read { + my $self = shift; + my %args = @_; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; + + open (FILE, "< $location/$filename"); + my $contents = <FILE>; + close FILE; + + return $contents; +} + +sub file_write { + my $self = shift; + my %args = @_; + + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + my $contents = $args{'contents'}; + + open (FILE, ">$location/$filename"); + print FILE $contents; + my $return = close FILE; return $return; } |
From: Rob H. <for...@us...> - 2001-12-19 22:35:24
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv11498 Modified Files: browse.html Log Message: decreased font size for titles, made command column 5% smaller Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.39 retrieving revision 1.40 diff -U2 -r1.39 -r1.40 --- browse.html 2001/12/19 07:22:04 1.39 +++ browse.html 2001/12/19 22:35:22 1.40 @@ -19,5 +19,5 @@ <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> - <td width="40%" align="center" bgcolor="#AAAAAA"> + <td width="60%" align="center" bgcolor="#AAAAAA"> <select name="vcs_command"> <option></option> @@ -63,5 +63,5 @@ <table width="100%" border="1"> <tr> - <td width="40%" align="left"> + <td width="55%" align="left"> <a href="javascript:selectAll(document.browse.filename)">Select All</a> | @@ -70,20 +70,28 @@ </tr> <tr> - <td width="55%" align="left" bgcolor="#88FF88"> -   <b>File</b> + <td width="60%" align="left" bgcolor="#88FF88"> + <font size="2"> +   <b>File</b> + </font> </td> - <td width="15%" align="left" bgcolor="#CCCCCC"> -   Commands + <td width="10%" align="left" bgcolor="#CCCCCC"> + <font size="2"> +   Commands + </font> </td> <td width="10%" align="left" bgcolor="#CCCCCC"> -   <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> + <font size="2"> +   <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> + </font> </td> <td width="20%" align="left" bgcolor="#CCCCCC"> -   <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> + <font size="2"> +   <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> + </font> </td> </tr> <TMPL_LOOP NAME="ENTRY_LOOP"> <tr bgcolor="<TMPL_VAR NAME=COLOR>"> - <td width="55%" align="left"> + <td width="60%" align="left"> <input type="checkbox" name="filename" value="<TMPL_VAR NAME=ENTRY>"> @@ -96,5 +104,5 @@ </a> </td> - <td align="left" width="15%"> + <td align="left" width="10%">   <font size="2"> |
From: Nick J. <nje...@us...> - 2001-12-19 07:22:08
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv17335/templates Modified Files: browse.html Log Message: html formatting changes to browse.tmpl Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.38 retrieving revision 1.39 diff -U2 -r1.38 -r1.39 --- browse.html 2001/12/18 20:24:12 1.38 +++ browse.html 2001/12/19 07:22:04 1.39 @@ -70,20 +70,20 @@ </tr> <tr> - <td width="50%" align="left" bgcolor="#88FF88"> - <b>File</b> + <td width="55%" align="left" bgcolor="#88FF88"> +   <b>File</b> </td> - <td width="20%" align="left" bgcolor="#88FF88"> - <b>Commands</b> + <td width="15%" align="left" bgcolor="#CCCCCC"> +   Commands </td> <td width="10%" align="left" bgcolor="#CCCCCC"> - <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> +   <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> </td> <td width="20%" align="left" bgcolor="#CCCCCC"> - <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> +   <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> </td> </tr> <TMPL_LOOP NAME="ENTRY_LOOP"> <tr bgcolor="<TMPL_VAR NAME=COLOR>"> - <td width="40%" align="left"> + <td width="55%" align="left"> <input type="checkbox" name="filename" value="<TMPL_VAR NAME=ENTRY>"> @@ -96,17 +96,18 @@ </a> </td> - <td align="center" width="20%"> + <td align="left" width="15%">   - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=view&location=<TMPL_VAR NAME=LOCATION>">View</a> - | - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=edit&location=<TMPL_VAR NAME=LOCATION>">Edit</a> - </td> - <td width="10%" align="center"> -   - <TMPL_VAR NAME=FILESIZE> + <font size="2"> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=view&location=<TMPL_VAR NAME=LOCATION>">View</a> + | + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=edit&location=<TMPL_VAR NAME=LOCATION>">Edit</a> + </font> </td> + <td width="10%" align="right"> + <TMPL_VAR NAME=FILESIZE>/<font size="2"><i>B</i></font> + </td> <td>   - <TMPL_VAR NAME=FILEAGE> + <font size="2"><TMPL_VAR NAME=FILEAGE></font> </td> </tr> |
From: Rob H. <for...@us...> - 2001-12-18 20:24:18
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv3842/lib/SandWeb Modified Files: File.pm Log Message: simplified time, made column a little smaller Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -U2 -r1.16 -r1.17 --- File.pm 2001/12/18 02:12:06 1.16 +++ File.pm 2001/12/18 20:24:12 1.17 @@ -5,4 +5,9 @@ package SandWeb::File; +# standard modules +# +# this one is for the get_age() method +use POSIX qw(strftime); + sub new { my $class = shift; @@ -83,5 +88,5 @@ my $self = shift; my $mtime = $self->{'mtime'}; - my $time = localtime $mtime; + my $time = strftime "%m/%e/%Y %H:%M:%S", localtime $mtime; return $time; |
From: Rob H. <for...@us...> - 2001-12-18 20:24:16
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv3842/templates Modified Files: browse.html Log Message: simplified time, made column a little smaller Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.37 retrieving revision 1.38 diff -U2 -r1.37 -r1.38 --- browse.html 2001/12/18 19:12:15 1.37 +++ browse.html 2001/12/18 20:24:12 1.38 @@ -70,5 +70,5 @@ </tr> <tr> - <td width="40%" align="left" bgcolor="#88FF88"> + <td width="50%" align="left" bgcolor="#88FF88"> <b>File</b> </td> @@ -79,5 +79,5 @@ <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> </td> - <td width="30%" align="left" bgcolor="#CCCCCC"> + <td width="20%" align="left" bgcolor="#CCCCCC"> <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> </td> |
From: Rob H. <for...@us...> - 2001-12-18 19:12:19
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv16372/templates Modified Files: browse.html Log Message: cleanup up UI a bit Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.36 retrieving revision 1.37 diff -U2 -r1.36 -r1.37 --- browse.html 2001/12/18 03:24:27 1.36 +++ browse.html 2001/12/18 19:12:15 1.37 @@ -4,5 +4,4 @@ field[i].checked = true ; } - function clearAll(field) { for (i = 0; i < field.length; i++) @@ -44,9 +43,4 @@ </td> </tr> - <a href="javascript:selectAll(document.browse.filename)"> - Select All</a> - - <a href="javascript:clearAll(document.browse.filename)"> - Clear All</a> <tr> <td width="100%"> @@ -68,10 +62,16 @@ <td width="100%"> <table width="100%" border="1"> + <tr> + <td width="40%" align="left"> + <a href="javascript:selectAll(document.browse.filename)">Select All</a> + | + <a href="javascript:clearAll(document.browse.filename)">Clear All<a/> + </td> + </tr> <tr> - <td width="40%" align="left" bgcolor="#88FF88"> <b>File</b> </td> - <td width="20%" align="left" bgcolor="#CCCCCC"> + <td width="20%" align="left" bgcolor="#88FF88"> <b>Commands</b> </td> @@ -79,5 +79,5 @@ <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> </td> - <td width="30%" align="left" bgcolor="#88FF88"> + <td width="30%" align="left" bgcolor="#CCCCCC"> <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> </td> |
From: Rob H. <for...@us...> - 2001-12-18 09:47:17
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv31980/bin Modified Files: sandweb.cgi Log Message: implemented multi-file "file operations" for the only subroutine which actually needs it at this point : remove Tested, works. I could forsee download using it to tar/zip/jar/whatever a bunch of files and sending them to you. that'd be sweet. maybe we could have a preference setting. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.97 retrieving revision 1.98 diff -U2 -r1.97 -r1.98 --- sandweb.cgi 2001/12/18 09:07:38 1.97 +++ sandweb.cgi 2001/12/18 09:47:14 1.98 @@ -133,8 +133,10 @@ elsif ( param('action') eq 'file' ) { # called file manipulator + my @filename = (); + @filename = param('filename'), file( cookie => $cookie, file_command => param('file_command'), - filename => param('filename'), + filename => \@filename, location => param('location'), ); @@ -142,5 +144,5 @@ elsif ( param('action') eq 'vcsaction' ) { # called VCS action - my @filename; + my @filename = (); if ( param('filename') ) { @filename = param('filename'), @@ -351,5 +353,11 @@ my $file_command = $args{'file_command'}; my $location = $args{'location'}; - my $filename = param('filename'); + my @filename = (); + my $count = 0; + while ( $args{'filename'}->[$count] ) { + push (@filename, $args{'filename'}->[$count]); + $count++; + } + my $filename = "@filename"; my $save = param('save'); my $username = $auth->get_userinfo('username'); @@ -364,4 +372,35 @@ my $vcsroot; + if ( $file_command eq 'remove' ) { + unless (@filename) { + set_error("Please select file(s) or folder(s) to remove."); + browse_menu( + cookie => $cookie, + path => $location, + ); + } + + foreach my $entry (@filename) { + + my $file = SandWeb::File->new( + 'filename' => $entry, + 'location' => "$users_dir/$username$location", + ); + + if ($file) { + if ( $file->get_file_type() eq 'Directory' ) { + $file->remove_folder(); + } else { + $file->remove_file(); + } + } + } + + browse_menu( + cookie => $cookie, + path => $location, + ); + } + if ( $repo_type eq 'CVS' ) { if ( $connection eq 'local' ) { @@ -544,25 +583,4 @@ ); exit 0; - } - elsif ( $file_command eq 'remove' ) { - if ($file) { - if ( $file->get_file_type() eq 'Directory' ) { - $file->remove_folder(); - } else { - $file->remove_file(); - } - - browse_menu( - cookie => $cookie, - path => $location, - ); - exit 0; - } - set_error("Please select file(s) or folder(s) to remove."); - browse_menu( - cookie => $cookie, - path => $location, - ); - } elsif ( $file_command eq 'upload' ) { |
From: Rob H. <for...@us...> - 2001-12-18 09:07:41
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv17511/templates Modified Files: checkout.html commit.html create_file.html create_folder.html edit_file.html upload_file.html Log Message: multi-file VCS commands now work. fixed some other bugs throughout the program, mostly fallout from adding the file pulldown to the browse template. Index: checkout.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/checkout.html,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- checkout.html 2001/11/24 11:58:00 1.3 +++ checkout.html 2001/12/18 09:07:38 1.4 @@ -3,5 +3,5 @@ <form submit="<TMPL_VAR NAME=PROGNAME>"> <input type="hidden" name="action" value="vcsaction" /> - <input type="hidden" name="command" value="checkout" /> + <input type="hidden" name="vcs_command" value="checkout" /> <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Index: commit.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/commit.html,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- commit.html 2001/11/30 20:42:05 1.3 +++ commit.html 2001/12/18 09:07:38 1.4 @@ -3,5 +3,5 @@ <form submit="<TMPL_VAR NAME=PROGNAME>" type="get"> <input type="hidden" name="action" value="vcsaction" /> - <input type="hidden" name="command" value="commit" /> + <input type="hidden" name="vcs_command" value="commit" /> <input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> Index: create_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/create_file.html,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- create_file.html 2001/12/18 00:42:03 1.3 +++ create_file.html 2001/12/18 09:07:38 1.4 @@ -1,5 +1,5 @@ <form action="<TMPL_VAR NAME=PROGNAME>"> <input name="action" value="file" type="hidden" /> -<input name="command" value="create_file" type="hidden" /> +<input name="file_command" value="create_file" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Index: create_folder.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/create_folder.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- create_folder.html 2001/11/30 20:42:05 1.2 +++ create_folder.html 2001/12/18 09:07:38 1.3 @@ -1,5 +1,5 @@ <form action="<TMPL_VAR NAME=PROGNAME>"> <input name="action" value="file" type="hidden" /> -<input name="command" value="create_folder" type="hidden" /> +<input name="file_command" value="create_folder" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.6 retrieving revision 1.7 diff -U2 -r1.6 -r1.7 --- edit_file.html 2001/11/30 20:42:05 1.6 +++ edit_file.html 2001/12/18 09:07:38 1.7 @@ -3,5 +3,5 @@ <form submit="<TMPL_VAR NAME=PROGNAME>"> <input name="action" value="file" type="hidden" /> - <input name="command" value="edit" type="hidden" /> + <input name="file_command" value="edit" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Index: upload_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/upload_file.html,v retrieving revision 1.1 retrieving revision 1.2 diff -U2 -r1.1 -r1.2 --- upload_file.html 2001/12/18 02:09:35 1.1 +++ upload_file.html 2001/12/18 09:07:38 1.2 @@ -2,5 +2,5 @@ enctype="multipart/form-data"> <input name="action" value="file" type="hidden" /> -<input name="command" value="upload" type="hidden" /> +<input name="file_command" value="upload" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> |
From: Rob H. <for...@us...> - 2001-12-18 09:07:41
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv17511/bin Modified Files: sandweb.cgi Log Message: multi-file VCS commands now work. fixed some other bugs throughout the program, mostly fallout from adding the file pulldown to the browse template. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.96 retrieving revision 1.97 diff -U2 -r1.96 -r1.97 --- sandweb.cgi 2001/12/18 02:29:02 1.96 +++ sandweb.cgi 2001/12/18 09:07:38 1.97 @@ -142,16 +142,17 @@ elsif ( param('action') eq 'vcsaction' ) { # called VCS action - my $filename; + my @filename; if ( param('filename') ) { - $filename = param('filename'), + @filename = param('filename'), } else { - $filename = '.'; + @filename = ('.'); } + vcsaction( cookie => $cookie, - filename => $filename, vcs_command => param('vcs_command'), location => param('location'), + filename => \@filename, ); } @@ -628,5 +629,10 @@ my $vcs_command = $args{'vcs_command'}; - my $filename = $args{'filename'}; + my @filename = (); + my $count = 0; + while ( $args{'filename'}->[$count] ) { + push (@filename, $args{'filename'}->[$count]); + $count++; + } my $location = $args{'location'}; my $message = param('message'); @@ -641,4 +647,6 @@ my $root = $userprefs->{'repository'}->{'root'}; my $sandbox = $userprefs->{'paths'}->{'users_dir'}; + my @vcs_output = (); + my @vcs_error = (); my $vcsroot; @@ -660,8 +668,13 @@ # can't give the leading / to the VCS $location =~ s/\///; - %return = $repository->commit( - file => "$location/$filename", - message => "$message", - ); + foreach my $file (@filename) { + %return = $repository->commit( + file => "$location/$file", + message => "$message", + ); + push (@vcs_output, "$return{'output'}\n"); + push (@vcs_error, "$return{'error'}\n"); + } + my $content = $ui->get_menu( MENU => 'vcs_output', @@ -669,6 +682,6 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - VCS_OUTPUT => $return{'output'}, - VCS_ERROR => $return{'error'}, + VCS_OUTPUT => "@vcs_output", + VCS_ERROR => "@vcs_error", ); print header( -cookie => $cookie ); @@ -688,5 +701,5 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - FILENAME => $filename, + FILENAME => "@filename", ); print header( -cookie => $cookie ); @@ -705,5 +718,11 @@ $location =~ s/\///; - %return = $repository->$vcs_command( file => "$location/$filename" ); + foreach my $file (@filename) { + %return = $repository->$vcs_command( + file => "$location/$file", + ); + push (@vcs_output, "$return{'output'}\n"); + push (@vcs_error, "$return{'error'}\n"); + } } my $content = $ui->get_menu( @@ -712,6 +731,6 @@ PROGNAME => $progname, FULLPATH => "$users_dir/$username/$location", - VCS_OUTPUT => $return{'output'}, - VCS_ERROR => $return{'error'}, + VCS_OUTPUT => "@vcs_output", + VCS_ERROR => "@vcs_error", ); print header( -cookie => $cookie ); |
From: Rob H. <for...@us...> - 2001-12-18 09:07:41
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv17511/lib/SandWeb Modified Files: Repository.pm Log Message: multi-file VCS commands now work. fixed some other bugs throughout the program, mostly fallout from adding the file pulldown to the browse template. Index: Repository.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -U2 -r1.14 -r1.15 --- Repository.pm 2001/12/16 09:12:49 1.14 +++ Repository.pm 2001/12/18 09:07:38 1.15 @@ -429,13 +429,14 @@ my $sandbox = $self->get_sandbox(); my %return = {}; - my $vcs = SandWeb::Repository::CVS->new(root => $root, - sandbox => $sandbox, - ); - + my $vcs = SandWeb::Repository::CVS->new( + root => $root, + sandbox => $sandbox, + ); if ($repo_type eq 'CVS') { - %return = $vcs->status(verbose => $verbose, - recurse => $recurse, - file => $file, - ); + %return = $vcs->status( + verbose => $verbose, + recurse => $recurse, + file => $file, + ); } |
From: Rob H. <for...@us...> - 2001-12-18 07:47:28
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Repository In directory usw-pr-cvs1:/tmp/cvs-serv21557/lib/SandWeb/Repository Modified Files: CVS.pm Log Message: got rid of the old multi-file functionality ( doesn't work for files w/ spaces ) cleaned up formatting alot Index: CVS.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository/CVS.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -U2 -r1.17 -r1.18 --- CVS.pm 2001/12/17 19:27:19 1.17 +++ CVS.pm 2001/12/18 07:47:26 1.18 @@ -36,21 +36,11 @@ if ($message) { push @param, " -m $message" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -72,21 +62,8 @@ if ($type = "text") { push @param, " -kkv -MMERGE" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; - my $errorlevel = $?; - - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -110,21 +87,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -185,21 +152,11 @@ }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -223,16 +180,4 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - print "cd $sandbox && cvs -d $root @param \"$file\" 2>&1"; @@ -243,5 +188,5 @@ output => $output, errorlevel => $errorlevel, - ); + ); return %return; @@ -263,21 +208,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -297,21 +232,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -328,21 +253,11 @@ my @param = 'history'; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -359,21 +274,11 @@ my @param = 'init'; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -390,16 +295,4 @@ my @param = 'log'; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; @@ -412,24 +305,4 @@ return %return; - -# -l Local directory only, no recursion. -# -# -R Only print name of RCS file. -# -# -h Only print header. -# -# -t Only print header and descriptive text. -# -# -N Do not list tags. -# -# -b Only list revisions on the default branch. -# -# -r[revisions] Specify revision(s)s to list. -# -# -d dates Specify dates (D1<D2 for range, D for latest before). -# -# -s states Only list revisions with specified states. -# -# -w[logins] Only list revisions checked in by specified logins. } @@ -454,6 +327,8 @@ my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -470,6 +345,8 @@ my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -489,21 +366,11 @@ if ($delete) { push @param, " -f" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel + ); return %return; @@ -525,21 +392,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel + ); return %return; @@ -561,16 +418,4 @@ if ($verbose) { push @param, " -v" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; @@ -607,21 +452,11 @@ if ($name) { push @param, " $name" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel + ); return %return; @@ -641,21 +476,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel, + ); return %return; @@ -689,21 +514,11 @@ if ($merge) { push @param, " -j" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel + ); return %return; @@ -727,16 +542,4 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; @@ -763,21 +566,11 @@ if ($recurse) { push @param, " -R" }; - my @files = split(' ', $file); - my @filenames = (); - - foreach my $filename (@files) { - if (! $filename) { - print "Cannot open $file : $!\n"; - return -1; - } else { - push @filenames, "$sandbox/$filename"; - } - } - my $output = `cd $sandbox && cvs -d $root @param \"$file\" 2>&1`; my $errorlevel = $?; - my %return = ( output => $output, - errorlevel => $errorlevel ); + my %return = ( + output => $output, + errorlevel => $errorlevel + ); return %return; |
From: Rob H. <for...@us...> - 2001-12-18 03:24:32
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv7665/templates Modified Files: browse.html Log Message: made view_file and edit_file work again Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.35 retrieving revision 1.36 diff -U2 -r1.35 -r1.36 --- browse.html 2001/12/18 02:09:35 1.35 +++ browse.html 2001/12/18 03:24:27 1.36 @@ -90,5 +90,5 @@ <a name="<TMPL_VAR NAME=ENTRY>"> </input> - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=info&location=<TMPL_VAR NAME=LOCATION>"> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=info&location=<TMPL_VAR NAME=LOCATION>"> <img src="/icons/<TMPL_VAR NAME=FILETYPE>.gif" alt="" border=0 width=20 height=22> @@ -98,7 +98,7 @@ <td align="center" width="20%">   - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=view&location=<TMPL_VAR NAME=LOCATION>">View</a> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=view&location=<TMPL_VAR NAME=LOCATION>">View</a> | - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=edit&location=<TMPL_VAR NAME=LOCATION>">Edit</a> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=edit&location=<TMPL_VAR NAME=LOCATION>">Edit</a> </td> <td width="10%" align="center"> |
From: Rob H. <for...@us...> - 2001-12-18 02:29:05
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv29283/bin Modified Files: sandweb.cgi Log Message: cool, so now VCS actions don't break if no filename is entered, instead they are performed on the current directory ( which is great for update, since you can't add a file that's not there :P ) please note that I've broken view and edit, i'll fix them when i get home. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.95 retrieving revision 1.96 diff -U2 -r1.95 -r1.96 --- sandweb.cgi 2001/12/18 02:18:53 1.95 +++ sandweb.cgi 2001/12/18 02:29:02 1.96 @@ -142,7 +142,14 @@ elsif ( param('action') eq 'vcsaction' ) { # called VCS action + my $filename; + if ( param('filename') ) { + $filename = param('filename'), + } + else { + $filename = '.'; + } vcsaction( cookie => $cookie, - filename => param('filename'), + filename => $filename, vcs_command => param('vcs_command'), location => param('location'), |
From: Rob H. <for...@us...> - 2001-12-18 02:18:55
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv27860/bin Modified Files: sandweb.cgi Log Message: sweet.. remove works. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.94 retrieving revision 1.95 diff -U2 -r1.94 -r1.95 --- sandweb.cgi 2001/12/18 02:12:06 1.94 +++ sandweb.cgi 2001/12/18 02:18:53 1.95 @@ -136,4 +136,5 @@ cookie => $cookie, file_command => param('file_command'), + filename => param('filename'), location => param('location'), ); @@ -535,4 +536,25 @@ ); exit 0; + } + elsif ( $file_command eq 'remove' ) { + if ($file) { + if ( $file->get_file_type() eq 'Directory' ) { + $file->remove_folder(); + } else { + $file->remove_file(); + } + + browse_menu( + cookie => $cookie, + path => $location, + ); + exit 0; + } + set_error("Please select file(s) or folder(s) to remove."); + browse_menu( + cookie => $cookie, + path => $location, + ); + } elsif ( $file_command eq 'upload' ) { |
From: Rob H. <for...@us...> - 2001-12-18 02:12:09
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv26590/bin Modified Files: sandweb.cgi Log Message: implemented file operations. the functional piece of the UI is there, I don't think the filenames are being caught correctly however. I'll work on that next. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.93 retrieving revision 1.94 diff -U2 -r1.93 -r1.94 --- sandweb.cgi 2001/12/16 09:12:49 1.93 +++ sandweb.cgi 2001/12/18 02:12:06 1.94 @@ -135,5 +135,5 @@ file( cookie => $cookie, - command => param('command'), + file_command => param('file_command'), location => param('location'), ); @@ -144,5 +144,5 @@ cookie => $cookie, filename => param('filename'), - command => param('command'), + vcs_command => param('vcs_command'), location => param('location'), ); @@ -298,6 +298,9 @@ ); + my $file = SandWeb::File->new(); + my $username = $auth->get_userinfo('username'); my @vcs_commands = $repository->get_vcs_commands(); + my @file_commands = $file->get_file_commands(); my $repo_type = $repository->get_repo_type(); @@ -306,5 +309,5 @@ # use the browse object to show user's sandbox - my $content = $browse->browse("$path", "$progname", "@vcs_commands", $repo_type); + my $content = $browse->browse("$path", "$progname", "@vcs_commands", "@file_commands", $repo_type); print header( -cookie => $cookie ); @@ -337,5 +340,5 @@ - my $command = $args{'command'}; + my $file_command = $args{'file_command'}; my $location = $args{'location'}; my $filename = param('filename'); @@ -378,5 +381,5 @@ } - if ( $command eq 'info' ) { + if ( $file_command eq 'info' ) { # can't give the leading / to the VCS $filename =~ s/\///; @@ -403,5 +406,5 @@ exit 0; } - elsif ( $command eq 'view' ) { + elsif ( $file_command eq 'view' ) { if ( $file->get_file_type() ne "Text" ) { set_error("This does not appear to be a text file."); @@ -433,5 +436,5 @@ exit 0; } - elsif ( $command eq 'edit' ) { + elsif ( $file_command eq 'edit' ) { if ($save) { my $data = param('data'), @@ -479,5 +482,5 @@ exit 0; } - elsif ( $command eq 'create_file' ) { + elsif ( $file_command eq 'create_file' ) { if ($file) { $file->create_file(); @@ -506,5 +509,5 @@ exit 0; } - elsif ( $command eq 'create_folder' ) { + elsif ( $file_command eq 'create_folder' ) { if ($file) { $file->create_folder(); @@ -533,5 +536,5 @@ exit 0; } - elsif ( $command eq 'upload' ) { + elsif ( $file_command eq 'upload' ) { my $content = $ui->get_menu( MENU => 'upload_file', @@ -551,5 +554,5 @@ exit 0; } - elsif ( $command eq 'checkout' ) { + elsif ( $file_command eq 'checkout' ) { my $content = $ui->get_menu( MENU => 'checkout', @@ -570,5 +573,5 @@ } else { - set_error("Invalid selection: $command"); + set_error("Invalid selection: $file_command"); browse_menu( cookie => $cookie, @@ -595,5 +598,5 @@ } - my $command = $args{'command'}; + my $vcs_command = $args{'vcs_command'}; my $filename = $args{'filename'}; my $location = $args{'location'}; @@ -624,5 +627,5 @@ sandbox => "$users_dir/$username", ); - if ( $command eq 'commit' ) { + if ( $vcs_command eq 'commit' ) { if ($message) { # can't give the leading / to the VCS @@ -642,7 +645,7 @@ print header( -cookie => $cookie ); $ui->print_screen( - TITLE=> "SandWeb : VCS $command", + TITLE=> "SandWeb : VCS $vcs_command", MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $command", + SUBMENU_TITLE => "VCS $vcs_command", FOOTER => '', CONTENT => $content, @@ -673,5 +676,5 @@ $location =~ s/\///; - %return = $repository->$command( file => "$location/$filename" ); + %return = $repository->$vcs_command( file => "$location/$filename" ); } my $content = $ui->get_menu( @@ -685,7 +688,7 @@ print header( -cookie => $cookie ); $ui->print_screen( - TITLE=> "SandWeb : VCS $command", + TITLE=> "SandWeb : VCS $vcs_command", MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $command", + SUBMENU_TITLE => "VCS $vcs_command", FOOTER => '', CONTENT => $content, |
From: Rob H. <for...@us...> - 2001-12-18 02:12:09
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv26590/lib/SandWeb Modified Files: Browse.pm File.pm Log Message: implemented file operations. the functional piece of the UI is there, I don't think the filenames are being caught correctly however. I'll work on that next. Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -U2 -r1.21 -r1.22 --- Browse.pm 2001/12/06 23:35:51 1.21 +++ Browse.pm 2001/12/18 02:12:06 1.22 @@ -30,4 +30,5 @@ my $progname = shift; my $vcs_commands = shift; + my $file_commands = shift; my $repo_type = shift; @@ -39,4 +40,5 @@ my $sandbox = "$users_dir/$username"; my @vcs_commands = split (/ /, $vcs_commands ); + my @file_commands = split (/ /, $file_commands ); if (! $sandbox) { @@ -174,12 +176,19 @@ my @loop_data = (); - if ($repo_type eq "CVS") { - foreach my $vcs_command (@vcs_commands) { - my %row_data; - $row_data{VCS_CMD} = "$vcs_command"; - push (@loop_data, \%row_data); - } - $content->param( VCS_CMD_LOOP => \@loop_data ); + foreach my $vcs_command (@vcs_commands) { + my %row_data; + $row_data{VCS_CMD} = "$vcs_command"; + push (@loop_data, \%row_data); + } + $content->param( VCS_CMD_LOOP => \@loop_data ); + + @loop_data = (); + + foreach my $file_command (@file_commands) { + my %row_data; + $row_data{FILE_CMD} = "$file_command"; + push (@loop_data, \%row_data); } + $content->param( FILE_CMD_LOOP => \@loop_data ); return $content->output; Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -U2 -r1.15 -r1.16 --- File.pm 2001/11/27 01:29:21 1.15 +++ File.pm 2001/12/18 02:12:06 1.16 @@ -161,3 +161,15 @@ } +sub get_file_commands { + my $self = shift; + return ( + 'create_file', + 'create_folder', + 'remove', + 'rename', + 'upload', + 'download', + ); +} + 1; |
From: Rob H. <for...@us...> - 2001-12-18 02:10:34
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv26409 Removed Files: upload.html Log Message: renamed to upload_file.html --- upload.html DELETED --- |
From: Rob H. <for...@us...> - 2001-12-18 02:09:38
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv26137 Modified Files: browse.html Added Files: upload_file.html Log Message: renamed upload.html to upload_file.html --- NEW FILE --- <form method="post" action="<TMPL_VAR NAME=PROGNAME>" enctype="multipart/form-data"> <input name="action" value="file" type="hidden" /> <input name="command" value="upload" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Enter a file to upload:<br /> <TMPL_VAR NAME=ERROR> <input name="uploaded_file" type="file" /><br /> <input name="done" type="submit" /><br /> </form> Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.34 retrieving revision 1.35 diff -U2 -r1.34 -r1.35 --- browse.html 2001/12/17 23:45:05 1.34 +++ browse.html 2001/12/18 02:09:35 1.35 @@ -14,5 +14,4 @@ <table width="100%" border="0" cellspacing="0" cellpadding="2"> <form method="get" submit="<TMPL_VAR NAME=PROGNAME>" name="browse"> - <input type="hidden" name="action" value="vcsaction" /> <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> @@ -22,21 +21,22 @@ <tr> <td width="40%" align="center" bgcolor="#AAAAAA"> - <select name="command"> - <TMPL_LOOP NAME="VCS_CMD_LOOP"> - <option><TMPL_VAR NAME="VCS_CMD"></option> - </TMPL_LOOP> + <select name="vcs_command"> + <option></option> + <TMPL_LOOP NAME="VCS_CMD_LOOP"> + <option><TMPL_VAR NAME="VCS_CMD"></option> + </TMPL_LOOP> </select>       - <input type="submit" name="function" value="Submit" /> + <input type="submit" name="action" value="vcsaction" /> </td> - <td width="60%" colspan="3" align="center"> - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&command=create_file&location=<TMPL_VAR NAME=LOCATION>">Create File</a> -   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&command=create_folder&location=<TMPL_VAR NAME=LOCATION>">Create Folder</a> -   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&command=upload&location=<TMPL_VAR NAME=LOCATION>">Upload</a> -   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&command=checkout&location=<TMPL_VAR NAME=LOCATION>">Checkout</a> - <br /> + <td width="40%" align="center" bgcolor="#AAAAAA"> + <select name="file_command"> + <option></option> + <TMPL_LOOP NAME="FILE_CMD_LOOP"> + <option><TMPL_VAR NAME="FILE_CMD"></option> + </TMPL_LOOP> + </select> +       + <input type="submit" name="action" value="file" /> </td> </tr> |
From: Rob H. <for...@us...> - 2001-12-18 00:42:07
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv7344/templates Modified Files: create_file.html Log Message: added more verbosity Index: create_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/create_file.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- create_file.html 2001/11/30 20:42:05 1.2 +++ create_file.html 2001/12/18 00:42:03 1.3 @@ -4,5 +4,8 @@ <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> -Location: <TMPL_VAR NAME=LOCATION><br /> +Current location: <TMPL_VAR NAME=LOCATION><br /> + <br /> +Enter filename : + <br /> <input name="filename" type="text" /><br /> <input name="done" type="submit" value="Done" /><br /> |
From: Rob H. <for...@us...> - 2001-12-17 23:45:09
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv26766/templates Modified Files: browse.html Log Message: removed illegal HTML Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.33 retrieving revision 1.34 diff -U2 -r1.33 -r1.34 --- browse.html 2001/12/07 21:47:30 1.33 +++ browse.html 2001/12/17 23:45:05 1.34 @@ -77,8 +77,8 @@ </td> <td width="10%" align="left" bgcolor="#CCCCCC"> - <A href="<b><TMPL_VAR NAME=PROGNAME></b>">Size</a> + <A href="<TMPL_VAR NAME=PROGNAME>">Size</a> </td> <td width="30%" align="left" bgcolor="#88FF88"> - <A href="<b><TMPL_VAR NAME=PROGNAME></b>">Age</a> + <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> </td> </tr> |