Update of /cvsroot/sandweb/sandweb/bin
In directory usw-pr-cvs1:/tmp/cvs-serv19834/bin
Modified Files:
sandweb.cgi
Log Message:
began working on preferences stuff, right now we only support one
repository, but we _fully_ support all possible repository options.
the vcs_prefs need some work, though. I'm still working on it, as
soon as it's good I'll check it in.
Index: sandweb.cgi
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v
retrieving revision 1.80
retrieving revision 1.81
diff -U2 -r1.80 -r1.81
--- sandweb.cgi 2001/11/30 20:42:04 1.80
+++ sandweb.cgi 2001/12/03 23:09:40 1.81
@@ -148,4 +148,13 @@
);
}
+ elsif ( param('action') eq 'vcs_prefs_menu' ) {
+ # called VCS preferences
+ vcs_prefs_menu(
+ cookie => $cookie,
+ filename => param('filename'),
+ command => param('command'),
+ location => param('location'),
+ );
+ }
else {
# called an invalid page
@@ -258,10 +267,18 @@
my $template_dir = $config->{'paths'}->{'template_dir'};
my $users_dir = $config->{'paths'}->{'users_dir'};
- my $repo_type = $userprefs->{'repository'}->{'VCS'};
+ my $server = $userprefs->{'repository'}->{'server'};
+ my $vcs_username = $userprefs->{'repository'}->{'username'};
+ my $repo_type = $userprefs->{'repository'}->{'repo_type'};
+ my $connection = $userprefs->{'repository'}->{'connection'};
my $root = $userprefs->{'repository'}->{'root'};
my $sandbox = $userprefs->{'paths'}->{'users_dir'};
+ my $vcsroot;
+
+ if ( $repo_type = 'CVS' ) {
+ $vcsroot = ":$connection:$vcs_username\@$server:$root";
+ }
my $repository = SandWeb::Repository->new(
- root => $root,
+ root => "$vcsroot",
repo_type => $repo_type,
sandbox => $sandbox,
@@ -320,8 +337,16 @@
my $template_dir = $config->{'paths'}->{'template_dir'};
my $users_dir = $config->{'paths'}->{'users_dir'};
- my $repo_type = $userprefs->{'repository'}->{'VCS'};
- my $root = $userprefs->{'repository'}->{'root'};
- my $sandbox = $userprefs->{'paths'}->{'users_dir'};
+ my $server = $userprefs->{'repository'}->{'server'};
+ my $vcs_username = $userprefs->{'repository'}->{'username'};
+ my $repo_type = $userprefs->{'repository'}->{'repo_type'};
+ my $connection = $userprefs->{'repository'}->{'connection'};
+ my $root = $userprefs->{'repository'}->{'root'};
+ my $sandbox = $userprefs->{'paths'}->{'users_dir'};
+ my $vcsroot;
+ if ( $repo_type = 'CVS' ) {
+ $vcsroot = ":$connection:$vcs_username\@$server:$root";
+ }
+
my $repository = SandWeb::Repository->new(
root => $root,
@@ -551,11 +576,19 @@
my $template_dir = $config->{'paths'}->{'template_dir'};
my $users_dir = $config->{'paths'}->{'users_dir'};
- my $repo_type = $userprefs->{'repository'}->{'VCS'};
- my $root = $userprefs->{'repository'}->{'root'};
my %return;
- my $sandbox = $userprefs->{'paths'}->{'users_dir'};
+ my $server = $userprefs->{'repository'}->{'server'};
+ my $vcs_username = $userprefs->{'repository'}->{'username'};
+ my $repo_type = $userprefs->{'repository'}->{'repo_type'};
+ my $connection = $userprefs->{'repository'}->{'connection'};
+ my $root = $userprefs->{'repository'}->{'root'};
+ my $sandbox = $userprefs->{'paths'}->{'users_dir'};
+ my $vcsroot;
+ if ( $repo_type = 'CVS' ) {
+ $vcsroot = ":$connection:$vcs_username\@$server:$root";
+ }
+
my $repository = SandWeb::Repository->new(
- root => $root,
+ root => $vcsroot,
repo_type => $repo_type,
sandbox => "$users_dir/$username",
@@ -648,4 +681,36 @@
FULL_NAME => $full_name,
WORK_DIR => $work_dir,
+ );
+
+ print header( -cookie => $cookie );
+ $ui->print_screen(
+ TITLE=> 'SandWeb : Preferences Menu',
+ MENU_TITLE => 'SandWeb',
+ SUBMENU_TITLE => 'preferences menu',
+ FOOTER => '',
+ CONTENT => $content,
+ ERROR => $error,
+ );
+ exit 0;
+}
+
+sub vcs_prefs_menu {
+ my %args = @_;
+ my $cookie = $args{'cookie'};
+ unless ($cookie) {
+ &login_menu();
+ exit 0;
+ }
+
+ load_prefs(1); # load prefs and do not log error msg
+ my $username = $auth->get_userinfo('username');
+ my $server = $userprefs->{'repository'}->{'server'};
+ my $root = $userprefs->{'repository'}->{'root'};
+ my $repo_type = $userprefs->{'repository'}->{'repo_type'};
+ my $connection = $userprefs->{'repository'}->{'connection'};
+ my $content = $ui->get_vcs_prefs(
+ PROGNAME => $progname,
+ SERVER => $server,
+ ROOT => $root,
);
|