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...> - 2002-01-27 00:03:55
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv9811/lib/SandWeb Modified Files: Browse.pm Log Message: changed "browse_menu" to "browse_repository_menu" Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.31 retrieving revision 1.32 diff -U2 -r1.31 -r1.32 --- Browse.pm 2002/01/26 23:27:59 1.31 +++ Browse.pm 2002/01/27 00:03:52 1.32 @@ -54,6 +54,4 @@ my $content = HTML::Template->new( filename => "$template_dir/browse.html" ); - my $location; - if ($location eq '/') { $location = ''; @@ -95,5 +93,5 @@ $content->param( PROGNAME => $progname, - LOCATION => $location, + LOCATION => $location, LOCATION_LOOP => \@loop_data, ); @@ -137,5 +135,5 @@ } $row_data{FILETYPE} = "dir"; - $row_data{LINK} = "action=browse_menu&location=$location/$filename"; + $row_data{LINK} = "action=browse_repository_menu&location=$location/$filename"; if ($counter eq "0") { $row_data{COLOR} = "$color0"; |
From: Nick J. <nje...@us...> - 2002-01-26 23:30:56
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv3384/bin Modified Files: sandweb.cgi Log Message: * fixed browse menu bug (for real this time) Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.127 retrieving revision 1.128 diff -U2 -r1.127 -r1.128 --- sandweb.cgi 2002/01/26 23:29:58 1.127 +++ sandweb.cgi 2002/01/26 23:30:54 1.128 @@ -307,5 +307,5 @@ # main menu to browse section. sub browse_menu { - %args = @_; + my %args = @_; my $cookie = $args{'cookie'}; |
From: Nick J. <nje...@us...> - 2002-01-26 23:30:01
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv3158 Modified Files: sandweb.cgi Log Message: * fixed browse_menu bug Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.126 retrieving revision 1.127 diff -U2 -r1.126 -r1.127 --- sandweb.cgi 2002/01/26 23:27:33 1.126 +++ sandweb.cgi 2002/01/26 23:29:58 1.127 @@ -307,5 +307,5 @@ # main menu to browse section. sub browse_menu { - + %args = @_; my $cookie = $args{'cookie'}; |
From: Rob H. <for...@us...> - 2002-01-26 23:28:02
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv2483/templates Modified Files: browse.html edit_file.html template.html vcs_output.html view_file.html Log Message: changed "location" to "path" and "browse_menu" to "browse_repository_menu" to make room for new "browse_menu" to support multiple repositories on Hack SandWeb Dat Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.47 retrieving revision 1.48 diff -U2 -r1.47 -r1.48 --- browse.html 2001/12/21 22:17:37 1.47 +++ browse.html 2002/01/26 23:27:59 1.48 @@ -54,5 +54,5 @@ Current location : <TMPL_LOOP NAME="LOCATION_LOOP"> - <a href="<TMPL_VAR NAME="PROGNAME">?action=browse_menu&path=<TMPL_VAR NAME="LOCATION_FULL">"><TMPL_VAR NAME="LOCATION_LINK"></a> + <a href="<TMPL_VAR NAME="PROGNAME">?action=browse_repository_menu&location=<TMPL_VAR NAME="LOCATION_FULL">"><TMPL_VAR NAME="LOCATION_LINK"></a> </TMPL_LOOP> </font> Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.13 retrieving revision 1.14 diff -U2 -r1.13 -r1.14 --- edit_file.html 2002/01/26 22:25:26 1.13 +++ edit_file.html 2002/01/26 23:27:59 1.14 @@ -1,5 +1,5 @@ <p> <p> - Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> + Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&location=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> <br /> Current filename : <TMPL_VAR NAME=FILENAME> Index: template.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/template.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- template.html 2001/12/04 00:43:57 1.2 +++ template.html 2002/01/26 23:27:59 1.3 @@ -1,12 +1,24 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <title></title> - </head> - <body> - <p></p> - </body> -</html> +<table border="0" align="center" width="100%" cellpadding="4" cellspacing="4"> + <tr> + <td align="left" valign="middle"> + <form method="post" + action="<TMPL_VAR NAME=PROGNAME>" + enctype="application/x-www-form-urlencoded" name="<!-- CONTENT -->"> + <input type="hidden" name="action" value="login" /> + <table border="0"> + <tr> + <!-- CONTENT --> + </td> + </tr> + <tr> + <!-- CONTENT --> + </td> + </tr> + </table> + <!-- CONTENT --> + <input type="password" name="password" size="10" /> + </form> + </td> + </tr> + <tr> +</table> Index: vcs_output.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/vcs_output.html,v retrieving revision 1.6 retrieving revision 1.7 diff -U2 -r1.6 -r1.7 --- vcs_output.html 2002/01/26 22:22:10 1.6 +++ vcs_output.html 2002/01/26 23:27:59 1.7 @@ -1,4 +1,4 @@ <p> - Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=/<TMPL_VAR NAME=LOCATION>">/<TMPL_VAR NAME=LOCATION></a> + Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_repository_menu&location=/<TMPL_VAR NAME=LOCATION>">/<TMPL_VAR NAME=LOCATION></a> <br /> Current filename : <TMPL_VAR NAME=FILENAME> Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.21 retrieving revision 1.22 diff -U2 -r1.21 -r1.22 --- view_file.html 2002/01/26 21:39:51 1.21 +++ view_file.html 2002/01/26 23:27:59 1.22 @@ -5,5 +5,5 @@ <tr> <td width="50%"> - Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> + Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_repository_menu&location=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> <br /> </td> |
From: Rob H. <for...@us...> - 2002-01-26 23:28:02
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv2483/lib/SandWeb Modified Files: Browse.pm Log Message: changed "location" to "path" and "browse_menu" to "browse_repository_menu" to make room for new "browse_menu" to support multiple repositories on Hack SandWeb Dat Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.30 retrieving revision 1.31 diff -U2 -r1.30 -r1.31 --- Browse.pm 2002/01/26 22:12:24 1.30 +++ Browse.pm 2002/01/26 23:27:59 1.31 @@ -32,5 +32,5 @@ sub browse { my $self = shift; - my $path = shift; + my $location = shift; my $progname = shift; my $vcs_commands = shift; @@ -56,13 +56,12 @@ my $location; - if ($path eq '/') { - $path = ''; + if ($location eq '/') { + $location = ''; } - if ($path) { + if ($location) { # Security check, no "/.." or "../" allowed mister! - $path =~ s:/\.\.::g; - $path =~ s:\.\./::g; - $location = $path; + $location =~ s:/\.\.::g; + $location =~ s:\.\./::g; } else { $location = '/'; @@ -106,8 +105,8 @@ - if ( opendir(SANDBOX, "$sandbox/$path") ) { - $log->debug("Opened folder : $sandbox/$path"); + if ( opendir(SANDBOX, "$sandbox/$location") ) { + $log->debug("Opened folder : $sandbox/$location"); } else { - $log->debug("Cannot open folder $sandbox/$path : $!"); + $log->debug("Cannot open folder $sandbox/$location : $!"); } my @entries = readdir(SANDBOX); @@ -127,5 +126,5 @@ my $entryname = $row_data{ENTRY}; my $file = SandWeb::File->new( - location => "$sandbox/$path", + location => "$sandbox/$location", filename => "$entryname", ); @@ -138,5 +137,5 @@ } $row_data{FILETYPE} = "dir"; - $row_data{LINK} = "action=browse_menu&path=$path/$filename"; + $row_data{LINK} = "action=browse_menu&location=$location/$filename"; if ($counter eq "0") { $row_data{COLOR} = "$color0"; |
From: Nick J. <nje...@us...> - 2002-01-26 23:27:35
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv2301/bin Modified Files: sandweb.cgi Log Message: * corrected location => path, path => location problem in sandweb.cgi * fixed user prefs loading so one repository acts the same as multiple repositories. * working on modified browse_menu (not complete) Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.125 retrieving revision 1.126 diff -U2 -r1.125 -r1.126 --- sandweb.cgi 2002/01/26 21:56:00 1.125 +++ sandweb.cgi 2002/01/26 23:27:33 1.126 @@ -128,11 +128,22 @@ elsif ( $action eq 'browse_menu' ) { # called sandbox viewer - my $path = CGI::param('path'); - unless ($path) { - $path = ""; + my $location = CGI::param('location'); + unless ($location) { + $location = ""; } browse_menu( + cookie => $cookie, + location => $location, + ); + } + elsif ( $action eq 'browse_repository_menu' ) { + # called sandbox viewer + my $location = CGI::param('location'); + unless ($location) { + $location = ""; + } + browse_repository_menu( cookie => $cookie, - path => $path, + location => $location, ); } @@ -292,11 +303,27 @@ } -# calls the Browse object, for viewing/selecting files +# browse menu +# +# main menu to browse section. sub browse_menu { + + my $cookie = $args{'cookie'}; + +} + +# +# calls the Browse object, for viewing/selecting files +# args: +# +# location - scalar to specify where to browse. +# cookie - the sessions cookie +# +sub browse_repository_menu { my %args = @_; + my $location = $args{'location'} || ''; + my $cookie = $args{'cookie'}; $log->debug("entering browse menu"); - my $cookie = $args{'cookie'}; unless ($cookie) { &login_menu(); @@ -361,9 +388,8 @@ $repo_type = $repository->get_repo_type(); - my $path = $args{'path'} || ''; # use the browse object to show user's sandbox - my $content = $browse->browse("$path", "$progname", "@vcs_commands", "@file_commands", $repo_type); + my $content = $browse->browse("$location", "$progname", "@vcs_commands", "@file_commands", $repo_type); print CGI::header( -cookie => $cookie ); @@ -427,7 +453,7 @@ $log->debug("no files selected for removal"); set_error("Please select file(s) or folder(s) to remove."); - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); } @@ -456,7 +482,7 @@ } - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); } @@ -599,7 +625,7 @@ if ($file) { $file->create_file(); - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); exit 0; @@ -626,7 +652,7 @@ if ($file) { $file->create_folder(); - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); exit 0; @@ -666,7 +692,7 @@ ); - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); } @@ -712,7 +738,7 @@ else { set_error("Invalid selection: $file_command"); - browse_menu( + browse_repository_menu( cookie => $cookie, - path => $location, + location => $location, ); } @@ -1063,4 +1089,17 @@ 'log_obj' => $log, ); + + $log->debug("verifying repository data structure"); + # make sure data structure containing repositories is consistent + if ( ($userprefs->{'repository'}->{'repo_type'}) && + (ref(\$userprefs->{'repository'}->{'repo_type'}) eq 'SCALAR')) { + + $log->debug("repo_type is not a repository entry."); + my %temp = %{$userprefs->{'repository'}}; + #delete $userprefs->{'repository'}; + %{$userprefs->{'repository'}} = (); + %{$userprefs->{'repository'}->{$temp{'name'}}} = %temp; + } + return 1; } |
From: Rob H. <for...@us...> - 2002-01-26 22:25:28
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv21501 Modified Files: edit_file.html Log Message: HTML problem cause "current location" clickable to not work Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.12 retrieving revision 1.13 diff -U2 -r1.12 -r1.13 --- edit_file.html 2002/01/26 21:39:51 1.12 +++ edit_file.html 2002/01/26 22:25:26 1.13 @@ -1,6 +1,5 @@ <p> <p> - Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=< -TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> + 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> |
From: Rob H. <for...@us...> - 2002-01-26 22:22:14
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv20736/templates Modified Files: vcs_output.html Log Message: fixed cvs output a bit, plus added "cvs update" handler for "?" aka "Unknown" Index: vcs_output.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/vcs_output.html,v retrieving revision 1.5 retrieving revision 1.6 diff -U2 -r1.5 -r1.6 --- vcs_output.html 2002/01/02 22:51:52 1.5 +++ vcs_output.html 2002/01/26 22:22:10 1.6 @@ -10,6 +10,4 @@ </form> <font color="#FF0000"><TMPL_VAR NAME=VCS_ERROR></font> -<pre> -<TMPL_VAR NAME=VCS_OUTPUT> -</pre> +<pre><TMPL_VAR NAME=VCS_OUTPUT></pre> </p> |
From: Rob H. <for...@us...> - 2002-01-26 22:22:13
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Repository In directory usw-pr-cvs1:/tmp/cvs-serv20736/lib/SandWeb/Repository Modified Files: CVS.pm Log Message: fixed cvs output a bit, plus added "cvs update" handler for "?" aka "Unknown" Index: CVS.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository/CVS.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -U2 -r1.25 -r1.26 --- CVS.pm 2002/01/23 21:03:04 1.25 +++ CVS.pm 2002/01/26 22:22:10 1.26 @@ -543,4 +543,7 @@ $line =~ s/^C/\<font color\=\"red\"\>Conflict\<\/font\>/; } + elsif ($line =~ /^\?/) { + $line =~ s/^\?/\<font color\=\"blue\"\>Unknown\<\/font\>/; + } elsif ($line =~ /warning/) { $line =~ s/warning/\<font color\=\"red\"\>warning\<\/font\>/; |
From: Rob H. <for...@us...> - 2002-01-26 22:22:13
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv20736/lib/SandWeb Modified Files: File.pm Log Message: fixed cvs output a bit, plus added "cvs update" handler for "?" aka "Unknown" Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -U2 -r1.36 -r1.37 --- File.pm 2002/01/19 22:38:49 1.36 +++ File.pm 2002/01/26 22:22:10 1.37 @@ -329,4 +329,5 @@ 'remove', 'rename', + 'upload', ); } |
Update of /cvsroot/sandweb/sandweb/ext_mods In directory usw-pr-cvs1:/tmp/cvs-serv19777 Added Files: modules.txt Removed Files: HTML-Template-2.2.tar.gz XML-Parser.2.30.tar.gz XML-Simple-1.05.tar.gz expat-1.95.1.tar.gz Log Message: removed modules, added list of modules/versions that we need --- NEW FILE --- perl 6.x HTML-Template-2.2 XML-Parser.2.30 XML-Simple-1.05 expat-1.95.1 --- HTML-Template-2.2.tar.gz DELETED --- --- XML-Parser.2.30.tar.gz DELETED --- --- XML-Simple-1.05.tar.gz DELETED --- --- expat-1.95.1.tar.gz DELETED --- |
From: Rob H. <for...@us...> - 2002-01-26 22:12:26
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv18467 Modified Files: Browse.pm Log Message: fixed security prob reported by njennings Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -U2 -r1.29 -r1.30 --- Browse.pm 2002/01/23 21:04:47 1.29 +++ Browse.pm 2002/01/26 22:12:24 1.30 @@ -61,6 +61,7 @@ if ($path) { - # Security check, no "/.." allowed mister! + # Security check, no "/.." or "../" allowed mister! $path =~ s:/\.\.::g; + $path =~ s:\.\./::g; $location = $path; } else { |
From: Rob H. <for...@us...> - 2002-01-26 21:56:03
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv14535 Modified Files: sandweb.cgi Log Message: upload is now on the browse_menu Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.124 retrieving revision 1.125 diff -U2 -r1.124 -r1.125 --- sandweb.cgi 2002/01/26 21:34:32 1.124 +++ sandweb.cgi 2002/01/26 21:56:00 1.125 @@ -655,13 +655,18 @@ my $filehandle = CGI::upload('filehandle'); if ( $filehandle) { - $filename =~ s/.*[\/\\](.*)/$1/; + $filename = $filehandle; + my $file = SandWeb::File->new( + 'config_obj' => $config, + 'log_obj' => $log, + 'filename' => $filename, + 'location' => "$users_dir/$username$location", + ); $file->upload( filehandle => $filehandle, ); - file( + + browse_menu( cookie => $cookie, - file_command => "view", - filename => \@filename, - location => $location, + path => $location, ); } |
From: Rob H. <for...@us...> - 2002-01-26 21:39:54
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv10736 Modified Files: view_file.html edit_file.html Log Message: hopefully this will eliminate stupid space problems with the inline editor Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- view_file.html 2002/01/26 21:34:32 1.20 +++ view_file.html 2002/01/26 21:39:51 1.21 @@ -41,7 +41,5 @@ <tr> <td width="100%" bgcolor="#EEEEEE"> - <pre> - <TMPL_VAR NAME=FILE_CONTENT> - </pre> + <pre><TMPL_VAR NAME=FILE_CONTENT></pre> </td> </tr> Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.11 retrieving revision 1.12 diff -U2 -r1.11 -r1.12 --- edit_file.html 2002/01/20 06:42:57 1.11 +++ edit_file.html 2002/01/26 21:39:51 1.12 @@ -14,5 +14,5 @@ <input type="submit" name="save" value="Save" /> <pre> -<textarea name="data" cols="80" rows="24"> <TMPL_VAR NAME=CONTENT></textarea> +<textarea name="data" cols="80" rows="24"><TMPL_VAR NAME=CONTENT></textarea> </pre> </form> |
From: Rob H. <for...@us...> - 2002-01-26 21:34:38
|
Update of /cvsroot/sandweb/sandweb/etc In directory usw-pr-cvs1:/tmp/cvs-serv9686/etc Modified Files: sandweb.cfg Log Message: made edit in view_file a link, plus made default mime_type-file location /etc/apache Index: sandweb.cfg =================================================================== RCS file: /cvsroot/sandweb/sandweb/etc/sandweb.cfg,v retrieving revision 1.12 retrieving revision 1.13 diff -U2 -r1.12 -r1.13 --- sandweb.cfg 2002/01/18 19:25:08 1.12 +++ sandweb.cfg 2002/01/26 21:34:32 1.13 @@ -16,5 +16,5 @@ <!-- config for cgi related information --> - <cgi-bin cgi_path="/cgi-bin/sandweb/bin" + <cgi-bin cgi_path="/cgi-bin/sandweb-robert/bin" cgi_domain="" /> @@ -30,5 +30,5 @@ /> - <webserver mime-types_location="/usr/local/apache/conf" + <webserver mime-types_location="/etc/apache/conf" mime-types_file="mime.types" /> |
From: Rob H. <for...@us...> - 2002-01-26 21:34:38
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv9686/templates Modified Files: view_file.html Log Message: made edit in view_file a link, plus made default mime_type-file location /etc/apache Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.19 retrieving revision 1.20 diff -U2 -r1.19 -r1.20 --- view_file.html 2002/01/25 07:41:56 1.19 +++ view_file.html 2002/01/26 21:34:32 1.20 @@ -11,7 +11,5 @@ <input type="hidden" name="action" value="file" /> <a href="<TMPL_VAR NAME=PROGNAME>/<TMPL_VAR NAME=FILENAME>?action=file&file_command=download&location=<TMPL_VAR NAME=LOCATION>&filename=<TMPL_VAR NAME=FILENAME>">download</a> - -<!-- <input type="submit" name="file_command" value="upload" /> --> - <TMPL_VAR NAME=EDIT><!-- <input type="submit" name="file_command" value="edit" /> --> + <TMPL_VAR NAME=EDIT> <TMPL_VAR NAME=ERROR> <br> |
From: Rob H. <for...@us...> - 2002-01-26 21:34:37
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv9686/bin Modified Files: sandweb.cgi Log Message: made edit in view_file a link, plus made default mime_type-file location /etc/apache Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.123 retrieving revision 1.124 diff -U2 -r1.123 -r1.124 --- sandweb.cgi 2002/01/25 18:21:12 1.123 +++ sandweb.cgi 2002/01/26 21:34:32 1.124 @@ -510,5 +510,5 @@ $file_content = ""; } else { - $edit = '<input type="submit" name="file_command" value="edit" />'; + $edit = "\<a href\=\"$progname\/$filename\?action\=file\&file_command\=edit\&location\=$location\&filename\=$filename\"\>edit\<\/a\>" } |
From: Rob H. <for...@us...> - 2002-01-25 18:21:15
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv22276 Modified Files: sandweb.cgi Log Message: added comments, replaced spaces with tabs Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.122 retrieving revision 1.123 diff -U2 -r1.122 -r1.123 --- sandweb.cgi 2002/01/25 07:41:56 1.122 +++ sandweb.cgi 2002/01/25 18:21:12 1.123 @@ -31,7 +31,7 @@ # object creation, all objects global throughout CGI my $return = SandWeb::->start_up( - config_dir => $config_dir, - config_file => $config_file, - progname => $progname, + config_dir => $config_dir, + config_file => $config_file, + progname => $progname, ); @@ -98,11 +98,10 @@ my $username = $auth->get_userinfo('username'); - my $repo = $userprefs->{'repository'}->{'name'}; - my $repo_type = $userprefs->{'repository'}->{'VCS'}; - my $root = $userprefs->{'repository'}->{'root'}; - my $server = $userprefs->{'repository'}->{'server'}; - my $sandbox = $userprefs->{'paths'}->{'users_dir'} . "/$username"; + my $repo = $userprefs->{'repository'}->{'name'}; + my $repo_type = $userprefs->{'repository'}->{'VCS'}; + my $root = $userprefs->{'repository'}->{'root'}; + my $server = $userprefs->{'repository'}->{'server'}; + my $sandbox = $userprefs->{'paths'}->{'users_dir'} . "/$username"; - if ( $action eq 'main_menu' ) { # called main menu @@ -125,5 +124,5 @@ elsif ( $action eq 'logout' ) { # called logout - logout(); + logout(); } elsif ( $action eq 'browse_menu' ) { @@ -133,5 +132,5 @@ $path = ""; } - browse_menu( + browse_menu( cookie => $cookie, path => $path, @@ -142,5 +141,5 @@ my @filename = (); @filename = CGI::param('filename'), - file( + file( cookie => $cookie, file_command => CGI::param('file_command'), @@ -191,10 +190,10 @@ my $page = $action; my $msg = "Invalid page - $page!"; - $log->error("$msg"); - set_error("$msg"); - debug_menu( cookie => $cookie ); + $log->error("$msg"); + set_error("$msg"); + debug_menu( cookie => $cookie ); } } - } + } else { # no cookie, default login_menu @@ -360,5 +359,5 @@ my @vcs_commands = $repository->get_vcs_commands(); my @file_commands = $file->get_file_commands(); - $repo_type = $repository->get_repo_type(); + $repo_type = $repository->get_repo_type(); my $path = $args{'path'} || ''; @@ -389,12 +388,12 @@ my $cookie = $args{'cookie'}; - unless ($cookie) { - &login_menu(); - exit 0; - } - if (! load_prefs()) { - # no existing user config, forward to prefs menu - preferences_menu( cookie => $cookie ); - } + unless ($cookie) { + &login_menu(); + exit 0; + } + if (! load_prefs()) { + # no existing user config, forward to prefs menu + preferences_menu( cookie => $cookie ); + } @@ -423,5 +422,5 @@ my $vcsroot; - # Remove a file ?? XXX + # Remove a file if ( $file_command eq 'remove' ) { unless (@filename) { @@ -439,6 +438,6 @@ my $file = SandWeb::File->new( 'log_obj' => $log, - 'filename' => $entry, - 'location' => "$users_dir/$username$location", + 'filename' => $entry, + 'location' => "$users_dir/$username$location", ); @@ -462,22 +461,23 @@ ); } + + # CVS parses network CVSROOTs and local CVSROOTs + # differently - # XXX if ( $repo_type eq 'CVS' ) { $log->debug("repo type is CVS, setting up CVSROOT"); - if ( $connection eq 'local' ) { - $vcsroot = "$root"; - } else { - $vcsroot = ":$connection:$vcs_username\@$server:$root"; - } + if ( $connection eq 'local' ) { + $vcsroot = "$root"; + } else { + $vcsroot = ":$connection:$vcs_username\@$server:$root"; + } } - # comments on what these vars mean? XXX - my $group; # XXX - my $permissions; # XXX - my $file_type; # XXX - my $file; # XXX + # Initialize variables for use by File class + my $file_type; # Text, Binary or Unknown + my $file; # File object - # XXX + # If a filename has been specified, create a file + # object for later use if ($filename) { $log->debug("creating file object"); @@ -490,5 +490,5 @@ } - # XXX + # file viewer if ( $file_command eq 'view' ) { $log->debug("viewing file : $filename"); @@ -722,12 +722,12 @@ my $cookie = $args{'cookie'}; - unless ($cookie) { - &login_menu(); - exit 0; - } - if (! load_prefs()) { - # no existing user config, forward to prefs menu - preferences_menu( cookie => $cookie ); - } + unless ($cookie) { + &login_menu(); + exit 0; + } + if (! load_prefs()) { + # no existing user config, forward to prefs menu + preferences_menu( cookie => $cookie ); + } my $vcs_command = $args{'vcs_command'}; @@ -831,21 +831,21 @@ my $content = $ui->get_menu( MENU => 'vcs_output', - LOCATION => $location, + LOCATION => $location, FILENAME => "@filename", - PROGNAME => $progname, - FULLPATH => "$users_dir/$username/$location", + PROGNAME => $progname, + FULLPATH => "$users_dir/$username/$location", VCS_OUTPUT => "@vcs_output", VCS_ERROR => "@vcs_error", - ); - print CGI::header( -cookie => $cookie ); - $ui->print_screen( - TITLE=> "SandWeb : VCS $vcs_command", - MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $vcs_command", - FOOTER => '', - CONTENT => $content, - ERROR => $error, - ); - exit 0; + ); + print CGI::header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> "SandWeb : VCS $vcs_command", + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => "VCS $vcs_command", + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; } @@ -904,6 +904,6 @@ if ( $repo_type eq 'CVS' ) { - $vcsroot = ":$connection:$vcs_username\@$server:$root"; - } else { + $vcsroot = ":$connection:$vcs_username\@$server:$root"; + } else { $vcsroot = "blah"; } @@ -1089,14 +1089,14 @@ sub logout { - my %args = @_; - my $stat = $auth->logout(); + my %args = @_; + my $stat = $auth->logout(); - if ($stat == 1) { - login_menu(); - } - else { + if ($stat == 1) { + login_menu(); + } + else { set_error("Logout failed: $stat"); - login_menu(); - } + login_menu(); + } } |
From: Nick J. <nje...@us...> - 2002-01-25 07:41:59
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv13852/bin Modified Files: sandweb.cgi Log Message: * updated view_file template * changed some vars and added content to sandweb.cgi Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.121 retrieving revision 1.122 diff -U2 -r1.121 -r1.122 --- sandweb.cgi 2002/01/21 00:23:18 1.121 +++ sandweb.cgi 2002/01/25 07:41:56 1.122 @@ -413,6 +413,6 @@ my $save = CGI::param('save'); my $username = $auth->get_userinfo('username'); - my $template_dir = $config->{'paths'}->{'template_dir'}; - my $users_dir = $config->{'paths'}->{'users_dir'}; + my $template_dir = $config->{'paths'}->{'template_dir'}; + my $users_dir = $config->{'paths'}->{'users_dir'}; my $server = $userprefs->{'repository'}->{'server'}; my $vcs_username = $userprefs->{'repository'}->{'username'}; @@ -423,4 +423,5 @@ my $vcsroot; + # Remove a file ?? XXX if ( $file_command eq 'remove' ) { unless (@filename) { @@ -462,4 +463,5 @@ } + # XXX if ( $repo_type eq 'CVS' ) { $log->debug("repo type is CVS, setting up CVSROOT"); @@ -469,11 +471,13 @@ $vcsroot = ":$connection:$vcs_username\@$server:$root"; } - } + } - my $group; - my $permissions; - my $file_type; - my $file; + # comments on what these vars mean? XXX + my $group; # XXX + my $permissions; # XXX + my $file_type; # XXX + my $file; # XXX + # XXX if ($filename) { $log->debug("creating file object"); @@ -481,20 +485,21 @@ 'config_obj' => $config, 'log_obj' => $log, - 'filename' => $filename, - 'location' => "$users_dir/$username$location", + 'filename' => $filename, + 'location' => "$users_dir/$username$location", ); } + # XXX if ( $file_command eq 'view' ) { $log->debug("viewing file : $filename"); - my $data = $file->file_read(); + my $file_content = $file->file_read(); # make output browser-friendly # Special Characters; RFC 1866 - $data =~ s/&/&/g; - $data =~ s/\"/"/g; - $data =~ s/</</g; - $data =~ s/>/>/g; + $file_content =~ s/&/&/g; + $file_content =~ s/\"/"/g; + $file_content =~ s/</</g; + $file_content =~ s/>/>/g; my $edit = ""; @@ -503,5 +508,5 @@ $log->debug("User wants to view non-text file : $filename"); set_error("This does not appear to be a text file."); - $data = ""; + $file_content = ""; } else { $edit = '<input type="submit" name="file_command" value="edit" />'; @@ -514,5 +519,8 @@ LOCATION => "$location", EDIT => "$edit", - DATA => "$data", + FILE_CONTENT => "$file_content", + FILE_SIZE => $file->get_size(), + FILE_TYPE => $file->get_file_type(), + FILE_AGE => $file->get_age(), ); @@ -531,5 +539,5 @@ $log->debug("editing file : $filename"); if ($save) { - my $data = CGI::param('data'), + my $file_content = CGI::param('data'), my $filename = $file->get_filename(); $log->debug("saving edited file : $filename"); @@ -539,5 +547,5 @@ 'location' => "$location", 'filename' => "$filename", - 'contents' => $data, + 'contents' => $file_content, ); @@ -545,9 +553,9 @@ file( - cookie => $cookie, - file_command => "view", - filename => \@filename, - location => $location, - ); + cookie => $cookie, + file_command => "view", + filename => \@filename, + location => $location, + ); } if ( $file->get_file_type() ne "Text" ) { @@ -555,9 +563,9 @@ set_error("This does not appear to be a text file."); file( - cookie => $cookie, - file_command => "view", - filename => $filename, - location => $location, - ); + cookie => $cookie, + file_command => "view", + filename => $filename, + location => $location, + ); } $log->debug("reading $users_dir/$username/$location/$filename"); @@ -733,6 +741,6 @@ my $message = CGI::param('message'); my $username = $auth->get_userinfo('username'); - my $template_dir = $config->{'paths'}->{'template_dir'}; - my $users_dir = $config->{'paths'}->{'users_dir'}; + my $template_dir = $config->{'paths'}->{'template_dir'}; + my $users_dir = $config->{'paths'}->{'users_dir'}; my %return; my $server = $userprefs->{'repository'}->{'server'}; @@ -747,10 +755,10 @@ if ( $repo_type eq 'CVS' ) { - if ( $connection eq 'local' ) { - $vcsroot = "$root"; - } else { - $vcsroot = ":$connection:$vcs_username\@$server:$root"; - } - } + if ( $connection eq 'local' ) { + $vcsroot = "$root"; + } else { + $vcsroot = ":$connection:$vcs_username\@$server:$root"; + } + } my $repository = SandWeb::Repository->new( @@ -774,19 +782,19 @@ my $content = $ui->get_menu( MENU => 'vcs_output', - LOCATION => $location, - PROGNAME => $progname, - FULLPATH => "$users_dir/$username/$location", + LOCATION => $location, + PROGNAME => $progname, + FULLPATH => "$users_dir/$username/$location", VCS_OUTPUT => "@vcs_output", VCS_ERROR => "@vcs_error", - ); - print CGI::header( -cookie => $cookie ); - $ui->print_screen( - TITLE=> "SandWeb : VCS $vcs_command", - MENU_TITLE => 'SandWeb', - SUBMENU_TITLE => "VCS $vcs_command", - FOOTER => '', - CONTENT => $content, - ERROR => $error, - ); + ); + print CGI::header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> "SandWeb : VCS $vcs_command", + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => "VCS $vcs_command", + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); exit 0; } @@ -890,5 +898,5 @@ my $vcs_username = $userprefs->{'repository'}->{'username'}; my $root = $userprefs->{'repository'}->{'root'}; - my $users_dir = $config->{'paths'}->{'users_dir'}; + my $users_dir = $config->{'paths'}->{'users_dir'}; my $repo_type = $userprefs->{'repository'}->{'repo_type'}; my $connection = $userprefs->{'repository'}->{'connection'}; |
From: Nick J. <nje...@us...> - 2002-01-25 07:41:59
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv13852/templates Modified Files: view_file.html Log Message: * updated view_file template * changed some vars and added content to sandweb.cgi Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.18 retrieving revision 1.19 diff -U2 -r1.18 -r1.19 --- view_file.html 2002/01/21 00:23:18 1.18 +++ view_file.html 2002/01/25 07:41:56 1.19 @@ -1,19 +1,54 @@ -<p> - 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>" method="POST"> - <input type="hidden" name="action" value="file" /> - <a href="<TMPL_VAR NAME=PROGNAME>/<TMPL_VAR NAME=FILENAME>?action=file&file_command=download&location=<TMPL_VAR NAME=LOCATION>&filename=<TMPL_VAR NAME=FILENAME>">download</a> - <input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> - <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> - <input type="submit" name="file_command" value="upload" /> - <TMPL_VAR NAME=EDIT><!-- <input type="submit" name="file_command" value="edit" /> --> -<TMPL_VAR NAME=ERROR> -<br> -<pre> -<TMPL_VAR NAME=DATA> -</pre> - </form> -</p> +<form submit="<TMPL_VAR NAME=PROGNAME>" method="POST"> +<input type="hidden" name="filename" value="<TMPL_VAR NAME=FILENAME>" /> +<input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> +<table width="100%"> + <tr> + <td width="50%"> + Current location : <a href="<TMPL_VAR NAME=PROGNAME>?action=browse_menu&path=<TMPL_VAR NAME=LOCATION>"><TMPL_VAR NAME=LOCATION></a> + <br /> + </td> + <td width="50%"> + <input type="hidden" name="action" value="file" /> + <a href="<TMPL_VAR NAME=PROGNAME>/<TMPL_VAR NAME=FILENAME>?action=file&file_command=download&location=<TMPL_VAR NAME=LOCATION>&filename=<TMPL_VAR NAME=FILENAME>">download</a> + +<!-- <input type="submit" name="file_command" value="upload" /> --> + <TMPL_VAR NAME=EDIT><!-- <input type="submit" name="file_command" value="edit" /> --> + <TMPL_VAR NAME=ERROR> + <br> + </td> + </tr> + <tr> + <td bgcolor="#AAAAAA" cellpadding="3" colspan="2"> + <table width="100%"> + </tr> + <td width="40%" bgcolor="#EEEEEE"> + Filename : <TMPL_VAR NAME=FILENAME> + </td> + <td width="15%" align="center" bgcolor="#EEEEEE"> + <TMPL_VAR NAME=FILE_TYPE> + </td> + <td width="15%" align="center" bgcolor="#EEEEEE"> + <TMPL_VAR NAME=FILE_SIZE> Bytes + </td> + <td width="30%" align="center" bgcolor="#EEEEEE"> + <TMPL_VAR NAME=FILE_AGE> + </td> + </table> + </tr> + </td> + </tr> + <tr> + <td width="100%" bgcolor="#000000" cellpadding="3" colspan="2"> + <table width="100%"> + <tr> + <td width="100%" bgcolor="#EEEEEE"> + <pre> + <TMPL_VAR NAME=FILE_CONTENT> + </pre> + </td> + </tr> + </table> + </td> + </tr> +</table> +</form> |
From: Rob H. <for...@us...> - 2002-01-23 21:04:50
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv608 Modified Files: Browse.pm Log Message: "Current location" bar now has clickable "[root]" instead of clickable "/" ( which was just impossible to hit ;) Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -U2 -r1.28 -r1.29 --- Browse.pm 2002/01/18 20:52:55 1.28 +++ Browse.pm 2002/01/23 21:04:47 1.29 @@ -75,5 +75,5 @@ unless ($count) { my %row_data; - $row_data{LOCATION_LINK} = "/"; + $row_data{LOCATION_LINK} = "[root]"; $row_data{LOCATION_FULL} = "/"; $row_data{PROGNAME} = "$progname"; |
From: Rob H. <for...@us...> - 2002-01-23 21:03:07
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Repository In directory usw-pr-cvs1:/tmp/cvs-serv32740 Modified Files: CVS.pm Log Message: oops.. typo prevented "P" from getting turned into "<font color=blue>Updated</font>" Index: CVS.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository/CVS.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -U2 -r1.24 -r1.25 --- CVS.pm 2002/01/22 18:10:12 1.24 +++ CVS.pm 2002/01/23 21:03:04 1.25 @@ -537,5 +537,5 @@ $line =~ s/^U/\<font color\=\"green\"\>Updated\<\/font\>/; } - elsif ($line =~ /^U/) { + elsif ($line =~ /^P/) { $line =~ s/^P/\<font color\=\"green\"\>Updated\<\/font\>/; } |
From: Rob H. <for...@us...> - 2002-01-22 18:10:17
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Repository In directory usw-pr-cvs1:/tmp/cvs-serv4428/lib/SandWeb/Repository Modified Files: CVS.pm Log Message: added color for "P", just made it say "Updated" Index: CVS.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository/CVS.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -U2 -r1.23 -r1.24 --- CVS.pm 2002/01/22 08:25:45 1.23 +++ CVS.pm 2002/01/22 18:10:12 1.24 @@ -537,4 +537,7 @@ $line =~ s/^U/\<font color\=\"green\"\>Updated\<\/font\>/; } + elsif ($line =~ /^U/) { + $line =~ s/^P/\<font color\=\"green\"\>Updated\<\/font\>/; + } elsif ($line =~ /^C/) { $line =~ s/^C/\<font color\=\"red\"\>Conflict\<\/font\>/; |
From: Rob H. <for...@us...> - 2002-01-22 08:29:06
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv4080 Modified Files: Diff.pm Log Message: red for removed, green for added, blue for none Index: Diff.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Diff.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- Diff.pm 2002/01/22 08:25:44 1.3 +++ Diff.pm 2002/01/22 08:29:04 1.4 @@ -31,5 +31,5 @@ $newline =~ s/^\s+//; - if ( $newline =~ '^\+' ) { + if ( $newline =~ '^\-' ) { push ( @content, "\<font color=\"red\"\>" ); push ( @content, "$line\n" ); @@ -37,5 +37,5 @@ $current_state = "added"; } - elsif ( $newline =~ '^\-' ) { + elsif ( $newline =~ '^\+' ) { push ( @content, "\<font color=\"green\"\>" ); push ( @content, "$line\n" ); |
From: Rob H. <for...@us...> - 2002-01-22 08:25:50
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv3367/lib/SandWeb Modified Files: Diff.pm Repository.pm Log Message: added colorized diff.. started from scratch, so it's pretty weak right now ;) Index: Diff.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Diff.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- Diff.pm 2002/01/21 05:56:41 1.2 +++ Diff.pm 2002/01/22 08:25:44 1.3 @@ -1,201 +1,54 @@ -#lib/SandWeb/Diff.pm -# -# the diff class. - package SandWeb::Diff; sub new { my $class = shift; - my %args = @_; + my %args = @_; - my $self = bless { - 'diff' => $args{'diff'}, - }, $class; + my $diff = $args{'diff'}; - return $self; -} + my $self = bless { + 'diff' => "$diff", + }, $class; -sub diff { - my @rightCol = (); - my @leftCol = (); - my $state; - my $j; - my $tabstop; - my $hr_breakable; - my $string; - my $pr; - my $prcgi; - my $diffcolorHeading='#99BBBB'; # color of 'Line'-heading of each diffed file - my $diffcolorEmpty='#CCCCCC'; # color of 'empty' lines - my $diffcolorAdd='#FF9999'; # Removed line(s) (left) ( - ) - my $diffcolorChange='#99FF99'; # Changed line(s) ( both ) - my $diffcolorRemove='#CCCCFF'; # Added line(s) ( - ) (right) - my $diffcolorDarkChange ='#99CC99';# lines, which are empty in change - my $difffontface="Helvetica,Arial"; - my $difffontsize="-1"; - - my($title,$file1,$file2) = @_; - - my($i,$difftxt, $where_nd, $filename, $pathname); - - ($where_nd = my $where) =~ s/.diff$//; - ($filename = $where_nd) =~ s/^.*\///; - ($pathname = $where_nd) =~ s/(Attic\/)?[^\/]*$//; - (my $scriptwhere_nd = my $scriptwhere) =~ s/.diff$//; - - print "\n\n<center><font size=+2 face=Arial>$title</font></center><p>\n"; - print "<table border=0 cellspacing=0 cellpadding=0 width=100%>\n"; - print "<tr bgcolor=#ffffff>\n"; - print "<th width=\"50%\" valign=TOP>"; - print "SAMPLE DATA"; - print "</th>\n"; - print "<th width=\"50%\" valign=TOP>"; - print "SAMPLE DATA2"; - print "</th>\n"; - - my $fs="<font face=\"$difffontface\" size=\"$difffontsize\">"; - my $fe="</font>"; - - my $leftRow = 0; - my $rightRow = 0; - - # - # Process diff text - # - foreach my $difftxt (@diff) { - - if ($difftxt =~ /^@@/) { - my($oldline,$newline,$funname) = $difftxt =~ /@@ \-([0-9]+).*\+([0-9]+).*@@(.*)/; - my $state = "dump"; - $leftRow = 0; - $rightRow = 0; - } else { - my($diffcode,$rest) = $difftxt =~ /^([-+ ])(.*)/; - $_= spacedHtmlText ($rest); - # Add fontface, size - $_ = "$fs $_$fe"; - - ######### - # little state machine to parse unified-diff output (Hen, ze...@th...) - # in order to get some nice 'ediff'-mode output - # states: - # "dump" - just dump the value - # "PreChangeRemove" - we began with '-' .. so this could be the start of a 'change' area or just remove - # "PreChange" - okey, we got several '-' lines and moved to '+' lines -> this is a change block - ########## - - if ($diffcode eq '+') { - if ($state eq "dump") { # 'change' never begins with '+': just dump out value - print "<tr><td bgcolor=\"$diffcolorEmpty\"> </td><td bgcolor=\"$diffcolorAdd\">$_</td></tr>\n"; - } else { - # we got minus before - $state = "PreChange"; - $rightCol[$rightRow++] = $_; - } - } - - elsif ($diffcode eq '-') { - $state = "PreChangeRemove"; - $leftCol[$leftRow++] = $_; - } else { - # empty diffcode - flush_diff_rows( \@leftCol, \@rightCol, $leftRow, $rightRow); - print "<tr><td>$_</td><td>$_</td></tr>\n"; - $state = "dump"; - $leftRow = 0; - $rightRow = 0; - } - } - } - - flush_diff_rows( \@leftCol, \@rightCol, $leftRow, $rightRow ); - - # state is empty if we didn't have any change - if (!$state) { - print "<tr><td colspan=2> </td></tr>"; - print "<tr bgcolor=\"$diffcolorEmpty\" >"; - print "<td colspan=2 align=center><b>- No viewable Change -</b></td></tr>"; - } - print "</table>\n\n"; - print "<br><hr noshade width=100%>\n"; + return $self; } -sub flush_diff_rows ($$$$) { - my $j; - my ($leftColRef,$rightColRef,$leftRow,$rightRow) = @_; - if ($state eq "PreChangeRemove") { # we just got remove-lines before - for ($j = 0 ; $j < $leftRow; $j++) { - print "<tr><td bgcolor=\"$diffcolorRemove\">@$leftColRef[$j]</td>"; - print "<td bgcolor=\"$diffcolorEmpty\"> </td></tr>\n"; - } - } - elsif ($state eq "PreChange") { # state eq "PreChange" - # we got removes with subsequent adds - for ($j = 0; $j < $leftRow || $j < $rightRow ; $j++) { # dump out both cols - print "<tr>"; - if ($j < $leftRow) { print "<td bgcolor=\"$diffcolorChange\">@$leftColRef[$j]</td>"; - } else { print "<td bgcolor=\"$diffcolorDarkChange\"> </td>"; -} +sub colored_diff { + my $self = shift; - if ($j < $rightRow) { print "<td bgcolor=\"$diffcolorChange\">@$rightColRef[$j]</td>"; } - else { print "<td bgcolor=\"$diffcolorDarkChange\"> </td>"; } - print "</tr>\n"; - } - } -} + my $input = $self->{'diff'}; + my @diff = split(/\n/, $input); -sub spacedHtmlText { - my($string, $pr) = @_; - - # Cut trailing spaces - s/\s+$//; - - # Expand tabs - $string =~ s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e - if (defined $tabstop); - - # replace <tab> and <space> (§ is to protect us from htmlify) - # gzip can make excellent use of this repeating pattern :-) - $string =~ s/§/§%/g; #protect our & substitute - if ($hr_breakable) { - # make every other space 'breakable' - $string =~ s/ / §nbsp; §nbsp; §nbsp; §nbsp;/g; # <tab> - $string =~ s/ / §nbsp;/g; # 2 * <space> - # leave single space as it is - } - else { - $string =~ s/ /§nbsp;§nbsp;§nbsp;§nbsp;§nbsp;§nbsp;§nbsp;§nbsp;/g; - $string =~ s/ /§nbsp;/g; - } - - $string = htmlify($string); - - # unescape - $string =~ s/§([^%])/&$1/g; - $string =~ s/§%/§/g; - - return $string; -} - -sub htmlify { - my($string, $pr) = @_; - - # Special Characters; RFC 1866 - $string =~ s/&/&/g; - $string =~ s/\"/"/g; - $string =~ s/</</g; - $string =~ s/>/>/g; - - # get URL's as link .. - $string =~ s§(http|ftp)(://[-a-zA-Z0-9%.~:/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*§<A HREF="$1$2$3">$1$2$3</A>§; - # get e-mails as link - $string =~ s§([-a-zA-Z0-9.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})§<A HREF="mailto:$1">$1</A>§; - - # get #PR as link .. - if ($pr && defined $prcgi) { - $string =~ s!\b((pr[:#]?\s*#?)|((bin|conf|docs|gnu|i386|kern|misc|ports)\/))(\d+)\b!<A HREF="$prcgi?pr=$5">$&</A>!ig; + shift @diff; + shift @diff; + shift @diff; + + my $newline; + for my $line (@diff) { + + chomp $line; + $newline = $line; + $newline =~ s/^\s+//; + + if ( $newline =~ '^\+' ) { + push ( @content, "\<font color=\"red\"\>" ); + push ( @content, "$line\n" ); + push ( @content, "\<\/font\>" ); + $current_state = "added"; + } + elsif ( $newline =~ '^\-' ) { + push ( @content, "\<font color=\"green\"\>" ); + push ( @content, "$line\n" ); + push ( @content, "\<\/font\>" ); + $current_state = "removed"; + } else { + push ( @content, "\<font color=\"blue\"\>" ); + push ( @content, "$line\n" ); + push ( @content, "\<\/font\>" ); + $current_state = "new"; + } } - return $string; + return "@content"; } Index: Repository.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -U2 -r1.17 -r1.18 --- Repository.pm 2002/01/18 19:25:08 1.17 +++ Repository.pm 2002/01/22 08:25:44 1.18 @@ -190,5 +190,6 @@ my $rev = $args{'rev'}; my $recurse = $args{'recurse'}; - my $context = "1"; + my $context = "0"; + my $unified = "1"; my $repo_type = $self->get_repo_type(); my $root = $self->get_root(); @@ -208,4 +209,5 @@ recurse => $recurse, context => $context, + unified => $unified, file => $file, ); |