Update of /cvsroot/sandweb/sandweb/bin
In directory usw-pr-cvs1:/tmp/cvs-serv6646a/bin
Modified Files:
sandweb.cgi
Log Message:
ok, now the sandbox_commit can handle vcs passwords, I made it go through
the vcs_menu subroutine instead of calling Repository itself ( because then
I'd have to copy&paste the whole password checking thing, which is not
very re-useful.
Index: sandweb.cgi
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v
retrieving revision 1.330
retrieving revision 1.331
diff -U2 -r1.330 -r1.331
--- sandweb.cgi 6 Nov 2002 05:34:42 -0000 1.330
+++ sandweb.cgi 6 Nov 2002 22:44:06 -0000 1.331
@@ -1767,4 +1767,5 @@
}
+
if ($remember_repo_password) {
@@ -1775,5 +1776,5 @@
repo_name => $repo_name,
repo_password => $repo_password,
- filename => \@filename,
+ #filename => \@filename,
location => $location,
);
@@ -2580,5 +2581,4 @@
my $repo_username = $user->get_repo_username(repo => $repo_name);
my $repo_password = $user->get_repo_password(repo => $repo_name);
- my $remember_repo_password = $user->get_remember_repo_password(repo => $repo_name);
my $repo_type = $user->get_repo_type(repo => $repo_name);
my $repo_connection = $user->get_repo_connection(repo => $repo_name);
@@ -2599,7 +2599,7 @@
if ($user->module_exists(repo => $repo_name, module => $module_name)) {
$user->update_module(
- repo => $repo_name,
- module => $module_name,
- module_description => $module_description,
+ repo => $repo_name,
+ module => $module_name,
+ module_description => $module_description,
);
} else {
@@ -2610,7 +2610,7 @@
$do_vcs_action = 1;
$user->add_module(
- repo => $repo_name,
- module => $module_name,
- module_description => $module_description,
+ repo => $repo_name,
+ module => $module_name,
+ module_description => $module_description,
);
}
@@ -2627,70 +2627,33 @@
my @vcs_error = ();
- my $repository = SandWeb::Repository->new(
- root => $repo_root,
- connection => $repo_connection,
- 'vcs_username' => $repo_username,
- 'vcs_password' => $repo_password,
- 'unix_auth' => $unix_auth,
- 'system_username' => $system_username,
- 'system_password' => $system_password,
- server => $repo_server,
- repo_type => $repo_type,
- sandbox => "$users_dir/$username/$repo_name",
- 'ssh_bin' => $ssh_bin,
- 'cvs_bin' => $cvs_bin,
- 'bindir' => $bindir,
- 'log_obj' => $log,
- );
+ my $vcs_command;
- my %return;
if ($submit eq 'Checkout') {
- %return = $repository->checkout(
- file => "$module_name",
- );
+ $vcs_command = "checkout";
} elsif ($submit eq 'Update') {
- %return = $repository->update(
- file => "$module_name",
- );
+ $vcs_command = "update";
}
- push (@vcs_output, "$return{'output'}\n");
- push (@vcs_error, "$return{'error'}\n");
- $log->debug('dump', \%return);
-
- if ($return{'errorlevel'}) {
- # vcs action failed
- $log->debug("failed checkout/update of module '$module_name'\n");
- set_message("failed checkout/update of module '$module_name'\n");
- } else {
- my $return = write_config();
- if (! $return) {
- # uh oh, problem occured
- sandbox( ck_auth => $ck_auth );
- }
+ my @filename = $module_name;
+
+ my $return = write_config();
+
+ if (! $return) {
+ # uh oh, problem occured
+ sandbox( ck_auth => $ck_auth );
}
- my $content = $ui->get_menu(
- MENU => 'vcs_output',
- LOCATION => $module_name, #$location,
- #FILENAME => "@filename",
- PROGNAME => $progname,
- VCS_OUTPUT => join('', @vcs_output),
- VCS_ERROR => join('', @vcs_error),
- );
-
- $log->debug("HTTP_REFERER: $ENV{'HTTP_REFERER'}");
- my $prev_url = "$ENV{'HTTP_REFERER'}";
- $log->debug("prev_url $prev_url");
- print $cgi->header( -cookie => $ck_auth );
- $ui->print_popup(
- TITLE=> "SandWeb : vcs output",
- MENU_TITLE => 'SandWeb',
- SUBMENU_TITLE => "vcs output",
- PREVIOUS_URL => "$progname?action=sandbox",
- FOOTER => '',
- CONTENT => $content,
- MESSAGE => $message,
+
+ vcs_menu(
+ ck_auth => $ck_auth,
+ vcs_command => $vcs_command,
+ module_name => '',
+ repo_name => $repo_name,
+ repo_password => $repo_password,
+ filename => \@filename,
+ location => '',
);
+
exit 0;
+
} elsif ($submit eq 'Delete') {
#
|