Index: trunk/ippMonitor/raw/ipp.php
===================================================================
--- trunk/ippMonitor/raw/ipp.php	(revision 13692)
+++ trunk/ippMonitor/raw/ipp.php	(revision 13853)
@@ -2,4 +2,5 @@
 
 $dTABLE = 80;
+include 'site.php';
 
 function logintext () {
@@ -62,14 +63,18 @@
 function dbconnect ($database) {
 
+  require_once('DB.php');
+
+  // these are set in 'site.php'
+  global $DBHOST;
+  global $DBUSER;
+  global $DBPASS;
+
   // connect to the database
-  // these should be set on installation
-  require_once('DB.php');
-  $password = "ipp";
-  $username = "ipp";
-  $hostname = "alala";
-  $db = DB::connect("mysql://$username:$password@$hostname/$database");
+  $db = DB::connect("mysql://$DBUSER:$DBPASS@$DBHOST/$database");
   if (DB::iserror($db)) {
     echo "<b>error accessing database</b><br>\n";
-    echo "<b>tried mysql://$username:$password@$hostname/$database</b><br>\n";
+    echo "<b>tried mysql://$DBUSER:XXX@$DBHOST/$database</b><br>\n";
+    $result = $db->getMessage();
+    echo "$result<br>";
     menu_end();
   }
@@ -471,13 +476,15 @@
     $basename = str_replace ('..','',$basename);
 
-    # XXX !!!
-    $PERLLIB = "/home/kiawe/eugene/psconfig/dev.linux/lib";
-    $BINDIR = "/home/kiawe/eugene/psconfig/dev.linux/bin";
-    $SITE = "/home/kiawe/eugene/.ipprc";
+    // these are defined by site.php
+    global $PERLLIB;
+    global $BINDIR;
+    global $SITE;
+
     putenv("PERL5LIB=$PERLLIB:");
     $PATH = getenv("PATH");
     putenv("PATH=$BINDIR:$PATH");
 
-    // echo "<br><b>ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id</b><br>\n";
+    // be careful of the definition of PATH in SITE: cannot contain HOME
+    // echo "<br>ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id<br>\n";
     exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id", $output, $status);
 
