Changeset 39658
- Timestamp:
- Aug 23, 2016, 9:17:22 AM (10 years ago)
- Location:
- trunk/DataStoreServer
- Files:
-
- 4 edited
-
scripts/dsprodindex (modified) (1 diff)
-
scripts/dsrootindex (modified) (2 diffs)
-
web/cgi/dsgetindex (modified) (4 diffs)
-
web/cgi/findsmf.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/scripts/dsprodindex
r26926 r39658 75 75 # 76 76 # XXX: the spec doesn't say what should happen in this case. 77 # Here we follow the conductor implementation and return the whole list. 78 # This may not be the right thing to do. It might be better to throw an error 77 # We used to follow the conductor implementation and return the whole list. 78 # but that is definitely not the right thing to do in our context. 79 # Exit with an error 80 exit 404; 79 81 } 80 82 } -
trunk/DataStoreServer/scripts/dsrootindex
r17381 r39658 14 14 my $PS_EXIT_CONFIG_ERROR = 3; 15 15 16 # set this variable to redirect listings of the root datastore directory 17 # to the password protected php page on the postage stamp server web site. 18 # Since the data store is restricted by IP address now this is no longer necessary 19 my $redirect_root_to_pstamp = 0; 20 if ($redirect_root_to_pstamp) { 21 22 print ' 23 <html> 24 <head> 25 <meta HTTP-EQUIV="REFRESH" content="0; url=http://pstamp.ipp.ifa.hawaii.edu/dsroot.php"> 26 </head> 27 </html> 28 '; 29 30 exit 0; 31 } 32 16 33 my $dbh = getDBHandle(); 17 34 18 my $stmt = $dbh->prepare("SELECT * FROM dsProduct ");35 my $stmt = $dbh->prepare("SELECT * FROM dsProduct ORDER BY type"); 19 36 $stmt->execute(); 20 37 … … 36 53 $row->{type}, $row->{description}; 37 54 55 # XXX EAM : security by obfuscation 38 56 print $line; 39 57 } -
trunk/DataStoreServer/web/cgi/dsgetindex
r25366 r39658 20 20 my $PS_EXIT_CONFIG_ERROR = 3; 21 21 my $PS_EXIT_DATA_ERROR = 5; 22 23 my $redirect_root_to_pstamp = 0; 22 24 23 25 my $uri = shift; … … 132 134 print @$stdout_buf; 133 135 } 136 $error_code = 0 if !defined $error_code; 134 137 } else { 135 138 if (0 && $html_mode) { … … 199 202 200 203 # return link 201 print a({-href=>"./index.txt"}, "Text Version"); 204 if (!$redirect_root_to_pstamp || $program ne "dsrootindex") { 205 print a({-href=>"./index.txt"}, "Text Version"); 206 } 202 207 203 208 if ($#path >= 1) { 204 print "    \n"; 205 206 my $up = join('/', @path[0..$#path-1]); 207 print a({-href=>".."}, "Up to $up"); 208 209 # including the up links in the data store display causes 210 # wget -r to follow them up which makes a mess 211 # Turn them off if the user agent looks like wget 212 my $display_up_links = (lc($ENV{HTTP_USER_AGENT}) =~ /wget/) ? 0 : 1; 213 if ($display_up_links) { 214 print "    \n"; 215 my $up = join('/', @path[0..$#path-1]); 216 if ($redirect_root_to_pstamp and $program eq "dsprodindex") { 217 print a({-href=>"http://pstamp.ipp.ifa.hawaii.edu/dsroot.php"}, "Up to $up"); 218 } elsif ($program eq 'dsrootindex') { 219 # no up link in dsroot 220 } else { 221 print a({-href=>".."}, "Up to $up"); 222 } 223 } 209 224 } 210 225 print "</p>\n"; … … 244 259 if ($nolink) { 245 260 print $toks[0]; 246 } 247 248 else { 249 # assumes id is always first field 250 my $wpath = "./$toks[0]"; 251 252 # if this is a file request, use a download cgi 253 if ($wpath =~ /\.fits\s*$/) { 254 # This doesn't work through the proxy 255 # The /ds-cgi gets tried on alala 256 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 261 } else { 262 # First column is link to an entity down one level in data store (product, fileset, file) 263 # assumes id is always first field 264 my $wpath = "./$toks[0]"; 265 266 # if this is a file request, use a download cgi 267 my $fits = 0; 268 if ($wpath =~ /\.fits\s*$/) { 269 # This doesn't work through the proxy 270 # The /ds-cgi gets tried on alala 271 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 272 $fits = 1; 273 } 274 275 if ($fits) { 276 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]); 277 } else { 278 print a({-href=>$wpath}, $toks[0]); 279 } 280 281 if ($program eq 'dsrootindex') { 282 # for root listing make most recent fileset a link as well unless there are no filesets 283 my $fileset = $toks[1]; 284 $fileset =~ s/^\s+//; 285 $fileset =~ s/\s+$//; 286 if ($fileset ne 'none') { 287 print "</$celltag>"; 288 print "<$celltag>"; 289 # drop the product from the list of tokens 290 my $product = shift @toks; 291 # elmiminate any whitesapace 292 $product =~ s/^\s+//; 293 $product =~ s/\s+$//; 294 print a({-href=>"./$product/$fileset"}, $fileset); 257 295 } 258 259 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]);260 }296 } 297 } 298 shift @toks; 261 299 262 300 print "</$celltag>"; 263 301 264 foreach my $val (@toks[1..$#toks]) { 302 # foreach my $val (@toks[1..$#toks]) { 303 foreach my $val (@toks) { 265 304 print "<$celltag>"; 266 305 print $val; -
trunk/DataStoreServer/web/cgi/findsmf.pl
r35241 r39658 35 35 36 36 # NOTE: We do not use the ipp configuration to simplify running from a CGI script 37 my $dbname = " XXX";38 my $dbserver = " XXX";39 my $dbuser = " XXX";40 my $dbpassword = " XXX";37 my $dbname = "gpc1"; 38 my $dbserver = "scidbm"; 39 my $dbuser = "ippuser"; 40 my $dbpassword = "ippuser"; 41 41 42 42 … … 77 77 exit 2 if (!$resolved) 78 78 } 79 # HERE IS THE OUTPUT FOR A SUCCESSFUL LOOKUP 79 80 print "$filename $resolved"; 80 81 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
