@@ -54,18 +54,18 @@ |
||
| 54 | 54 | $f = fopen($targetFile, 'w'); |
| 55 | 55 | if ($f) { |
| 56 | 56 | switch ($error) { |
| 57 | - case UPLOAD_ERR_INI_SIZE: |
|
| 58 | - $message = addslashes(__("This file is too large.")); |
|
| 59 | - break; |
|
| 60 | - case UPLOAD_ERR_FORM_SIZE: |
|
| 61 | - $message = addslashes(__("Large files are not supported.")); |
|
| 62 | - break; |
|
| 63 | - case UPLOAD_ERR_PARTIAL: |
|
| 64 | - $message = addslashes(__("File was only partially uploaded.")); |
|
| 65 | - break; |
|
| 66 | - default: |
|
| 67 | - $message = sprintf(addslashes(__("Error code %s.")), $error); |
|
| 68 | - break; |
|
| 57 | + case UPLOAD_ERR_INI_SIZE: |
|
| 58 | + $message = addslashes(__("This file is too large.")); |
|
| 59 | + break; |
|
| 60 | + case UPLOAD_ERR_FORM_SIZE: |
|
| 61 | + $message = addslashes(__("Large files are not supported.")); |
|
| 62 | + break; |
|
| 63 | + case UPLOAD_ERR_PARTIAL: |
|
| 64 | + $message = addslashes(__("File was only partially uploaded.")); |
|
| 65 | + break; |
|
| 66 | + default: |
|
| 67 | + $message = sprintf(addslashes(__("Error code %s.")), $error); |
|
| 68 | + break; |
|
| 69 | 69 | } |
| 70 | 70 | fprintf($f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""); |
| 71 | 71 | fprintf($f, "\"http://www.w3.org/TR/html4/strict.dtd\">"); |
@@ -1391,11 +1391,11 @@ |
||
| 1391 | 1391 | |
| 1392 | 1392 | <div id="footer"> |
| 1393 | 1393 | <?php |
| 1394 | - # Show authorized user name (and address) and allow logout. |
|
| 1394 | + # Show authorized user name (and address) and allow logout. |
|
| 1395 | 1395 | if ($user) { |
| 1396 | 1396 | echo("<a href=\"logout.php\" title=\"" . |
| 1397 | - addslashes(__('Disconnect the current user')) . |
|
| 1398 | - "\">" . addslashes(__('Log out')) . "<i class=\"fa fa-sign-out\"></i></a>"); |
|
| 1397 | + addslashes(__('Disconnect the current user')) . |
|
| 1398 | + "\">" . addslashes(__('Log out')) . "<i class=\"fa fa-sign-out\"></i></a>"); |
|
| 1399 | 1399 | } |
| 1400 | 1400 | ?> |
| 1401 | 1401 | </div> <!-- Footer --> |
@@ -119,7 +119,9 @@ |
||
| 119 | 119 | if (isset($hxff)) { |
| 120 | 120 | // Server is hidden behind a proxy. |
| 121 | 121 | // Proxy for loopback ip might indicate spoofing |
| 122 | - if (!in_array($hxff, array('127.0.0.1', '::1'))) $ip = $hxff; |
|
| 122 | + if (!in_array($hxff, array('127.0.0.1', '::1'))) { |
|
| 123 | + $ip = $hxff; |
|
| 124 | + } |
|
| 123 | 125 | } elseif (isset($_SERVER['REMOTE_ADDR'])) { |
| 124 | 126 | // Client has direct access to the server. |
| 125 | 127 | $ip = $_SERVER['REMOTE_ADDR']; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | // Make sure $layout is valid |
| 178 | - if (!array_key_exists($layout, $geom)){ |
|
| 178 | + if (!array_key_exists($layout, $geom)) { |
|
| 179 | 179 | trace("layout invalid!"); |
| 180 | 180 | } else { |
| 181 | 181 | $db->exec("UPDATE setting SET value='$layout' WHERE key='layout'"); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $section = $w['section']; |
| 205 | 205 | if ($section >= 1 && $section <= $maxSection && $enabled) { |
| 206 | 206 | // Show window, set size and position. |
| 207 | - $wi = $section - 1; |
|
| 207 | + $wi = $section-1; |
|
| 208 | 208 | $dx = $screenWidth / $dim[$wi][2]; |
| 209 | 209 | $dy = $screenHeight / $dim[$wi][3]; |
| 210 | 210 | $x = $dim[$wi][0] * $dx; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | // TODO: check how to insert the userid for all content, not just vnc. |
| 299 | 299 | // Perhaps better add to array in upload.php ? |
| 300 | 300 | $userid = ""; |
| 301 | - $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] .'"'); |
|
| 301 | + $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] . '"'); |
|
| 302 | 302 | if (!empty($queryid)) { |
| 303 | 303 | $userid = $queryid; |
| 304 | 304 | } else { |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | { |
| 325 | 325 | $inFile = $w['file']; |
| 326 | 326 | if (!file_exists($inFile)) { |
| 327 | - trace("".escapeshellarg($inFile)." is not a file, aborting display"); |
|
| 327 | + trace("" . escapeshellarg($inFile) . " is not a file, aborting display"); |
|
| 328 | 328 | return; |
| 329 | 329 | } |
| 330 | 330 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | // TODO: use escapeshellarg() for filename. |
| 356 | 356 | $filename = $w['file']; |
| 357 | 357 | |
| 358 | - $cmd = "$handler ".escapeshellarg($filename); |
|
| 358 | + $cmd = "$handler " . escapeshellarg($filename); |
|
| 359 | 359 | displayCommand("/usr/bin/nohup $cmd >/dev/null 2>&1 &"); |
| 360 | 360 | |
| 361 | 361 | addNewWindow($db, $w); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if ($windownumber != 'vncwin') { |
| 378 | 378 | // This is the normal case. |
| 379 | 379 | // Special handling is needed when called with window=vncwin, see below. |
| 380 | - $window = $windownumber - 1; |
|
| 380 | + $window = $windownumber-1; |
|
| 381 | 381 | |
| 382 | 382 | $win_id = $db->getWindowIDBySection($windownumber); |
| 383 | 383 | $windowlist = windowList(); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | // but currently, both those values can be ambiguos |
| 438 | 438 | $file_in_db = $db->querySingle("SELECT id FROM window WHERE file='$delete'"); |
| 439 | 439 | trace("file in db: $file_in_db"); |
| 440 | - if ($file_in_db){ |
|
| 440 | + if ($file_in_db) { |
|
| 441 | 441 | if (file_exists($delete)) { |
| 442 | 442 | trace("+++ DELETE FILE FROM WEBINTERFACE +++"); |
| 443 | 443 | unlink($delete); |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | trace("+++ DELETE VNC Client FROM DAEMON +++"); |
| 446 | 446 | // call via daemon: ?window=vncwin&delete=VNC&vncid=123 |
| 447 | 447 | trace("vnc delete in control"); |
| 448 | - $win_id = escapeshellcmd($_REQUEST['vncid']); // = hexWindow in database, but not on screen |
|
| 448 | + $win_id = escapeshellcmd($_REQUEST['vncid']); // = hexWindow in database, but not on screen |
|
| 449 | 449 | trace("VNC via Daemon ... id=$win_id"); |
| 450 | 450 | } elseif (strstr($delete, "http")) { |
| 451 | 451 | trace("+++ DELETE Browserwindow +++"); |
@@ -538,14 +538,14 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | // If URL leads to pdf file, download it and treat as upload |
| 540 | 540 | $headers = get_headers($openURL, 1); |
| 541 | - if ($headers["Content-Type"] == "application/pdf"){ |
|
| 541 | + if ($headers["Content-Type"] == "application/pdf") { |
|
| 542 | 542 | trace("url seems to lead to a pdf file, so downloading it..."); |
| 543 | 543 | $temp_name = basename($openURL); |
| 544 | 544 | $temp_dir = "/tmp"; |
| 545 | 545 | file_put_contents("$temp_dir/$temp_name", file_get_contents($openURL)); |
| 546 | 546 | $mimetype = mime_content_type("$temp_dir/$temp_name"); |
| 547 | 547 | trace("mimetype is $mimetype"); |
| 548 | - if ($mimetype == "application/pdf"){ |
|
| 548 | + if ($mimetype == "application/pdf") { |
|
| 549 | 549 | $_FILES['file']['name'] = "$temp_name"; |
| 550 | 550 | $_FILES['file']['tmp_name'] = "$temp_dir/$temp_name"; |
| 551 | 551 | $_FILES['file']['error'] = "downloaded_from_url"; |