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; } |