Changeset 42202 for branches/eam_branches/ipp-20220316
- Timestamp:
- May 17, 2022, 3:21:12 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20220316/ippMonitor/raw
- Files:
-
- 12 edited
-
Login.php (modified) (4 diffs)
-
SelectProject.php (modified) (2 diffs)
-
czartool_getplot.php (modified) (1 diff)
-
getlog.php (modified) (2 diffs)
-
ipp.php (modified) (6 diffs)
-
plotHistogram.php (modified) (2 diffs)
-
scatterPlot.php (modified) (2 diffs)
-
show_and_delete_image.php (modified) (1 diff)
-
show_log.php (modified) (2 diffs)
-
showimage.php (modified) (2 diffs)
-
skycellplot.php (modified) (2 diffs)
-
skyplot.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/ippMonitor/raw/Login.php
r25308 r42202 3 3 include 'ipp.php'; 4 4 5 if (($_SERVER[ REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {5 if (($_SERVER['REQUEST_METHOD'] != 'POST') && ($_SERVER['REQUEST_METHOD'] != 'GET')) { 6 6 menu ('ipp.menu.dat', 'Login', 'ipp.css', '', ''); 7 7 echo "Invalid Client Request<br>\n"; … … 10 10 } 11 11 12 if ($_SERVER[ REQUEST_METHOD] == 'GET') {12 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 13 13 14 14 $ID = checkID (); … … 29 29 } 30 30 31 if ($_SERVER[ REQUEST_METHOD] == 'POST') {32 if (key_exists ( login, $_POST)) {31 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 32 if (key_exists ('login', $_POST)) { 33 33 34 34 $ID = checkLogin (); … … 40 40 } 41 41 42 if (key_exists ( logout, $_POST)) {42 if (key_exists ('logout', $_POST)) { 43 43 menu ('ipp.menu.dat', 'Login', 'ipp.css', '', ''); 44 44 echo "You are now logged out<br>\n"; -
branches/eam_branches/ipp-20220316/ippMonitor/raw/SelectProject.php
r9439 r42202 3 3 include 'ipp.php'; 4 4 5 if (($_SERVER[ REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {5 if (($_SERVER['REQUEST_METHOD'] != 'POST') && ($_SERVER['REQUEST_METHOD'] != 'GET')) { 6 6 menu ('ipp.menu.dat', 'Select Project', 'ipp.css', '', ''); 7 7 echo "Invalid Client Request<br>\n"; … … 12 12 $ID = checkID (); 13 13 14 if ($_SERVER[ REQUEST_METHOD] == 'GET') {14 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 15 15 projectform ($ID); 16 16 } 17 17 18 if ($_SERVER[ REQUEST_METHOD] == 'POST') {18 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 19 19 20 20 if (key_exists (project, $_POST)) { 21 $myProj = $_POST[ proj];21 $myProj = $_POST['proj']; 22 22 $ID['proj'] = $myProj; 23 23 // validate the existence of the project -
branches/eam_branches/ipp-20220316/ippMonitor/raw/czartool_getplot.php
r40840 r42202 8 8 9 9 ### we must have been past arguments with GET: 10 if ($_SERVER[ REQUEST_METHOD] != 'GET') {10 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 11 11 exit (); 12 12 } 13 13 14 $mode = $_GET[ mode];15 $type = $_GET[ type];16 $label = $_GET[ label];17 $stage = $_GET[ stage];18 $plottype = $_GET[ plottype];14 $mode = $_GET['mode']; 15 $type = $_GET['type']; 16 $label = $_GET['label']; 17 $stage = $_GET['stage']; 18 $plottype = $_GET['plottype']; 19 19 20 $proj = $_GET[ proj];20 $proj = $_GET['proj']; 21 21 22 22 $path = $CZARPLOTDIR; -
branches/eam_branches/ipp-20220316/ippMonitor/raw/getlog.php
r41730 r42202 9 9 // load an image file from the image directory 10 10 // validate request 11 if ($_SERVER[ REQUEST_METHOD] != 'GET') {11 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 12 12 exit (); 13 13 } … … 20 20 21 21 # $basename may contain filename@filerule 22 $basename = strtok($_GET[ name],"@");22 $basename = strtok($_GET['name'],"@"); 23 23 $filerule = strtok("@"); 24 24 -
branches/eam_branches/ipp-20220316/ippMonitor/raw/ipp.php
r41730 r42202 26 26 27 27 menu ('ipp.menu.dat', 'Select Project', 'ipp.css', $ID['link'], $ID['proj']); 28 if ( $_GET['new'] && $_GET['proj']) {28 if (isset($_GET['new']) && isset($_GET['proj'])) { 29 29 echo "<p> Project is now <b>" . $_GET['proj'] . "</b></p>\n"; 30 30 } … … 66 66 global $DBI; 67 67 68 if ($DBI == "PDO") { 69 $result = $qry->fetch(); 70 if ($result == NULL) { 71 $success = 0; 72 } else { 73 $success = 1; 74 } 75 } 68 76 if ($DBI == "MDB2") { 69 77 $result = $qry->fetchRow(); … … 90 98 global $CZARDBHOST; 91 99 100 // define the DSN strings. NOTE: PDO uses a different format from DB or MDB2 101 if ($database == $CZARDBNAME) { 102 $dsn_pdo = "mysql:host=$DBHOST;dbname=$database"; 103 $dsn = "mysql://$DBUSER:$DBPASS@$CZARDBHOST/$database"; 104 $dsnerr = "mysql://$DBUSER:XXX@$CZARDBHOST/$database"; // only used to report the error 105 } else { 106 $dsn_pdo = "mysql:host=$CZARDBHOST;dbname=$database"; // note this is case sensitive 107 $dsn = "mysql://$DBUSER:$DBPASS@$DBHOST/$database"; 108 $dsnerr = "mysql://$DBUSER:XXX@$DBHOST/$database"; // only used to report the error 109 } 110 111 // PDO has a different error handling method initially (throw exception) 112 // but after construction can be set to match DB & MDB2 113 if ($DBI == "PDO") { 114 try { 115 $db = new PDO($dsn_pdo, $DBUSER, $DBPASS); 116 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 117 } catch (PDOException $dberr) { 118 dbconnectFailure($dberr, $dsnerr); 119 } 120 return $db; 121 } 122 92 123 $success = 0; 93 124 if ($DBI == "MDB2") { … … 104 135 } 105 136 106 // connect to the database107 if ($database == $CZARDBNAME) {108 $dsn = "mysql://$DBUSER:$DBPASS@$CZARDBHOST/$database";109 $dsnerr = "mysql://$DBUSER:XXX@$CZARDBHOST/$database"; // only used to report the error110 } else {111 $dsn = "mysql://$DBUSER:$DBPASS@$DBHOST/$database";112 $dsnerr = "mysql://$DBUSER:XXX@$DBHOST/$database"; // only used to report the error113 }114 137 if ($DBI == "DB") { 115 138 $db = DB::connect($dsn); … … 118 141 $db = MDB2::connect($dsn); 119 142 } 120 121 143 if (dberror($db)) { 122 echo "<b>error accessing database</b><br>\n"; 123 echo "<b>tried $dsnerr</b><br>\n"; 124 $result = $db->getMessage(); 125 echo "$result<br>"; 126 menu_end(); 144 dbconnectFailure($db, $dsnerr); 127 145 } 128 146 return $db; 129 147 } 130 148 149 function dbconnectFailure($db, $dsnerr) { 150 echo "<b>error accessing database</b><br>\n"; 151 echo "<b>tried $dsnerr</b><br>\n"; 152 $result = $db->getMessage(); 153 echo "$result<br>"; 154 menu_end(); 155 } 156 157 # return true/false for an error 131 158 function dberror ($db) { 132 159 global $DBI; … … 137 164 if ($DBI == "DB") { 138 165 $dberr = DB::isError($db); 166 } 167 if ($DBI == "PDO") { 168 if ($db == null) { 169 $dberr = 1; 170 } else { 171 $dberr = 0; 172 } 139 173 } 140 174 -
branches/eam_branches/ipp-20220316/ippMonitor/raw/plotHistogram.php
r41730 r42202 12 12 13 13 ### we must have been past arguments with GET: 14 if ($_SERVER[ REQUEST_METHOD] != 'GET') {14 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 15 15 exit (); 16 16 } … … 43 43 } 44 44 45 $infile = $_GET[ input];46 $outfile = $_GET[ output];47 $title = $_GET[ title];45 $infile = $_GET['input']; 46 $outfile = $_GET['output']; 47 $title = $_GET['title']; 48 48 49 49 if ($debug) { -
branches/eam_branches/ipp-20220316/ippMonitor/raw/scatterPlot.php
r41730 r42202 12 12 13 13 ### we must have been past arguments with GET: 14 if ($_SERVER[ REQUEST_METHOD] != 'GET') {14 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 15 15 exit (); 16 16 } … … 43 43 } 44 44 45 $infile = $_GET[ input];46 $outfile = $_GET[ output];47 $title = $_GET[ title];45 $infile = $_GET['input']; 46 $outfile = $_GET['output']; 47 $title = $_GET['title']; 48 48 49 49 $title = preg_replace("/'/", "", $title); -
branches/eam_branches/ipp-20220316/ippMonitor/raw/show_and_delete_image.php
r28433 r42202 2 2 3 3 ### we must have been past arguments with GET: 4 if ($_SERVER[ REQUEST_METHOD] != 'GET') {4 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 5 5 exit (); 6 6 } 7 7 8 $filename = $_GET[ file];8 $filename = $_GET['file']; 9 9 10 10 $file = fopen ($filename, "r"); -
branches/eam_branches/ipp-20220316/ippMonitor/raw/show_log.php
r41730 r42202 5 5 include 'site.php'; 6 6 7 if ($_SERVER[ REQUEST_METHOD] != 'GET') {7 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 8 8 exit (); 9 9 } … … 13 13 putenv("PATH=$WWWBIN:$BINDIR:$PATH"); 14 14 15 $basename = $_GET[ basename];15 $basename = $_GET['basename']; 16 16 $basename = escapeshellarg($basename); 17 17 18 $state = $_GET[ state];18 $state = $_GET['state']; 19 19 $state = escapeshellarg($state); 20 20 if (!$state) $state = 'new'; -
branches/eam_branches/ipp-20220316/ippMonitor/raw/showimage.php
r27054 r42202 11 11 // load an image file from the image directory 12 12 // validate request 13 if ($_SERVER[ REQUEST_METHOD] != 'GET') {13 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 14 14 exit (); 15 15 } … … 20 20 21 21 # $basename may contain filename@filerule 22 $basename = $_GET[ name];23 $filerule = $_GET[ rule];24 $camera = $_GET[ camera];25 $class_id = $_GET[ class_id];22 $basename = $_GET['name']; 23 $filerule = $_GET['rule']; 24 $camera = $_GET['camera']; 25 $class_id = $_GET['class_id']; 26 26 27 27 $title = $basename; -
branches/eam_branches/ipp-20220316/ippMonitor/raw/skycellplot.php
r41730 r42202 13 13 14 14 ### we must have been past arguments with GET: 15 if ($_SERVER[ REQUEST_METHOD] != 'GET') {15 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 16 16 exit (); 17 17 } … … 44 44 } 45 45 46 $infile = $_GET[ input];47 $outfile = $_GET[ output];46 $infile = $_GET['input']; 47 $outfile = $_GET['output']; 48 48 49 49 $output = shell_exec("skycellplot.dvo $infile $outfile");//, $output, $status); -
branches/eam_branches/ipp-20220316/ippMonitor/raw/skyplot.php
r41730 r42202 23 23 24 24 ### we must have been passed arguments with GET: 25 if ($_SERVER[ REQUEST_METHOD] != 'GET') {25 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 26 26 exit (); 27 27 } … … 54 54 } 55 55 56 $infile = $_GET[ input];57 $outfile = $_GET[ output];56 $infile = $_GET['input']; 57 $outfile = $_GET['output']; 58 58 59 59 // $output = shell_exec("skyplot.dvo $infile $outfile");//, $output, $status);
Note:
See TracChangeset
for help on using the changeset viewer.
