Update of /cvsroot/sandweb/sandweb/bin
In directory usw-pr-cvs1:/tmp/cvs-serv6742/bin
Modified Files:
sandweb.cgi
Log Message:
fixed the location bug in create_file and create_folder. They
both work as expected now; amount of code added was tiny.
They need better error checking; right now, if creation fails,
the user isn't notified ( blech ). Besides that, it's pretty
sweet. The UI is pretty simple, and it's easy to add new files
and folders and work with them.
Index: sandweb.cgi
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v
retrieving revision 1.71
retrieving revision 1.72
diff -U2 -r1.71 -r1.72
--- sandweb.cgi 2001/11/24 11:34:45 1.71
+++ sandweb.cgi 2001/11/24 11:58:00 1.72
@@ -126,5 +126,8 @@
elsif ( param('action') eq 'browse_menu' ) {
# called sandbox viewer
- browse_menu( cookie => $cookie );
+ browse_menu(
+ cookie => $cookie,
+ path => param('path'),
+ );
}
elsif ( param('action') eq 'file' ) {
@@ -134,4 +137,5 @@
filename => param('filename'),
command => param('command'),
+ location => param('location'),
);
}
@@ -275,5 +279,5 @@
my $repo_type = $repository->get_repo_type();
- my $path = url_param('path') || '';
+ my $path = $args{'path'} || '';
# use the browse object to show user's sandbox
@@ -312,4 +316,5 @@
my $command = $args{'command'};
my $filename = $args{'filename'};
+ my $location = $args{'location'};
my $username = $auth->get_userinfo('username');
my $template_dir = $config->{'paths'}->{'template_dir'};
@@ -318,10 +323,9 @@
my $root = $userprefs->{'repository'}->{'root'};
my $sandbox = $userprefs->{'paths'}->{'users_dir'};
- my $location = "$users_dir/$username";
my $repository = SandWeb::Repository->new(
root => $root,
repo_type => $repo_type,
- sandbox => $location,
+ sandbox => "$users_dir/$username",
);
@@ -333,9 +337,9 @@
my $file = SandWeb::File->new(
'filename' => $filename,
- 'location' => $location,
+ 'location' => "$users_dir/$username/$location",
);
if ( $command eq 'info' ) {
if ($filename) {
- if (! -f "$location/$filename" ) {
+ if (! -f "$users_dir/$username/$filename" ) {
set_error = "File does not exist!";
browse_menu();
@@ -351,5 +355,5 @@
elsif ( $command eq 'view' ) {
if ($filename) {
- if (! -f "$location/$filename" ) {
+ if (! -f "$users_dir/$username/$filename" ) {
set_error = "File does not exist!";
browse_menu();
@@ -360,5 +364,5 @@
}
my @tmp;
- open (FILE, "$location/$filename");
+ open (FILE, "$users_dir/$username/$filename");
foreach my $line (<FILE>) {
push @tmp, $line;
@@ -382,5 +386,5 @@
elsif ( $command eq 'edit' ) {
if ($filename) {
- if (! -f "$location/$filename" ) {
+ if (! -f "$users_dir/$username/$filename" ) {
set_error = "File does not exist!";
browse_menu();
@@ -391,5 +395,5 @@
}
my @tmp;
- open (FILE, "$location/$filename");
+ open (FILE, "$users_dir/$username/$filename");
foreach my $line (<FILE>) {
push @tmp, $line;
@@ -415,4 +419,5 @@
PROGNAME => $progname,
LOCATION => $location,
+ FULLPATH => "$users_dir/$username/$location",
);
@@ -433,4 +438,5 @@
PROGNAME => $progname,
LOCATION => $location,
+ FULLPATH => "$users_dir/$username/$location",
);
@@ -448,9 +454,15 @@
elsif ( $command eq 'created_file' ) {
$file->create_file();
- browse_menu();
+ browse_menu(
+ cookie => $cookie,
+ path => $location,
+ );
}
elsif ( $command eq 'created_folder' ) {
$file->create_folder();
- browse_menu();
+ browse_menu(
+ cookie => $cookie,
+ path => $location,
+ );
}
elsif ( $command eq 'upload' ) {
@@ -458,4 +470,5 @@
LOCATION => $location,
PROGNAME => $progname,
+ FULLPATH => "$users_dir/$username/$location",
);
print header( -cookie => $cookie );
@@ -474,4 +487,5 @@
LOCATION => $location,
PROGNAME => $progname,
+ FULLPATH => "$users_dir/$username/$location",
);
print header( -cookie => $cookie );
|