Changeset 38160 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Apr 20, 2015, 2:39:23 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r38133 r38160 33 33 my $dest_requires_magic; 34 34 my $dump_params = 0; 35 my $new_email; 36 37 my %accessLevelCache; 35 38 36 39 # set this to true to disable update processing … … 43 46 'product=s' => \$product, 44 47 'label=s' => \$label, 48 'new_email=s' => \$new_email, 45 49 'mode=s' => \$mode, 46 50 'need_magic'=> \$dest_requires_magic, … … 142 146 print STDERR "Note that EMAIL will not be optional\n"; 143 147 148 # if need be we can hack Peter Veres' email in here if label = 'WEB.UP' and req_name like 'Peter_Veres%' 149 144 150 } elsif (!$email) { 145 151 my_die("ERROR: Required parameter EMAIL not found in request file header.\n", $PSTAMP_INVALID_REQUEST) 146 152 } 153 154 147 155 148 156 … … 158 166 my_die("email not supplied in version $extver request file $request_file_name\n", $PSTAMP_INVALID_REQUEST) 159 167 unless $email; 160 161 # XXX check for "valid" $email162 168 } else { 163 169 # for version 1 file the action is process and email is not used … … 167 173 168 174 print "Request Header Keywords EXTVER: $extver REQ_NAME: $req_name ACTION: $action EMAIL: $email\n"; 175 176 if ($new_email) { 177 # this is primarily for ease in testing 178 print "Setting email to command line provided value $new_email\n"; 179 $email = $new_email 180 } 169 181 170 182 # check for duplicate request name … … 239 251 240 252 # if the request came through the upload channel, change it to the user's specific label 241 # if any is known. 253 # if any is known. Do we want to do this for any other channels? 242 254 if ($label and $label eq 'WEB.UP') { 243 255 if ($labelForUser) { … … 749 761 750 762 if ($mjd > $mjd_max) { 751 print STDERR "User is not authorized for stamps from this exposure.\n"; 763 print "User is not authorized for stamps from this exposure exp_id $exp_id.\n"; 764 print STDERR "User is not authorized for stamps from this exposure exp_id $exp_id.\n"; 752 765 insertFakeJobForRow($row, $job_num, $PSTAMP_NOT_AUTHORIZED, $exp_id); 753 766 return 1; … … 1343 1356 my $adjusted = 0; 1344 1357 1345 my $MJD_PS1_BEGIN = 54922; # 2009-04-01 1346 my $MJD_PS1_END = 57082; # 2015-03-01 1347 1348 if ($row->{accessLevel} == 1) { 1349 # User has access to PS1 data only 1350 my $mjd_max_user = $row->{MJD_MAX}; 1351 if (!$mjd_max_user or $mjd_max_user > $MJD_PS1_END) { 1352 $$r_mjd_max = $MJD_PS1_END; 1358 my $accessLevel = $row->{accessLevel}; 1359 my $project = $row->{PROJECT}; 1360 my $mjd_max_user = $row->{MJD_MAX}; 1361 1362 my $key = "$project.$accessLevel"; 1363 1364 my $levelInfo = $accessLevelCache{$key}; 1365 1366 if (!$levelInfo) { 1367 my $cmd = "$pstamptool -listaccesslevel -accessLevel $accessLevel -project_name $project"; 1368 my $results = runToolAndParse($cmd, $verbose); 1369 if (!$results or !$results->[0]) { 1370 my_die("failed to find accessLevel info for project: $project level: $accessLevel\n", $PS_EXIT_CONFIG_ERROR); 1371 } 1372 $levelInfo = $results->[0]; 1373 $accessLevelCache{$key} = $levelInfo; 1374 } 1375 1376 my $mjd_max_thisLevel = $levelInfo->{mjd_max}; 1377 if ($mjd_max_thisLevel) { 1378 # This project has a limit for this level 1379 # adjust the user supplied limit unless it is less than the maximum 1380 1381 if (!$mjd_max_user or ($mjd_max_user > $mjd_max_thisLevel)) { 1382 $$r_mjd_max = $mjd_max_thisLevel; 1353 1383 $adjusted = 1; 1354 1384 } 1355 1385 } 1386 1356 1387 return $adjusted; 1357 1388 }
Note:
See TracChangeset
for help on using the changeset viewer.
