IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2007, 3:57:40 PM (19 years ago)
Author:
eugene
Message:

adding output log files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/ipp.php

    r13604 r13692  
    451451// expect image supplied with key=name
    452452// this function should define matching hidden inputs in the form
     453function insert_log ($filerule) {
     454
     455  if ($_SERVER[REQUEST_METHOD] == 'GET') {
     456    $basename = $_GET['basename'];
     457    $class_id = $_GET['class'];
     458    $camera   = $_GET['camera'];
     459  } else {
     460    $basename = $_POST['basename'];
     461    $class_id = $_POST['class'];
     462    $camera   = $_POST['camera'];
     463  }
     464
     465  if (! $class_id) { $class_id = "NONE"; }
     466
     467  if ($basename && $camera && $filerule) {
     468
     469    // do I need to do this to the output result as well?
     470    $basename = escapeshellarg($basename);
     471    $basename = str_replace ('..','',$basename);
     472
     473    # XXX !!!
     474    $PERLLIB = "/home/kiawe/eugene/psconfig/dev.linux/lib";
     475    $BINDIR = "/home/kiawe/eugene/psconfig/dev.linux/bin";
     476    $SITE = "/home/kiawe/eugene/.ipprc";
     477    putenv("PERL5LIB=$PERLLIB:");
     478    $PATH = getenv("PATH");
     479    putenv("PATH=$BINDIR:$PATH");
     480
     481    // echo "<br><b>ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id</b><br>\n";
     482    exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id", $output, $status);
     483
     484    if (0) {
     485      echo "basename: $basename<br>";
     486      for ($i = 0; $i < count($output); $i++) {
     487        echo "output $i: $output[$i]<br>";
     488      }
     489      echo "output:   $output[0]<br>";
     490      echo "status:   $status<br>";
     491      echo "filename: $filename<br>";
     492      exit ();
     493    }
     494
     495    $filename = $output[0];
     496    if ($status) {
     497      echo "log file not found<br>\n";
     498      return;
     499    }
     500
     501    echo "<pre>\n";
     502    $file = fopen ($filename, "r");
     503    if ($file && !$debug) {
     504      fpassthru ($file);
     505    }
     506    echo "</pre>\n";
     507  }
     508}
     509
     510// expect image supplied with key=name
     511// this function should define matching hidden inputs in the form
    453512function insert_backref ($page, $key, $link) {
    454513
Note: See TracChangeset for help on using the changeset viewer.