Changeset 17023 for trunk/FACT++/www/smartfact/index.php
- Timestamp:
- 08/19/13 16:32:16 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.php
r15164 r17023 169 169 // -------------------------------------------------------------------- 170 170 171 if (!isset($_GET['start']) && !isset($_GET['stop']) )171 if (!isset($_GET['start']) && !isset($_GET['stop']) && !isset($_GET['interrupt'])) 172 172 return header('HTTP/1.0 400 Command not supported'); 173 173 … … 217 217 if (isset($_GET['msg'])) 218 218 { 219 if ($_GET['msg']>=0) 220 $msg = $_GET['msg']; 219 $msg = $_GET['msg']; 221 220 unset($_GET['msg']); 222 221 } … … 271 270 } 272 271 272 if (isset($_GET['interrupt'])) 273 { 274 unset($_GET['interrupt']); 275 276 $irq = ""; 277 if (isset($_GET['interrupt'])) 278 { 279 $irq = $_GET['irq']; 280 unset($_GET['interrupt']); 281 } 282 283 $args = ""; 284 foreach ($_GET as $key => $value) 285 $args .= ' "'.$key.'"="'.$value.'"'; 286 287 $cmd = $path.'/dimctrl --user "'.$_SERVER['PHP_AUTH_USER'].'" --interrupt '.escapeshellarg($irq.$args); 288 289 // Execute 290 $str = exec($cmd, $out, $rc); 291 292 // Logging (mainly for debugging) 293 $d = date("Y/m"); 294 $path = "log/".$d; 295 if (!file_exists($path)) 296 mkdir($path, 0777, true); 297 $file = fopen($path."/exec.log", "a"); 298 fwrite($file, $cmd."\n".$str."\n\n"); 299 fclose($file); 300 } 301 273 302 if ($rc>1) 274 303 return header('HTTP/1.0 500 Execution failed [rc='.$rc."]");
Note:
See TracChangeset
for help on using the changeset viewer.