Passed
Push — master ( 2c82a3...aeeda0 )
by
unknown
01:43 queued 13s
created
control.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -331,18 +331,18 @@  discard block
 block discarded – undo
331 331
   
332 332
     require_once('FileHandler.class.php');
333 333
     list ($handler, $targetFile) =
334
-      palma\FileHandler::getFileHandler($inFile);
334
+        palma\FileHandler::getFileHandler($inFile);
335 335
     trace("file is now $targetFile, its handler is $handler");
336 336
 
337 337
     $window = array(
338
-      "id" => "",
339
-      "win_id" => "",
340
-      "name" => "",
341
-      "state" => "",
342
-      "file" => $targetFile,
343
-      "handler" => $handler,
344
-      "userid" => "",
345
-      "date" => $w['date']);
338
+        "id" => "",
339
+        "win_id" => "",
340
+        "name" => "",
341
+        "state" => "",
342
+        "file" => $targetFile,
343
+        "handler" => $handler,
344
+        "userid" => "",
345
+        "date" => $w['date']);
346 346
   
347 347
     createNewWindow($db, $window);
348 348
 }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 
402 402
             // trying mousemove and click for better vnc control
403 403
             displayCommand("xdotool mousemove --window $windowhex 100 100 " .
404
-                       "key $key");
404
+                        "key $key");
405 405
         }
406 406
 
407 407
         if ($windowname && array_key_exists('keydown', $_REQUEST)) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 
417 417
             // trying mousemove and click for better vnc control
418 418
             displayCommand("xdotool mousemove --window $windowhex 100 100 " .
419
-                       "key $key");
419
+                        "key $key");
420 420
             //~ displayCommand("xdotool windowfocus $windowhex keydown $key");
421 421
         }
422 422
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                 "section" => "",
567 567
                 "state" => "",
568 568
                 "file" => $openURL,
569
-		"handler" => "palma-browser",
569
+        "handler" => "palma-browser",
570 570
                 "userid" => "",
571 571
                 "date" => $date
572 572
             );
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     monitor("control.php: displayCommand $cmd");
34 34
 
35 35
     // add directories with palma-browser to PATH
36
-    $result = shell_exec('PATH=/usr/lib/palma:./scripts:$PATH '.$cmd);
36
+    $result = shell_exec('PATH=/usr/lib/palma:./scripts:$PATH ' . $cmd);
37 37
     trace("displayCommand $cmd, result=$result");
38 38
     return $result;
39 39
 }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     }
177 177
 
178 178
     // Make sure $layout is valid
179
-    if (!array_key_exists($layout, $geom)){
179
+    if (!array_key_exists($layout, $geom)) {
180 180
         trace("layout invalid!");
181 181
     } else {
182 182
         $db->exec("UPDATE setting SET value='$layout' WHERE key='layout'");
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $section = $w['section'];
206 206
             if ($section >= 1 && $section <= $maxSection && $enabled) {
207 207
                 // Show window, set size and position.
208
-                $wi = $section - 1;
208
+                $wi = $section-1;
209 209
                 $dx = $screenWidth / $dim[$wi][2];
210 210
                 $dy = $screenHeight / $dim[$wi][3];
211 211
                 $x = $dim[$wi][0] * $dx;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     // TODO: check how to insert the userid for all content, not just vnc.
300 300
     // Perhaps better add to array in upload.php ?
301 301
     $userid = "";
302
-    $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] .'"');
302
+    $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] . '"');
303 303
     if (!empty($queryid)) {
304 304
         $userid = $queryid;
305 305
     } else {
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 {
326 326
     $inFile = $w['file'];
327 327
     if (!file_exists($inFile)) {
328
-        trace("".escapeshellarg($inFile)." is not a file, aborting display");
328
+        trace("" . escapeshellarg($inFile) . " is not a file, aborting display");
329 329
         return;
330 330
     }
331 331
   
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     // TODO: use escapeshellarg() for filename.
357 357
     $filename = $w['file'];
358 358
 
359
-    $cmd = "$handler ".escapeshellarg($filename);
359
+    $cmd = "$handler " . escapeshellarg($filename);
360 360
     displayCommand("/usr/bin/nohup $cmd >/dev/null 2>&1 &");
361 361
 
362 362
     addNewWindow($db, $w);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         if ($windownumber != 'vncwin') {
379 379
             // This is the normal case.
380 380
             // Special handling is needed when called with window=vncwin, see below.
381
-            $window = $windownumber - 1;
381
+            $window = $windownumber-1;
382 382
 
383 383
             $win_id = $db->getWindowIDBySection($windownumber);
384 384
             $windowlist = windowList();
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
             $file_in_db = $db->querySingle("SELECT id FROM window WHERE file='$delete'");
440 440
             $delete = str_replace(" ", "\ ", $delete);
441 441
             trace("file in db: $file_in_db");
442
-            if ($file_in_db){
442
+            if ($file_in_db) {
443 443
                 if (file_exists($delete)) {
444 444
                     trace("+++ DELETE FILE FROM WEBINTERFACE +++");
445 445
                     unlink($delete);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
                     trace("+++ DELETE VNC Client FROM DAEMON +++");
448 448
                     // call via daemon: ?window=vncwin&delete=VNC&vncid=123
449 449
                     trace("vnc delete in control");
450
-                    $win_id = escapeshellcmd($_REQUEST['vncid']);   // = hexWindow in database, but not on screen
450
+                    $win_id = escapeshellcmd($_REQUEST['vncid']); // = hexWindow in database, but not on screen
451 451
                     trace("VNC via Daemon ... id=$win_id");
452 452
                 } elseif (strstr($delete, "http")) {
453 453
                     trace("+++ DELETE Browserwindow +++");
@@ -540,14 +540,14 @@  discard block
 block discarded – undo
540 540
 
541 541
         // If URL leads to pdf file, download it and treat as upload
542 542
         $headers = get_headers($openURL, 1);
543
-        if ($headers["Content-Type"] == "application/pdf"){
543
+        if ($headers["Content-Type"] == "application/pdf") {
544 544
             trace("url seems to lead to a pdf file, so downloading it...");
545 545
             $temp_name = basename($openURL);
546 546
             $temp_dir = "/tmp";
547 547
             file_put_contents("$temp_dir/$temp_name", file_get_contents($openURL));
548 548
             $mimetype = mime_content_type("$temp_dir/$temp_name");
549 549
             trace("mimetype is $mimetype");
550
-            if ($mimetype == "application/pdf"){
550
+            if ($mimetype == "application/pdf") {
551 551
                 $_FILES['file']['name'] = "$temp_name";
552 552
                 $_FILES['file']['tmp_name'] = "$temp_dir/$temp_name";
553 553
                 $_FILES['file']['error'] = "downloaded_from_url";
Please login to merge, or discard this patch.
FileHandler.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     // Shortcuts for combinations of controls.
33 33
     const CURSOR = 15; // UP | DOWN | LEFT | RIGHT
34
-    const ZOOM = 48;   // ZOOMIN | ZOOMOUT
34
+    const ZOOM = 48; // ZOOMIN | ZOOMOUT
35 35
     const ALL = 2047;
36 36
 
37 37
     // up down left right zoomin zoomout home end prior next download
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
         // $params;
63 63
         // echo $ftype;
64 64
         if ($ftype === 'pdf') {
65
-            $fhandler=$pdfHandler;
65
+            $fhandler = $pdfHandler;
66 66
         } elseif ($ftype === 'gif' || $ftype === 'jpg' || $ftype === 'png') {
67
-            $fhandler=$imageHandler;
67
+            $fhandler = $imageHandler;
68 68
         } elseif ($ftype === 'html' || $ftype === 'url') {
69
-            $fhandler=$webHandler;
69
+            $fhandler = $webHandler;
70 70
         } elseif ($ftype === 'mpg' || $ftype === 'mpeg' || $ftype === 'avi' ||
71 71
                   $ftype === 'mp3' || $ftype === 'mp4' || $ftype === 'wmv') {
72
-            $fhandler=$avHandler;
72
+            $fhandler = $avHandler;
73 73
         } else {
74 74
             if ($ftype === 'doc' || $ftype === 'docx' || $ftype === 'odt' || $ftype === 'txt') {
75 75
                 $officeApp = "writer";
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 function convertOffice($inputFile, $office, $outputDir, $fileName)
106 106
 {
107 107
     shell_exec("/usr/bin/libreoffice --headless --convert-to pdf:'$office'_pdf_Export --outdir '$outputDir' '$inputFile' >/dev/null 2>&1");
108
-    $newFile=$outputDir . '/' . $fileName . '.pdf';
108
+    $newFile = $outputDir . '/' . $fileName . '.pdf';
109 109
     if (file_exists($newFile)) {
110 110
         return $newFile;
111 111
     } else {
Please login to merge, or discard this patch.