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: Nick J. <nje...@us...> - 2001-12-21 22:13:52
|
Update of /cvsroot/sandweb/sandweb/doc In directory usw-pr-cvs1:/tmp/cvs-serv13951/doc Added Files: dependencies.list Log Message: Added dependency list test file. --- NEW FILE --- Sandweb requires the following dependencies. - perl modules: expat XML::Parser XML::Simple HTML::Template |
From: Nick J. <nje...@us...> - 2001-12-21 22:13:33
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv13707/templates Modified Files: browse.html Log Message: * Fixed table cell spacing in browse.html Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.45 retrieving revision 1.46 diff -U2 -r1.45 -r1.46 --- browse.html 2001/12/21 08:12:20 1.45 +++ browse.html 2001/12/21 22:13:30 1.46 @@ -63,5 +63,5 @@ <table width="100%" border="1"> <tr> - <td width="60%" align="left"> + <td width="60%" align="left" colspan="3"> <a href="javascript:selectAll(document.browse.filename)">Select All</a> | |
From: Rob H. <for...@us...> - 2001-12-21 08:33:50
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv8716/templates Modified Files: view_file.html Log Message: view_file now offers a link to your previous location ( too easy to get lost, if you edit and view over and over it's a pain in the arse to use the back button ) Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.10 retrieving revision 1.11 diff -U2 -r1.10 -r1.11 --- view_file.html 2001/12/21 08:12:20 1.10 +++ view_file.html 2001/12/21 08:33:47 1.11 @@ -1,4 +1,7 @@ <p> - <TMPL_VAR NAME=FILENAME> + Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> + <br /> + Current filename : <TMPL_VAR NAME=FILENAME> + <br /> <form submit="<TMPL_VAR NAME=PROGNAME>"> <input type="hidden" name="action" value="file" /> |
From: Rob H. <for...@us...> - 2001-12-21 08:29:05
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv7919/bin Modified Files: sandweb.cgi Log Message: ok, edit_file actually works when called from view_file now :) Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.106 retrieving revision 1.107 diff -U2 -r1.106 -r1.107 --- sandweb.cgi 2001/12/21 08:12:20 1.106 +++ sandweb.cgi 2001/12/21 08:29:02 1.107 @@ -533,4 +533,6 @@ PROGNAME => $progname, CONTENT => "$content", + LOCATION => $location, + FILENAME => $filename, FULLPATH => "$users_dir/$username/$location", ); |
From: Rob H. <for...@us...> - 2001-12-21 08:12:23
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv4678/templates Modified Files: browse.html view_file.html Log Message: removed "Commands" column, you can get to edit by clicking on a file ( which brings up the View screen ) and pressing the edit button. saving the file brings you back to the View screen. Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.44 retrieving revision 1.45 diff -U2 -r1.44 -r1.45 --- browse.html 2001/12/21 07:36:13 1.44 +++ browse.html 2001/12/21 08:12:20 1.45 @@ -75,9 +75,4 @@ </font> </td> - <td width="20%" align="left" bgcolor="#CCCCCC"> - <font size="2"> -   Commands - </font> - </td> <td width="10%" align="left" bgcolor="#CCCCCC"> <font size="2"> @@ -85,5 +80,5 @@ </font> </td> - <td width="20%" align="left" bgcolor="#CCCCCC"> + <td width="30%" align="left" bgcolor="#CCCCCC"> <font size="2">   <A href="<TMPL_VAR NAME=PROGNAME>">Age</a> @@ -93,5 +88,5 @@ <TMPL_LOOP NAME="ENTRY_LOOP"> <tr bgcolor="<TMPL_VAR NAME=COLOR>"> - <td width="60%" align="left"> + <td> <input type="checkbox" name="filename" value="<TMPL_VAR NAME=ENTRY>"> @@ -103,14 +98,6 @@ <TMPL_VAR NAME=ENTRY> </a> - </td> - <td align="left" width="20%"> -   - <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"> + <td> <TMPL_VAR NAME=FILESIZE>/<font size="2"><i>B</i></font> </td> Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.9 retrieving revision 1.10 diff -U2 -r1.9 -r1.10 --- view_file.html 2001/12/21 01:12:47 1.9 +++ view_file.html 2001/12/21 08:12:20 1.10 @@ -5,7 +5,9 @@ <input type="submit" name="file_command" value="download" /> <input type="submit" name="file_command" value="upload" /> + <input type="submit" name="file_command" value="edit" /> + <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> <input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> <TMPL_VAR NAME=ERROR> -<pre> <TMPL_VAR NAME=CONTENT></pre> +<pre> <TMPL_VAR NAME=DATA></pre> </form> </p> |
From: Rob H. <for...@us...> - 2001-12-21 08:12:23
|
Update of /cvsroot/sandweb/sandweb/etc In directory usw-pr-cvs1:/tmp/cvs-serv4678/etc Modified Files: sandweb.cfg Log Message: removed "Commands" column, you can get to edit by clicking on a file ( which brings up the View screen ) and pressing the edit button. saving the file brings you back to the View screen. Index: sandweb.cfg =================================================================== RCS file: /cvsroot/sandweb/sandweb/etc/sandweb.cfg,v retrieving revision 1.10 retrieving revision 1.11 diff -U2 -r1.10 -r1.11 --- sandweb.cfg 2001/12/21 01:12:47 1.10 +++ sandweb.cfg 2001/12/21 08:12:20 1.11 @@ -30,5 +30,5 @@ /> - <webserver mime-types_location="/usr/local/apache/conf" + <webserver mime-types_location="/etc/apache" mime-types_file="mime.types" /> |
From: Rob H. <for...@us...> - 2001-12-21 08:12:23
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv4678/bin Modified Files: sandweb.cgi Log Message: removed "Commands" column, you can get to edit by clicking on a file ( which brings up the View screen ) and pressing the edit button. saving the file brings you back to the View screen. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.105 retrieving revision 1.106 diff -U2 -r1.105 -r1.106 --- sandweb.cgi 2001/12/21 02:40:16 1.105 +++ sandweb.cgi 2001/12/21 08:12:20 1.106 @@ -464,17 +464,18 @@ $log->debug("viewing file : $filename"); - my $content = $file->file_read(); + my $data = $file->file_read(); if ( $file->get_file_type() ne "Text" ) { $log->debug("User wants to view non-text file : $filename"); set_error("This does not appear to be a text file."); - $content = ""; + $data = ""; } my $content = $ui->get_menu( MENU => 'view_file', - PROGNAME => $progname, + PROGNAME => "$progname", FILENAME => "$filename", - CONTENT => "$content", + LOCATION => "$location", + DATA => "$data", ); @@ -532,6 +533,4 @@ PROGNAME => $progname, CONTENT => "$content", - FILENAME => $filename, - LOCATION => $location, FULLPATH => "$users_dir/$username/$location", ); @@ -542,4 +541,6 @@ MENU_TITLE => 'SandWeb', SUBMENU_TITLE => 'edit file', + FILENAME => $filename, + LOCATION => $location, FOOTER => '', CONTENT => $content, |
From: Rob H. <for...@us...> - 2001-12-21 07:36:16
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv31621/templates Modified Files: browse.html Log Message: adjusted vcsaction/file table Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.43 retrieving revision 1.44 diff -U2 -r1.43 -r1.44 --- browse.html 2001/12/21 07:31:12 1.43 +++ browse.html 2001/12/21 07:36:13 1.44 @@ -19,5 +19,5 @@ <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> - <td width="65%" align="center" bgcolor="#AAAAAA"> + <td width="50%" align="center" bgcolor="#AAAAAA"> <select name="vcs_command"> <option></option> @@ -29,5 +29,5 @@ <input type="submit" name="action" value="vcsaction" /> </td> - <td width="40%" align="center" bgcolor="#AAAAAA"> + <td width="50%" align="center" bgcolor="#AAAAAA"> <select name="file_command"> <option></option> |
From: Rob H. <for...@us...> - 2001-12-21 07:31:15
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv30924/templates Modified Files: browse.html Log Message: adjusted one td to match the other Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.42 retrieving revision 1.43 diff -U2 -r1.42 -r1.43 --- browse.html 2001/12/21 07:25:43 1.42 +++ browse.html 2001/12/21 07:31:12 1.43 @@ -63,5 +63,5 @@ <table width="100%" border="1"> <tr> - <td width="65%" align="left"> + <td width="60%" align="left"> <a href="javascript:selectAll(document.browse.filename)">Select All</a> | |
From: Rob H. <for...@us...> - 2001-12-21 07:25:45
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv29768/templates Modified Files: browse.html Log Message: made browse look good in 640x480.. :) ( on my screen anyway. should look fine in Win/IE since the fonts are smaller than Linux/Moz ) Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.41 retrieving revision 1.42 diff -U2 -r1.41 -r1.42 --- browse.html 2001/12/20 22:58:03 1.41 +++ browse.html 2001/12/21 07:25:43 1.42 @@ -19,5 +19,5 @@ <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> - <td width="60%" align="center" bgcolor="#AAAAAA"> + <td width="65%" align="center" bgcolor="#AAAAAA"> <select name="vcs_command"> <option></option> @@ -63,5 +63,5 @@ <table width="100%" border="1"> <tr> - <td width="55%" align="left"> + <td width="65%" align="left"> <a href="javascript:selectAll(document.browse.filename)">Select All</a> | @@ -75,5 +75,5 @@ </font> </td> - <td width="10%" align="left" bgcolor="#CCCCCC"> + <td width="20%" align="left" bgcolor="#CCCCCC"> <font size="2">   Commands @@ -104,5 +104,5 @@ </a> </td> - <td align="left" width="10%"> + <td align="left" width="20%">   <font size="2"> |
From: Rob H. <for...@us...> - 2001-12-21 07:16:06
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv28019/lib/SandWeb Modified Files: Browse.pm Log Message: Browse object uses File object for file info now Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -U2 -r1.23 -r1.24 --- Browse.pm 2001/12/20 02:34:46 1.23 +++ Browse.pm 2001/12/21 07:15:59 1.24 @@ -7,4 +7,5 @@ use strict; use lib '../lib'; + use SandWeb::File; use HTML::Template; @@ -119,5 +120,5 @@ $row_data{FILESIZE} = $file->get_size(); $row_data{FILEAGE} = $file->get_age(); - if (-d "$sandbox/$path/$filename") { + if ( $file->get_file_type() eq "Directory" ) { if ($repo_type eq "CVS") { next if ($filename =~ /^CVS$/); @@ -129,18 +130,18 @@ } else { $row_data{COLOR} = "$color1"; - } } - elsif (-T "$sandbox/$path/$filename") { - $row_data{FILETYPE} = "text"; - $row_data{LINK} = "action=file&filename=$filename"; + } + elsif ( $file->get_file_type() eq "Text" ) { + $row_data{FILETYPE} = "text"; + $row_data{LINK} = "action=file&filename=$filename"; if ($counter eq "0") { - $row_data{COLOR} = "$color0"; + $row_data{COLOR} = "$color0"; } else { - $row_data{COLOR} = "$color1"; + $row_data{COLOR} = "$color1"; } } - elsif (-B "$sandbox/$path/$filename") { - $row_data{FILETYPE} = "binary"; - $row_data{LINK} = "action=file&filename=$filename"; + elsif ( $file->get_file_type() eq "Binary" ) { + $row_data{FILETYPE} = "binary"; + $row_data{LINK} = "action=file&filename=$filename"; if ($counter eq "0") { $row_data{COLOR} = "$color0"; |
From: Rob H. <for...@us...> - 2001-12-21 02:40:19
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv15485/bin Modified Files: sandweb.cgi Log Message: implemented the File object in place of raw open/close statements in more places, and made edit_file go to view_file after a file is saved ( rather than making it go back to the last known browse location ) Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.104 retrieving revision 1.105 diff -U2 -r1.104 -r1.105 --- sandweb.cgi 2001/12/21 01:12:47 1.104 +++ sandweb.cgi 2001/12/21 02:40:16 1.105 @@ -302,5 +302,6 @@ if ( $repo_type eq 'CVS' ) { - $log->debug("repo type is CVS, setting up CVSROOT"); + $log->debug("repo_type is CVS"); + if ( $connection eq 'local' ) { $vcsroot = "$root"; @@ -310,4 +311,10 @@ } + if ( $vcsroot ) { + $log->debug("setting up vcsroot $vcsroot"); + } else { + $log->debug("no vcsroot set!"); + } + $log->debug("creating Repository object"); my $repository = SandWeb::Repository->new( @@ -457,18 +464,17 @@ $log->debug("viewing file : $filename"); - my @tmp = $file->file_read(); + my $content = $file->file_read(); if ( $file->get_file_type() ne "Text" ) { $log->debug("User wants to view non-text file : $filename"); set_error("This does not appear to be a text file."); - @tmp = (); + $content = ""; } - my $content = $ui->get_menu( MENU => 'view_file', PROGNAME => $progname, FILENAME => "$filename", - CONTENT => "@tmp", + CONTENT => "$content", ); @@ -491,64 +497,39 @@ $log->debug("saving edited file : $filename"); - $log->debug("opening $users_dir/$username$location/$filename"); - unless (open ( FILE, "> $users_dir/$username$location/$filename" )) { - $log->error("could not open $users_dir/$username$location/$filename for writing : $!"); - browse_menu( - cookie => $cookie, - path => $location, - ); - } - print FILE "$data"; - unless (close FILE) { - my $error = "could not save $users_dir/$username$location/$filename : $!"; - $log->error("$error"); - set_error("$error"); - browse_menu( - cookie => $cookie, - path => $location, - ); - } - - browse_menu( - cookie => $cookie, - path => $location, + $log->debug("editing $users_dir/$username$location/$filename"); + $file->file_write( + 'location' => "$location", + 'filename' => "$filename", + 'contents' => $data, ); + + my @filename = $filename; + + file( + cookie => $cookie, + file_command => "view", + filename => \@filename, + location => $location, + ); } if ( $file->get_file_type() ne "Text" ) { $log->debug("User wants to edit non-text file : $filename"); set_error("This does not appear to be a text file."); - browse_menu( - cookie => $cookie, - path => $location, - ); - } - my @tmp; - $log->debug("opening $users_dir/$username/$location/$filename"); - unless (open (FILE, "< $users_dir/$username/$location/$filename") ) { - my $error = "could not open $users_dir/$username/$location/$filename for reading : $!"; - $log->error("$error"); - set_error("$error"); - browse_menu( - cookie => $cookie, - path => $location, + file( + cookie => $cookie, + file_command => "view", + filename => $filename, + location => $location, ); } - foreach my $line (<FILE>) { - push @tmp, $line; - } - unless (close FILE) { - my $error = "could not close $users_dir/$username/$location/$filename : $!"; - $log->error("$error"); - set_error("$error"); - browse_menu( - cookie => $cookie, - path => $location, - ); - } + $log->debug("reading $users_dir/$username/$location/$filename"); + + my $content = $file->file_read(); + $log->debug("closing $users_dir/$username/$location/$filename"); my $content = $ui->get_menu( MENU => 'edit_file', PROGNAME => $progname, - CONTENT => "@tmp", + CONTENT => "$content", FILENAME => $filename, LOCATION => $location, |
From: Rob H. <for...@us...> - 2001-12-21 01:12:53
|
Update of /cvsroot/sandweb/sandweb/etc In directory usw-pr-cvs1:/tmp/cvs-serv31315/etc Modified Files: sandweb.cfg Log Message: made mime.types location and filename configurable in sandweb.cfg Index: sandweb.cfg =================================================================== RCS file: /cvsroot/sandweb/sandweb/etc/sandweb.cfg,v retrieving revision 1.9 retrieving revision 1.10 diff -U2 -r1.9 -r1.10 --- sandweb.cfg 2001/09/20 21:47:16 1.9 +++ sandweb.cfg 2001/12/21 01:12:47 1.10 @@ -30,4 +30,7 @@ /> -</config> + <webserver mime-types_location="/usr/local/apache/conf" + mime-types_file="mime.types" + /> +</config> |
From: Rob H. <for...@us...> - 2001-12-21 01:12:53
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv31315/lib/SandWeb Modified Files: File.pm Log Message: made mime.types location and filename configurable in sandweb.cfg Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -U2 -r1.25 -r1.26 --- File.pm 2001/12/20 23:31:37 1.25 +++ File.pm 2001/12/21 01:12:47 1.26 @@ -17,4 +17,5 @@ my $filename = $args{'filename'}; my $log_obj = $args{'log_obj'}; + my $config = $args{'config_obj'}; my $location = $args{'location'}; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, @@ -26,4 +27,5 @@ 'location' => $location, 'log_obj' => $log_obj, + 'config_obj' => $config, 'mode' => $mode, 'uid' => $uid, @@ -86,8 +88,16 @@ my $location = $self->{'location'}; my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; + my $config = $self->{'config_obj'}; + + my $mime_file = $config->{'webserver'}->{'mime-types_file'}; + my $mime_location = $config->{'webserver'}->{'mime-types_location'}; my $mime_type = _get_mime_type( 'location' => "$location", 'filename' => "$filename", + 'mime_file' => "$mime_file", + 'mime_location' => "$mime_location", + 'log_obj' => "$log", ); @@ -113,4 +123,8 @@ my $filename = $self->{'filename'}; my $log = $self->{'log_obj'}; + my $config = $self->{'config_obj'}; + + my $mime_location = $config->{'webserver'}->{'mime-types_location'}; + my $mime_file = $config->{'webserver'}->{'mime-types_file'}; $log->debug("downloading file : $location/$filename"); @@ -120,4 +134,7 @@ 'location' => "$location", 'filename' => "$filename", + 'mime_file' => "$mime_file", + 'mime_location' => "$mime_location", + 'log_obj' => "$log", ); $log->debug("MIME type looks like : $mime_type"); @@ -212,9 +229,9 @@ my @fromfile = _do_file_read(); + _do_file_write( 'filename' => $filename, 'location' => $location, 'contents' => "@fromfile", - 'log_obj' => $log, ); @@ -246,9 +263,6 @@ 'location' => "$location", 'filename' => "$filename", - 'log_obj' => $log, ); - - return $contents; } @@ -288,11 +302,19 @@ my $location = $args{'location'}; my $filename = $args{'filename'}; + my $log = $args{'log_obj'}; + my $mime_location = $args{'mime_location'}; + my $mime_file = $args{'mime_file'}; my @file_split = split(/\./, $filename); my $file_extension = $file_split[$#file_split]; my $mime_type; - open FILE,"< /usr/local/apache/conf/mime.types"; - my @mimes = <FILE>; - close FILE; + + my $mime_output = _do_file_read( + 'location' => "$mime_location", + 'filename' => "$mime_file", + ); + + my @mimes = split(/ /, $mime_output); + foreach my $entry (@mimes) { unless ( $entry =~ /^#/) { |
From: Rob H. <for...@us...> - 2001-12-21 01:12:53
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv31315/bin Modified Files: sandweb.cgi Log Message: made mime.types location and filename configurable in sandweb.cfg Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.103 retrieving revision 1.104 diff -U2 -r1.103 -r1.104 --- sandweb.cgi 2001/12/20 23:31:31 1.103 +++ sandweb.cgi 2001/12/21 01:12:47 1.104 @@ -439,11 +439,4 @@ } - $log->debug("creating Repository object"); - my $repository = SandWeb::Repository->new( - root => $vcsroot, - repo_type => $repo_type, - sandbox => "$users_dir/$username/$location", - ); - my $group; my $permissions; @@ -454,4 +447,5 @@ $log->debug("creating file object"); $file = SandWeb::File->new( + 'config_obj' => $config, 'log_obj' => $log, 'filename' => $filename, @@ -459,32 +453,6 @@ ); } - - if ( $file_command eq 'info' ) { - $log->debug("calling file info routine"); - # can't give the leading / to the VCS - $filename =~ s/\///; - my %return = $repository->log( file => "$filename" ); - my $content = $ui->get_menu( - MENU => 'file_info', - PROGNAME => $progname, - LOCATION => $location, - FULLPATH => "$users_dir/$username/$location", - VCS_OUTPUT => $return{'output'}, - VCS_ERROR => $return{'error'}, - ); - - print header( -cookie => $cookie ); - $ui->print_screen( - TITLE=> 'SandWeb : File Info', - MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => 'file info', - FOOTER => '', - CONTENT => $content, - ERROR => $error, - ); - exit 0; - } - elsif ( $file_command eq 'view' ) { + if ( $file_command eq 'view' ) { $log->debug("viewing file : $filename"); |
From: Rob H. <for...@us...> - 2001-12-21 01:12:53
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv31315/templates Modified Files: view_file.html Log Message: made mime.types location and filename configurable in sandweb.cfg Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.8 retrieving revision 1.9 diff -U2 -r1.8 -r1.9 --- view_file.html 2001/12/20 23:05:58 1.8 +++ view_file.html 2001/12/21 01:12:47 1.9 @@ -4,4 +4,5 @@ <input type="hidden" name="action" value="file" /> <input type="submit" name="file_command" value="download" /> + <input type="submit" name="file_command" value="upload" /> <input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> <TMPL_VAR NAME=ERROR> |
From: Rob H. <for...@us...> - 2001-12-20 23:38:03
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv5039/bin Modified Files: sandweb.cgi Log Message: non-text files now give the download option when you click on them. it essentially pulls up the view_file template with no content. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.102 retrieving revision 1.103 diff -U2 -r1.102 -r1.103 --- sandweb.cgi 2001/12/20 23:11:38 1.102 +++ sandweb.cgi 2001/12/20 23:31:31 1.103 @@ -488,14 +488,13 @@ elsif ( $file_command eq 'view' ) { $log->debug("viewing file : $filename"); + + my @tmp = $file->file_read(); + if ( $file->get_file_type() ne "Text" ) { $log->debug("User wants to view non-text file : $filename"); set_error("This does not appear to be a text file."); - browse_menu( - cookie => $cookie, - path => $location, - ); + @tmp = (); } - my @tmp = $file->file_read(); my $content = $ui->get_menu( |
From: Rob H. <for...@us...> - 2001-12-20 23:38:03
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv5039/lib/SandWeb Modified Files: File.pm Log Message: non-text files now give the download option when you click on them. it essentially pulls up the view_file template with no content. Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -U2 -r1.24 -r1.25 --- File.pm 2001/12/20 23:26:19 1.24 +++ File.pm 2001/12/20 23:31:37 1.25 @@ -82,25 +82,14 @@ } -sub _get_mime_type { - my %args = @_; - my $location = $args{'location'}; - my $filename = $args{'filename'}; +sub get_mime_type { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; - my @file_split = split(/\./, $filename); - my $file_extension = $file_split[$#file_split]; - my $mime_type; - open FILE,"< /usr/local/apache/conf/mime.types"; - my @mimes = <FILE>; - close FILE; - foreach my $entry (@mimes) { - unless ( $entry =~ /^#/) { - my @mime_string = split(/\s+/, $entry); - if ($mime_string[1]) { - if ( $file_extension eq $mime_string[1] ){ - $mime_type = $mime_string[0]; - } - } - } - } + my $mime_type = _get_mime_type( + 'location' => "$location", + 'filename' => "$filename", + ); + return $mime_type; } @@ -293,4 +282,28 @@ 'download', ); +} + +sub _get_mime_type { + my %args = @_; + my $location = $args{'location'}; + my $filename = $args{'filename'}; + + my @file_split = split(/\./, $filename); + my $file_extension = $file_split[$#file_split]; + my $mime_type; + open FILE,"< /usr/local/apache/conf/mime.types"; + my @mimes = <FILE>; + close FILE; + foreach my $entry (@mimes) { + unless ( $entry =~ /^#/) { + my @mime_string = split(/\s+/, $entry); + if ($mime_string[1]) { + if ( $file_extension eq $mime_string[1] ){ + $mime_type = $mime_string[0]; + } + } + } + } + return $mime_type; } |
From: Rob H. <for...@us...> - 2001-12-20 23:26:21
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv3618/lib/SandWeb Modified Files: File.pm Log Message: created private method, _get_mime_type that's used by download Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -U2 -r1.23 -r1.24 --- File.pm 2001/12/20 23:11:38 1.23 +++ File.pm 2001/12/20 23:26:19 1.24 @@ -82,4 +82,28 @@ } +sub _get_mime_type { + my %args = @_; + my $location = $args{'location'}; + my $filename = $args{'filename'}; + + my @file_split = split(/\./, $filename); + my $file_extension = $file_split[$#file_split]; + my $mime_type; + open FILE,"< /usr/local/apache/conf/mime.types"; + my @mimes = <FILE>; + close FILE; + foreach my $entry (@mimes) { + unless ( $entry =~ /^#/) { + my @mime_string = split(/\s+/, $entry); + if ($mime_string[1]) { + if ( $file_extension eq $mime_string[1] ){ + $mime_type = $mime_string[0]; + } + } + } + } + return $mime_type; +} + sub get_size { my $self = shift; @@ -103,29 +127,19 @@ $log->debug("downloading file : $location/$filename"); 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; + + my $mime_type = _get_mime_type( + 'location' => "$location", + 'filename' => "$filename", + ); + $log->debug("MIME type looks like : $mime_type"); + + unless ($mime_type) { + $mime_type = "binary/unknown"; + } + + print "content-type:$mime_type\n\n"; + foreach my $line (@file) { + print "$line"; + } } |
From: Rob H. <for...@us...> - 2001-12-20 23:11:41
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv31266/lib/SandWeb Modified Files: File.pm Log Message: moved download/mime detection code into the download method of File.pm hmm, get_mime_type would make a good method too, would compliment get_file_type nicely ( knowing what's text and what's not is very cool, but it would be even cooler to take a guess at filetype based on MIME type and load a different icon, or be able to take different user-defined actions ). Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -U2 -r1.22 -r1.23 --- File.pm 2001/12/20 20:29:41 1.22 +++ File.pm 2001/12/20 23:11:38 1.23 @@ -95,4 +95,39 @@ } +sub download { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + my $log = $self->{'log_obj'}; + + $log->debug("downloading file : $location/$filename"); + 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; +} + sub create_file { my $self = shift; |
From: Rob H. <for...@us...> - 2001-12-20 23:11:41
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv31266/bin Modified Files: sandweb.cgi Log Message: moved download/mime detection code into the download method of File.pm hmm, get_mime_type would make a good method too, would compliment get_file_type nicely ( knowing what's text and what's not is very cool, but it would be even cooler to take a guess at filetype based on MIME type and load a different icon, or be able to take different user-defined actions ). Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.101 retrieving revision 1.102 diff -U2 -r1.101 -r1.102 --- sandweb.cgi 2001/12/20 23:05:57 1.101 +++ sandweb.cgi 2001/12/20 23:11:38 1.102 @@ -691,31 +691,5 @@ } 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; + $file->download(); } else { |
From: Rob H. <for...@us...> - 2001-12-20 23:08:03
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv29745/templates Modified Files: view_file.html Log Message: file download is still broken, but it at least detects the proper mime type and asks if you want to download it.. :) hmm.. both download and upload should be public methods in the File class, that'd be rad. Then we could just do like - my $file = SandWeb::File->new( filename => "/this/file.txt" ); $file->download(); of $file->upload(); if it was a new file. Rad. Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.7 retrieving revision 1.8 diff -U2 -r1.7 -r1.8 --- view_file.html 2001/11/30 20:31:42 1.7 +++ view_file.html 2001/12/20 23:05:58 1.8 @@ -2,5 +2,7 @@ <TMPL_VAR NAME=FILENAME> <form submit="<TMPL_VAR NAME=PROGNAME>"> - <input type="submit" name="view_method" value="Download" /> + <input type="hidden" name="action" value="file" /> + <input type="submit" name="file_command" value="download" /> + <input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> <TMPL_VAR NAME=ERROR> <pre> <TMPL_VAR NAME=CONTENT></pre> |
From: Rob H. <for...@us...> - 2001-12-20 23:08:02
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv29745/bin Modified Files: sandweb.cgi Log Message: file download is still broken, but it at least detects the proper mime type and asks if you want to download it.. :) hmm.. both download and upload should be public methods in the File class, that'd be rad. Then we could just do like - my $file = SandWeb::File->new( filename => "/this/file.txt" ); $file->download(); of $file->upload(); if it was a new file. Rad. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.100 retrieving revision 1.101 diff -U2 -r1.100 -r1.101 --- sandweb.cgi 2001/12/20 20:29:41 1.100 +++ sandweb.cgi 2001/12/20 23:05:57 1.101 @@ -489,5 +489,5 @@ $log->debug("viewing file : $filename"); if ( $file->get_file_type() ne "Text" ) { - $log->debug("User wants to view non-text file."); + $log->debug("User wants to view non-text file : $filename"); set_error("This does not appear to be a text file."); browse_menu( @@ -502,4 +502,5 @@ MENU => 'view_file', PROGNAME => $progname, + FILENAME => "$filename", CONTENT => "@tmp", ); |
From: Rob H. <for...@us...> - 2001-12-20 22:58:07
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv27850/templates Modified Files: browse.html Log Message: changed what happens when you click on a filename from "info" to "view" Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.40 retrieving revision 1.41 diff -U2 -r1.40 -r1.41 --- browse.html 2001/12/19 22:35:22 1.40 +++ browse.html 2001/12/20 22:58:03 1.41 @@ -98,5 +98,5 @@ <a name="<TMPL_VAR NAME=ENTRY>"> </input> - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=info&location=<TMPL_VAR NAME=LOCATION>"> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&file_command=view&location=<TMPL_VAR NAME=LOCATION>"> <img src="/icons/<TMPL_VAR NAME=FILETYPE>.gif" alt="" border=0 width=20 height=22> |
From: Rob H. <for...@us...> - 2001-12-20 20:29:45
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv17176/bin Modified Files: sandweb.cgi Log Message: added debugging to the File class Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.99 retrieving revision 1.100 diff -U2 -r1.99 -r1.100 --- sandweb.cgi 2001/12/20 02:30:37 1.99 +++ sandweb.cgi 2001/12/20 20:29:41 1.100 @@ -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'\n"); + $log->debug("unable to get valid cookie: '$cookie'"); login_menu(); exit 0; @@ -93,5 +93,5 @@ # User is logged in; load prefs load_prefs(1); - $log->debug("loading prefs\n"); + $log->debug("loading prefs"); my $username = $auth->get_userinfo('username'); @@ -173,5 +173,5 @@ my $page = param('action'); my $msg = "Invalid page - $page!"; - $log->error("$msg\n"); + $log->error("$msg"); set_error("$msg"); debug_menu( cookie => $cookie ); @@ -181,5 +181,5 @@ else { # no cookie, default login_menu - $log->debug("no cookie found: '$cookie'\n"); + $log->debug("no cookie found: '$cookie'"); login_menu(); } @@ -198,5 +198,5 @@ my %args = @_; - $log->debug("entering login menu\n"); + $log->debug("entering login menu"); my $content = $ui->get_menu( @@ -221,5 +221,5 @@ my %args = @_; - $log->debug("entering main menu\n"); + $log->debug("entering main menu"); my $cookie = $args{'cookie'}; @@ -233,5 +233,5 @@ } - $log->debug("cookie: '$cookie'\n"); + $log->debug("cookie: '$cookie'"); print header( -cookie => $cookie ); @@ -251,5 +251,5 @@ my %args = @_; - $log->debug("entering debug menu\n"); + $log->debug("entering debug menu"); my $cookie = $args{'cookie'}; @@ -302,5 +302,5 @@ if ( $repo_type eq 'CVS' ) { - $log->debug("repo type is CVS, setting up CVSROOT\n"); + $log->debug("repo type is CVS, setting up CVSROOT"); if ( $connection eq 'local' ) { $vcsroot = "$root"; @@ -310,5 +310,5 @@ } - $log->debug("creating Repository object\n"); + $log->debug("creating Repository object"); my $repository = SandWeb::Repository->new( root => "$vcsroot", @@ -317,5 +317,5 @@ ); - $log->debug("creating Browse object\n"); + $log->debug("creating Browse object"); my $browse = SandWeb::Browse->new( username => $username, @@ -324,5 +324,5 @@ ); - $log->debug("creating File object\n"); + $log->debug("creating File object"); my $file = SandWeb::File->new( 'log_obj' => $log, @@ -358,5 +358,5 @@ my %args = @_; - $log->debug("entering file handling routine\n"); + $log->debug("entering file handling routine"); my $cookie = $args{'cookie'}; @@ -372,7 +372,7 @@ my $file_command = $args{'file_command'}; - $log->debug("file command is : $file_command\n"); + $log->debug("file command is : $file_command"); my $location = $args{'location'}; - $log->debug("location is : $location\n"); + $log->debug("location is : $location"); my @filename = (); my $count = 0; @@ -397,5 +397,5 @@ if ( $file_command eq 'remove' ) { unless (@filename) { - $log->debug("no files selected for removal\n"); + $log->debug("no files selected for removal"); set_error("Please select file(s) or folder(s) to remove."); browse_menu( @@ -487,7 +487,7 @@ } elsif ( $file_command eq 'view' ) { - $log->debug("viewing file : $filename\n"); + $log->debug("viewing file : $filename"); if ( $file->get_file_type() ne "Text" ) { - $log->debug("User wants to view non-text file.\n"); + $log->debug("User wants to view non-text file."); set_error("This does not appear to be a text file."); browse_menu( @@ -517,13 +517,13 @@ } elsif ( $file_command eq 'edit' ) { - $log->debug("editing file : $filename \n"); + $log->debug("editing file : $filename"); if ($save) { my $data = param('data'), my $filename = $file->get_filename(); - $log->debug("saving edited file : $filename \n"); + $log->debug("saving edited file : $filename"); - $log->debug("opening $users_dir/$username$location/$filename\n"); + $log->debug("opening $users_dir/$username$location/$filename"); unless (open ( FILE, "> $users_dir/$username$location/$filename" )) { - $log->error("could not open $users_dir/$username$location/$filename for writing : $!\n"); + $log->error("could not open $users_dir/$username$location/$filename for writing : $!"); browse_menu( cookie => $cookie, @@ -534,6 +534,6 @@ unless (close FILE) { my $error = "could not save $users_dir/$username$location/$filename : $!"; - $log->error("$error\n"); - set_error("$error\n"); + $log->error("$error"); + set_error("$error"); browse_menu( cookie => $cookie, @@ -548,5 +548,5 @@ } if ( $file->get_file_type() ne "Text" ) { - $log->debug("User wants to edit non-text file : $filename\n"); + $log->debug("User wants to edit non-text file : $filename"); set_error("This does not appear to be a text file."); browse_menu( @@ -556,8 +556,8 @@ } my @tmp; - $log->debug("opening $users_dir/$username/$location/$filename\n"); + $log->debug("opening $users_dir/$username/$location/$filename"); unless (open (FILE, "< $users_dir/$username/$location/$filename") ) { my $error = "could not open $users_dir/$username/$location/$filename for reading : $!"; - $log->error("$error\n"); + $log->error("$error"); set_error("$error"); browse_menu( @@ -571,5 +571,5 @@ unless (close FILE) { my $error = "could not close $users_dir/$username/$location/$filename : $!"; - $log->error("$error\n"); + $log->error("$error"); set_error("$error"); browse_menu( @@ -578,5 +578,5 @@ ); } - $log->debug("closing $users_dir/$username/$location/$filename\n"); + $log->debug("closing $users_dir/$username/$location/$filename"); my $content = $ui->get_menu( MENU => 'edit_file', @@ -1085,5 +1085,5 @@ if ($stat) { - $log->standard("$username logged on.\n"); + $log->standard("$username logged on."); my $cookie = cookie( $auth->set_cookie() ); unless ($cookie) { @@ -1094,5 +1094,5 @@ } else { - $log->standard("Invalid login attempt, username: $username\n"); + $log->standard("Invalid login attempt, username: $username"); set_error("Login incorrect!"); login_menu(); |