Passed
Push — master ( 7cfedb...a1ca72 )
by Maja
13:25
created
docker/MSP/web/html/index.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
 error_log(serialize($_REQUEST));
8 8
 # when a request contains logid and backlog ";s:11:"DEBUG-11-52";s:7:"backlog";s:1:"7";}
9 9
 if ( isset($_REQUEST['logid']) && isset($_REQUEST['backlog']) ) {
10
-	if (substr($_REQUEST['logid'], 0, 5) == 'DEBUG') {
11
-          $logid = substr($_REQUEST['logid'], 6);
10
+    if (substr($_REQUEST['logid'], 0, 5) == 'DEBUG') {
11
+            $logid = substr($_REQUEST['logid'], 6);
12 12
         }
13
-  	$res = cat_socket(implode(':', array($logid, $_REQUEST['backlog'])));
14
-	error_log('GOT '.$res);
15
-	if (substr($res, 0, strlen(ZIPDIR)) == ZIPDIR) {
13
+        $res = cat_socket(implode(':', array($logid, $_REQUEST['backlog'])));
14
+    error_log('GOT '.$res);
15
+    if (substr($res, 0, strlen(ZIPDIR)) == ZIPDIR) {
16 16
             error_log('GOT filename '.$res);
17 17
             $za = new ZipArchive();
18 18
             $za->open($res);
19
-	    header('Content-Type: application/zip');
19
+        header('Content-Type: application/zip');
20 20
             header("Content-Disposition: attachment; filename=\"detail_".$logid.".zip\"");
21 21
             header("Content-Transfer-Encoding: binary");
22
-	    echo 'ZIPDATA:'.file_get_contents($res);
23
-	    error_log('Sent data in response');
24
-	}
22
+        echo 'ZIPDATA:'.file_get_contents($res);
23
+        error_log('Sent data in response');
24
+    }
25 25
         error_log('with '.$za->numFiles . ' files');
26
-	exit;
26
+    exit;
27 27
 }
28 28
 # MUST provide: deployment_id, inst_id
29 29
 #               and port, secret, pskkey, country or torevoke
@@ -32,33 +32,33 @@  discard block
 block discarded – undo
32 32
     isset($_REQUEST['instid']) && isset($_REQUEST['deploymentid']) &&
33 33
     (isset($_REQUEST['port']) && isset($_REQUEST['secret']) && isset($_REQUEST['pskkey']) && isset($_REQUEST['country']) ||
34 34
      isset($_REQUEST['torevoke']))) {
35
-  if (isset($_REQUEST['remove'])) {
35
+    if (isset($_REQUEST['remove'])) {
36 36
     $remove = 1;
37
-  } else {
37
+    } else {
38 38
     if (isset($_REQUEST['operatorname'])) {
39
-      $opn = trim($_REQUEST['operatorname']);
39
+        $opn = trim($_REQUEST['operatorname']);
40 40
     }
41 41
     if (isset($_REQUEST['vlan']) && isset($_REQUEST['realmforvlan']) &&
42 42
         is_array($_REQUEST['realmforvlan'])) {
43
-      $vlans = $_REQUEST['vlan'] . '#' . implode('#', $_REQUEST['realmforvlan']);
43
+        $vlans = $_REQUEST['vlan'] . '#' . implode('#', $_REQUEST['realmforvlan']);
44 44
     }
45 45
     if (isset($_REQUEST['guest_vlan'])) {
46
-      $guest_vlan = $_REQUEST['guest_vlan'];
46
+        $guest_vlan = $_REQUEST['guest_vlan'];
47
+    }
48
+    }
49
+    if (isset($_REQUEST['torevoke'])) {
50
+        $el = explode('#', $_REQUEST['torevoke']);
51
+        $res = cat_socket(implode(':', array($_REQUEST['instid'], $_REQUEST['deploymentid'], $el[0], $el[1])));
52
+    } else {
53
+        # arguments 5-7 are Base64 encoded
54
+        $res = cat_socket(implode(':', array($_REQUEST['country'],
55
+                                    $_REQUEST['instid'], $_REQUEST['deploymentid'],
56
+                                    $_REQUEST['port'],
57
+                                    base64_encode($_REQUEST['secret']),
58
+                                    base64_encode($opn), 
59
+                                    base64_encode($vlans), base64_encode($_REQUEST['pskkey']), $guest_vlan, $remove)));
47 60
     }
48
-  }
49
-  if (isset($_REQUEST['torevoke'])) {
50
-	  $el = explode('#', $_REQUEST['torevoke']);
51
-	  $res = cat_socket(implode(':', array($_REQUEST['instid'], $_REQUEST['deploymentid'], $el[0], $el[1])));
52
-  } else {
53
-  	# arguments 5-7 are Base64 encoded
54
-  	$res = cat_socket(implode(':', array($_REQUEST['country'],
55
-                                 $_REQUEST['instid'], $_REQUEST['deploymentid'],
56
-                                 $_REQUEST['port'],
57
-                                 base64_encode($_REQUEST['secret']),
58
-                                 base64_encode($opn), 
59
-                                 base64_encode($vlans), base64_encode($_REQUEST['pskkey']), $guest_vlan, $remove)));
60
-  }
61
-  echo $res;
61
+    echo $res;
62 62
 } else {
63
-  echo "FAILURE";
63
+    echo "FAILURE";
64 64
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 $guest_vlan = 0;
7 7
 error_log(serialize($_REQUEST));
8 8
 # when a request contains logid and backlog ";s:11:"DEBUG-11-52";s:7:"backlog";s:1:"7";}
9
-if ( isset($_REQUEST['logid']) && isset($_REQUEST['backlog']) ) {
9
+if (isset($_REQUEST['logid']) && isset($_REQUEST['backlog'])) {
10 10
 	if (substr($_REQUEST['logid'], 0, 5) == 'DEBUG') {
11 11
           $logid = substr($_REQUEST['logid'], 6);
12 12
         }
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	    echo 'ZIPDATA:'.file_get_contents($res);
23 23
 	    error_log('Sent data in response');
24 24
 	}
25
-        error_log('with '.$za->numFiles . ' files');
25
+        error_log('with '.$za->numFiles.' files');
26 26
 	exit;
27 27
 }
28 28
 # MUST provide: deployment_id, inst_id
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     }
41 41
     if (isset($_REQUEST['vlan']) && isset($_REQUEST['realmforvlan']) &&
42 42
         is_array($_REQUEST['realmforvlan'])) {
43
-      $vlans = $_REQUEST['vlan'] . '#' . implode('#', $_REQUEST['realmforvlan']);
43
+      $vlans = $_REQUEST['vlan'].'#'.implode('#', $_REQUEST['realmforvlan']);
44 44
     }
45 45
     if (isset($_REQUEST['guest_vlan'])) {
46 46
       $guest_vlan = $_REQUEST['guest_vlan'];
Please login to merge, or discard this patch.