Passed
Push — master ( b77f8a...daf8f1 )
by Tomasz
12:16
created
web/admin/edit_hotspot.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                 $deployment->deactivate();
110 110
             }
111 111
             header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
112
-                   $deployment->identifier);
112
+                    $deployment->identifier);
113 113
             exit(0);
114 114
         case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
             $deployment->remove();
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
                     // valid signature
141 141
                     $data = openssl_x509_parse($deployment->radsec_cert);
142 142
                     $certdata = array(
143
-                              $data['serialNumberHex'],
144
-                              date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis')
145
-                             );
143
+                                $data['serialNumberHex'],
144
+                                date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis')
145
+                                );
146 146
                     $torevoke = implode('#', $certdata);
147 147
                     $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
148 148
                     $deployment->tlsfromcsr($csr);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             }
195 195
             header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
196 196
             exit(0);
197
-          default:
197
+            default:
198 198
                 throw new Exception("Unknown button action requested!");
199 199
     }
200 200
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 
33 33
 $deco = new \web\lib\admin\PageDecoration();
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
             ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 )
42 42
             )
43 43
     ) {*/
44
-    if (isset($_POST['consortium']) &&  $_POST['consortium'] == "eduroam")
44
+    if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam")
45 45
     {
46 46
         $deployment = $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']);
47
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
47
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
48 48
         exit(0);
49 49
     } else {
50 50
         throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!");
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
             if (isset($_POST['agreement']) && $_POST['agreement'] == "true") {
102 102
                 $deployment->addAttribute("hiddenmanagedsp:tou_accepted", NULL, 1);
103 103
             }
104
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
104
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
105 105
             exit(0);
106 106
         case web\lib\common\FormElements::BUTTON_DELETE:
107 107
             $response = $deployment->setRADIUSconfig();
108 108
             if (in_array('OK', $response)) {
109 109
                 $deployment->deactivate();
110 110
             }
111
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
111
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'. 
112 112
                    $deployment->identifier);
113 113
             exit(0);
114 114
         case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
             $deployment->remove();
116
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier);
116
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier);
117 117
             exit(0);
118 118
         case web\lib\common\FormElements::BUTTON_RENEWTLS:
119 119
             $data = openssl_x509_parse($deployment->radsec_cert);
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
             $torevoke = implode('#', $certdata);
125 125
             $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
126 126
             $deployment->renewtls();
127
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
127
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
128 128
             exit(0);
129 129
         case web\lib\common\FormElements::BUTTON_USECSR:
130 130
             if (isset($_FILES['upload']) && $_FILES['upload']['size'] > 0) {
131 131
                 $csrpem = file_get_contents($_FILES['upload']['tmp_name']);
132 132
                 if ($csrpem === FALSE) {
133 133
                     // seems we can't work with this file for some reason. Ignore.
134
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&errormsg=NOCSR_' . $deployment->identifier . '#profilebox_' . $deployment->identifier);
134
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&errormsg=NOCSR_'.$deployment->identifier.'#profilebox_'.$deployment->identifier);
135 135
                     exit(0);
136 136
                 }
137 137
                 $csr = new \phpseclib3\File\X509();
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
                     $torevoke = implode('#', $certdata);
147 147
                     $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
148 148
                     $deployment->tlsfromcsr($csr);
149
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
149
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
150 150
                     exit(0);
151 151
                 } else {
152
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&errormsg=WRONGCSR_' . $deployment->identifier . '#profilebox_' . $deployment->identifier);
152
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&errormsg=WRONGCSR_'.$deployment->identifier.'#profilebox_'.$deployment->identifier);
153 153
                     exit(0);
154 154
                 }
155 155
             }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 if (in_array('OK', $response)) {
160 160
                     $deployment->activate();
161 161
                 }
162
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
162
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
163 163
                 exit(0);
164 164
             } else {
165 165
                 throw new Exception("Activate button pushed without acknowledged ToUs!");
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             } else {
193 193
                 $response = ['NOOP', 'NOOP'];
194 194
             }
195
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
195
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
196 196
             exit(0);
197 197
           default:
198 198
                 throw new Exception("Unknown button action requested!");
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 if (isset($_POST['command'])) {
202 202
     switch ($_POST['command']) {
203 203
         case web\lib\common\FormElements::BUTTON_CLOSE:
204
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier;
204
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier).'#profilebox_'.$deployment->identifier;
205 205
             exit(0);
206 206
         default:
207
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
207
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
208 208
             exit(0);
209 209
         }
210 210
 }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     echo $uiElements->instLevelInfoBoxes($my_inst);
231 231
     $deploymentOptions = $deployment->getAttributes();
232 232
     echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&amp;deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'>
233
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
233
+                <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>";
234 234
     $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE);
235 235
     ?>
236 236
     <fieldset class='option_container' id='managedsp_override'>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 <!-- input for VLAN identifier for guests-->
265 265
                 <td>
266 266
                     <span id='guest_vlan_label'>
267
-                        <?php echo sprintf(_("VLAN tag for guests:"), ($guest_vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
267
+                        <?php echo sprintf(_("VLAN tag for guests:"), ($guest_vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
268 268
                     </span>
269 269
                 </td>
270 270
                 <td>
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                 <!-- input for VLAN identifier for home users-->
281 281
                 <td>
282 282
                     <span id='vlan_label'>
283
-                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
283
+                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
284 284
                     </span>
285 285
                 </td>
286 286
                 <td>
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     </fieldset>
301 301
 
302 302
     <?php
303
-    echo "<p><button type='submit' name='submitbutton' class='deploymentopts' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
303
+    echo "<p><button type='submit' name='submitbutton' class='deploymentopts' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
304 304
     echo $deco->footer();
305 305
     ?>
306 306
     <script>
Please login to merge, or discard this patch.
utils/test_openroaming.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * License: see the web/copyright.php file in the file structure
9 9
  * ******************************************************************************
10 10
  */
11
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
11
+require_once dirname(dirname(__FILE__))."/config/_config.php";
12 12
 
13 13
 /**
14 14
  * The sctipt will be called from crontab
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 
31
-while ( $row = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allOpenRoamingProfiles)) {
31
+while ($row = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allOpenRoamingProfiles)) {
32 32
     $profileId = $row->profile_id;
33 33
     $profile = \core\ProfileFactory::instantiate($profileId);
34 34
     $res = $profile->openroamingReadinessTest();
Please login to merge, or discard this patch.
web/lib/admin/MapGoogle.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function htmlHeadCode() {
48 48
         $cat = new \core\CAT();
49 49
         \core\common\Entity::intoThePotatoes();
50
-        $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=" . \config\Master::APPEARANCE['google_maps_api_key'] . "'></script>
50
+        $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=".\config\Master::APPEARANCE['google_maps_api_key']."'></script>
51 51
     <script type='text/javascript'>
52 52
         // some global variables;
53 53
         var center_lat=49.6114885608729;
@@ -103,19 +103,19 @@  discard block
 block discarded – undo
103 103
          *
104 104
          */
105 105
         function locator_magic() {
106
-            geocoder.geocode({'address':\"" . preg_replace("/\"/", "&quot;", $this->instName) . "\", 'region':\"" . strtolower($this->fedName) . "\"},
106
+            geocoder.geocode({'address':\"" . preg_replace("/\"/", "&quot;", $this->instName)."\", 'region':\"".strtolower($this->fedName)."\"},
107 107
             function(r,status) {
108 108
                 if(status != google.maps.GeocoderStatus.OK) {
109
-                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\");
109
+                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\");
110 110
                 } else {
111 111
                     var i;
112 112
                     for(i = 0; i < r.length; i++) {
113 113
                         Addr = getAddressElements(r[i].address_components);
114
-                        if(Addr.country == \"" . strtoupper($this->fedName) . "\")
114
+                        if(Addr.country == \"" . strtoupper($this->fedName)."\")
115 115
                         break;
116 116
                     }
117
-                    if(Addr.country != \"" . strtoupper($this->fedName) . "\")
118
-                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\");
117
+                    if(Addr.country != \"" . strtoupper($this->fedName)."\")
118
+                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\");
119 119
                     else {
120 120
                         addMarker(r[i].geometry.location,15,null);
121 121
                     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
          */
129 129
         function markerClicked(m) {
130 130
             info_window.close();
131
-            var t = \"" . _("This is location ") . "\"+m.info;
131
+            var t = \"" . _("This is location ")."\"+m.info;
132 132
             info_window.setContent(t);
133 133
             info_window.setPosition(m.getPosition());
134 134
             info_window.open(map,m);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         function getAddressLocation() {
208 208
             var city = $('#address').val();
209 209
             if(city == '') {
210
-                alert(\"" . _("nothing entered in the address field") . "\");
210
+                alert(\"" . _("nothing entered in the address field")."\");
211 211
                 return false;
212 212
             }
213 213
             geocoder.geocode( { 'address': city}, function(results, status) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
          * trigger geolocation
228 228
          */
229 229
         function locateMe() {
230
-            $('#address').val(\"" . _("locating") . "\");
230
+            $('#address').val(\"" . _("locating")."\");
231 231
             navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000});
232 232
         }
233 233
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         if ($this->readOnly) {
346 346
             return "<div id='map' class='googlemap'></div>";
347 347
         } else {
348
-            return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<div id='map' class='googlemap'></div>" . $this->htmlPostEdit(FALSE);
348
+            return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<div id='map' class='googlemap'></div>".$this->htmlPostEdit(FALSE);
349 349
         }
350 350
     }
351 351
 
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public static function optionListDisplayCode($coords, $number) {
360 360
         // quiesce warnings about unused variable
361
-        if (strlen(sprintf("%s", $coords)) <0) {
361
+        if (strlen(sprintf("%s", $coords)) < 0) {
362 362
             throw new \Exception("A miracle! A string with negative length!");
363 363
         };
364 364
         \core\common\Entity::intoThePotatoes();
365
-        $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>";
365
+        $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>";
366 366
         \core\common\Entity::outOfThePotatoes();
367 367
         return $retval;
368 368
     }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      * @return string
374 374
      */
375 375
     public function bodyTagCode() {
376
-        return "onload='load(" . ($this->readOnly ? "0" : "1") . ")'";
376
+        return "onload='load(".($this->readOnly ? "0" : "1").")'";
377 377
     }
378 378
 
379 379
     /**
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     private function findLocationHtml() {
385 385
         \core\common\Entity::intoThePotatoes();
386
-        $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>";
386
+        $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>";
387 387
         \core\common\Entity::outOfThePotatoes();
388 388
         return $retval;
389 389
     }
Please login to merge, or discard this patch.
web/lib/admin/MapOpenLayers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         
84 84
 // use HTML5 geolocation
85 85
         function locateMe() {
86
-            $('#address').val(\"" . _("locating") . "\");
86
+            $('#address').val(\"" . _("locating")."\");
87 87
             navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000});
88 88
         }
89 89
         
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                 view.fit(extent, {padding: [10, 0, 10, 0]});
206 206
             } else {
207 207
                 view.setCenter([0,0]);
208
-                locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "'); // use the federation code to locate the country
208
+                locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name']."'); // use the federation code to locate the country
209 209
                 map.setView(view);
210 210
             }
211 211
             view.setMaxZoom(20);
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
         function getAddressLocation() {
228 228
             var city = $('#address').val();
229 229
             if(city == '') {
230
-                alert(\"" . _("nothing entered in the address field") . "\");
230
+                alert(\"" . _("nothing entered in the address field")."\");
231 231
                 return false;
232 232
             }
233 233
             city = city.replace(/\s*,\s*/g,',+');
234 234
             city = city.replace(/ +/,'+');
235 235
             $.get(addressService+'?format=json&addressdetails=0&q='+city, '',  function(data) {
236 236
                 if (data[0] === undefined) {
237
-                    alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.") . "');
237
+                    alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.")."');
238 238
                     return;
239 239
                 }
240 240
                 showTmpPointer(data[0].lon, data[0].lat);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         if ($this->readOnly) {
286 286
             return "<div id='map' class='locationmap'></div><script>generateMap('map')</script>";
287 287
         } else {
288
-            return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>" . $this->htmlPostEdit(FALSE);
288
+            return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>".$this->htmlPostEdit(FALSE);
289 289
         }
290 290
     }
291 291
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         // we don't need this parameter in this subclass
311 311
         unset($coords);
312 312
         \core\common\Entity::intoThePotatoes();
313
-        $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>";
313
+        $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>";
314 314
         \core\common\Entity::outOfThePotatoes();
315 315
         return $retval;
316 316
     }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     private function findLocationHtml() {
324 324
         \core\common\Entity::intoThePotatoes();
325
-        $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>";
325
+        $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>";
326 326
         \core\common\Entity::outOfThePotatoes();
327 327
         return $retval;
328 328
     }
Please login to merge, or discard this patch.
web/skins/modern/accountstatus/accountstatus.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 $Gui->loggerInstance->debug(4, $operatingSystem);
48 48
 $uiElements = new web\lib\admin\UIElements();
49 49
 if ($operatingSystem) {
50
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
50
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
51 51
 }
52
-require dirname(__DIR__) . '/user/js/cat_js.php';
52
+require dirname(__DIR__).'/user/js/cat_js.php';
53 53
 ?>
54 54
     var lang = "<?php echo($Gui->languageInstance->getLang()) ?>";
55 55
 </script>
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                         <?php
80 80
                         switch ($statusInfo['errorcode']) {
81 81
                             case "GENERATOR_CONSUMED":
82
-                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE) . "<p>";
82
+                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE)."<p>";
83 83
                                 break;
84 84
                             case NULL:
85 85
                             default:
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                                     echo " ";
103 103
                                     echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts);
104 104
                                 }
105
-                                echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>";
105
+                                echo " <span id='detailtext'>"._("I want to see the details.")."</span>";
106 106
                                 echo "<table id='cert_details'></table>";
107 107
                             }
108 108
                         }
@@ -111,60 +111,60 @@  discard block
 block discarded – undo
111 111
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal
112 112
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED:
113 113
                                 if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case.
114
-                                    echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>";
114
+                                    echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>";
115 115
                                 }
116 116
                                 if (!$statusInfo["OS"]) {
117
-                                    echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>";
117
+                                    echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>";
118 118
                                     break;
119 119
                                 }
120 120
 
121 121
                                 $dev = new \core\DeviceFactory($statusInfo['OS']['device']);
122 122
                                 $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]);
123 123
                                 if ($dev->device->selectedEap == []) {
124
-                                    echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>";
124
+                                    echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>";
125 125
                                     break;
126 126
                                 }
127
-                                $message = $dev->device->options['message'] ?? '' ;
127
+                                $message = $dev->device->options['message'] ?? '';
128 128
 
129 129
                                 $sbMessage = $dev->device->options['sb_message'] ?? '';
130 130
                                 if ($message != '' && $sbMessage != '') {
131
-                                    $message = $message . "<p>" . $sbMessage;
131
+                                    $message = $message."<p>".$sbMessage;
132 132
                                 } else {
133
-                                    $message = $message . $sbMessage;
133
+                                    $message = $message.$sbMessage;
134 134
                                 }
135 135
                          
136
-                                echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
136
+                                echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
137 137
 //                       echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
138 138
                                 echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
139
-                                echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
140
-                                echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>";
139
+                                echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
140
+                                echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>";
141 141
 
142 142
                                 $importPassword = \core\common\Entity::randomString(4, "0123456789");
143 143
                                 $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL);
144 144
                                 
145
-                                echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>";
145
+                                echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>";
146 146
                                 $_SESSION['individualtoken'] = $cleanToken;
147 147
                                 $_SESSION['importpassword'] = $importPassword;
148
-                                echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>";
148
+                                echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>";
149 149
                                 echo "<input type='hidden' name='generatedfor' value='silverbullet'/>";
150
-                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</span></button>";
150
+                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name'])."</span></button>";
151 151
                                 echo "<div class='device_info' id='info_g_sb'></div>";
152 152
                                 break;
153 153
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
154 154
                                 echo "<h2>Invitation link expired</h2>";
155
-                                echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry) . "</p>";
155
+                                echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry)."</p>";
156 156
                                 echo "<p>Below is all the information about your account's other login details, if any.</p>";
157 157
 // do NOT break, display full account info instead (this was a previously valid token after all)
158 158
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED:
159 159
                                 // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones.
160 160
                                 break;
161 161
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID:
162
-                                echo "<h2>" . _("Account information not found") . "</h2>";
163
-                                echo "<p>" . sprintf(_("The invitation link you followed does not map to any invitation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),\config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
162
+                                echo "<h2>"._("Account information not found")."</h2>";
163
+                                echo "<p>".sprintf(_("The invitation link you followed does not map to any invitation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
164 164
                         }
165 165
                         if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) {
166
-                            echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>";
167
-                            echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>";
166
+                            echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>";
167
+                            echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>";
168 168
                         }
169 169
                         ?>
170 170
                     </div>
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
     $attributes = $statusInfo['attributes'];
185 185
     $supportInfo = '';
186 186
     if (!empty($attributes['local_url'])) {
187
-        $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>';
187
+        $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>';
188 188
     }
189 189
     if (!empty($attributes['local_email'])) {
190
-        $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>';
190
+        $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>';
191 191
     }
192 192
     if (!empty($attributes['local_phone'])) {
193
-        $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>';
193
+        $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>';
194 194
     }
195 195
     if ($supportInfo != '') {
196
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>";
196
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>";
197 197
     } else {
198
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>";
198
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>";
199 199
     }
200 200
     ?>
201 201
     <script>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             var logo = <?php echo $statusInfo['idp_logo']; ?>;
205 205
             var idpId = <?php echo $statusInfo['idp_id']; ?>;
206 206
             <?php
207
-                if($message != '') {
207
+                if ($message != '') {
208 208
                     echo "message = \"$message\";\n";
209 209
                 }
210 210
             ?>
Please login to merge, or discard this patch.
web/admin/inc/deploymentLogs.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  * ******************************************************************************
10 10
  */
11 11
 
12
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
12
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
13 13
 $auth = new \web\lib\admin\Authentication();
14 14
 $auth->authenticate();
15 15
 $languageInstance = new \core\common\Language();
Please login to merge, or discard this patch.
core/DeploymentManaged.php 3 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -372,20 +372,20 @@  discard block
 block discarded – undo
372 372
         );
373 373
         // Generate a new private (and public) key pair
374 374
         $privkey = openssl_pkey_new(array(
375
-                                          "private_key_bits" => 4096,
376
-                                          "private_key_type" => OPENSSL_KEYTYPE_RSA));
375
+                                            "private_key_bits" => 4096,
376
+                                            "private_key_type" => OPENSSL_KEYTYPE_RSA));
377 377
         // export private key to $clientprivateKey (as string)
378 378
         openssl_pkey_export($privkey, $this->radsec_priv);
379 379
         // Generate a certificate signing request
380 380
         $csr = openssl_csr_new($dn, $privkey,
381
-                               array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
381
+                                array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
382 382
         // get CA certificate and private key
383 383
         $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"),
384 384
                             \config\Master::MANAGEDSP['capass']);
385 385
         $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
386 386
         $this->setTLSSerialNumber();
387 387
         $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'],
388
-                          array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no);
388
+                            array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no);
389 389
         openssl_x509_export($clientcert, $this->radsec_cert);
390 390
     } 
391 391
     /**
@@ -506,9 +506,9 @@  discard block
 block discarded – undo
506 506
      */
507 507
     public function renewtls()
508 508
     {
509
-       $id = $this->identifier;
510
-       $futureTlsClient = $this->createTLScredentials();
511
-       $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "ssii", $this->radsec_priv, $this->radsec_cert, $this->radsec_cert_serial_no, $id);           
509
+        $id = $this->identifier;
510
+        $futureTlsClient = $this->createTLScredentials();
511
+        $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "ssii", $this->radsec_priv, $this->radsec_cert, $this->radsec_cert_serial_no, $id);           
512 512
     }
513 513
     
514 514
     /**
@@ -518,38 +518,38 @@  discard block
 block discarded – undo
518 518
      */
519 519
     public function tlsfromcsr($csr)
520 520
     {
521
-       $id = $this->identifier;
522
-       $dn = array();
523
-       $dn['rdnSequence'] = array();
524
-       $dn['rdnSequence'][0] = array();
525
-       $dn['rdnSequence'][0][] = array('type' => 'id-at-organizationName', 'value' => array());
526
-       $dn['rdnSequence'][0][0]['value']['utf8String'] = 'eduroam';
527
-       $dn['rdnSequence'][1] = array();
528
-       $dn['rdnSequence'][1][] = array('type' => 'id-at-organizationalUnitName', 'value' => array());
529
-       $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP';
530
-       $dn['rdnSequence'][2] = array();
531
-       $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array());
532
-       $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution;
533
-       $csr->setDN($dn);
534
-       $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key");
535
-       $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] );
536
-       $pemca = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
537
-       $ca = new \phpseclib3\File\X509();
538
-       $ca->loadX509($pemca);
539
-       $ca->setPrivateKey($cakey);
540
-       // Sign the updated request, producing the certificate.
541
-       $x509 = new \phpseclib3\File\X509();
542
-       $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']);
543
-       $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']);
544
-       $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false);
545
-       $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days');
546
-       $this->setTLSSerialNumber(999999999999999999);
547
-       $x509->setSerialNumber($this->radsec_cert_serial_no, 10);
548
-       $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr)));
549
-       $this->radsec_cert = $x509->saveX509($cert);
550
-       $this->radsec_priv = NULL;
551
-       //$futureTlsClient = $this->createTLScredentials();
552
-       $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = NULL, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "sii", $this->radsec_cert, $this->radsec_cert_serial_no, $id);           
521
+        $id = $this->identifier;
522
+        $dn = array();
523
+        $dn['rdnSequence'] = array();
524
+        $dn['rdnSequence'][0] = array();
525
+        $dn['rdnSequence'][0][] = array('type' => 'id-at-organizationName', 'value' => array());
526
+        $dn['rdnSequence'][0][0]['value']['utf8String'] = 'eduroam';
527
+        $dn['rdnSequence'][1] = array();
528
+        $dn['rdnSequence'][1][] = array('type' => 'id-at-organizationalUnitName', 'value' => array());
529
+        $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP';
530
+        $dn['rdnSequence'][2] = array();
531
+        $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array());
532
+        $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution;
533
+        $csr->setDN($dn);
534
+        $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key");
535
+        $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] );
536
+        $pemca = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
537
+        $ca = new \phpseclib3\File\X509();
538
+        $ca->loadX509($pemca);
539
+        $ca->setPrivateKey($cakey);
540
+        // Sign the updated request, producing the certificate.
541
+        $x509 = new \phpseclib3\File\X509();
542
+        $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']);
543
+        $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']);
544
+        $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false);
545
+        $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days');
546
+        $this->setTLSSerialNumber(999999999999999999);
547
+        $x509->setSerialNumber($this->radsec_cert_serial_no, 10);
548
+        $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr)));
549
+        $this->radsec_cert = $x509->saveX509($cert);
550
+        $this->radsec_priv = NULL;
551
+        //$futureTlsClient = $this->createTLScredentials();
552
+        $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = NULL, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "sii", $this->radsec_cert, $this->radsec_cert_serial_no, $id);           
553 553
     }
554 554
     /**
555 555
      * marks the deployment as deactivated 
@@ -883,11 +883,11 @@  discard block
 block discarded – undo
883 883
                 unlink("$zipdir/$key/detail.zip");
884 884
                 $files = scandir("$zipdir/$key/");
885 885
                 foreach($files as $file) {
886
-                  if ($file == '.' || $file == '..') continue;
887
-                  $data = file_get_contents("$zipdir/$key/$file");
888
-                  $zipt->addFromString("radius-$key/$file", $data);
889
-                  $cnt += 1;
890
-                  unlink("$zipdir/$key/$file");
886
+                    if ($file == '.' || $file == '..') continue;
887
+                    $data = file_get_contents("$zipdir/$key/$file");
888
+                    $zipt->addFromString("radius-$key/$file", $data);
889
+                    $cnt += 1;
890
+                    unlink("$zipdir/$key/$file");
891 891
                 } 
892 892
                 if (file_exists("$zipdir/$key")) {
893 893
                     rmdir("$zipdir/$key");
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                 $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id;
323 323
             }
324 324
             if ($clients > $maxSupportedClients * 0.9) {
325
-                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!");
325
+                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!");
326 326
             }
327 327
         }
328 328
         if (count($serverCandidates) == 0 && $federation != "DEFAULT") {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
      * 
345 345
      * @throws Exception
346 346
      */
347
-    private function setTLSSerialNumber($max=PHP_INT_MAX) {
347
+    private function setTLSSerialNumber($max = PHP_INT_MAX) {
348 348
         $nonDupSerialFound = FALSE;
349 349
         do {
350 350
             $serial = random_int(1000000000, $max);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      */
365 365
     private function createTLScredentials()
366 366
     {
367
-        $clientName = 'SP' . $this->identifier . '-' . $this->institution;
367
+        $clientName = 'SP'.$this->identifier.'-'.$this->institution;
368 368
         $dn = array(
369 369
                     "organizationName" => "eduroam",
370 370
                     "organizationalUnitName" => "eduroam Managed SP",
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
         openssl_pkey_export($privkey, $this->radsec_priv);
379 379
         // Generate a certificate signing request
380 380
         $csr = openssl_csr_new($dn, $privkey,
381
-                               array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
381
+                               array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"));
382 382
         // get CA certificate and private key
383
-        $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"),
383
+        $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"),
384 384
                             \config\Master::MANAGEDSP['capass']);
385
-        $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
385
+        $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
386 386
         $this->setTLSSerialNumber();
387 387
         $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'],
388
-                          array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no);
388
+                          array('digest_alg'=>'sha512', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no);
389 389
         openssl_x509_export($clientcert, $this->radsec_cert);
390 390
     } 
391 391
     /**
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
             $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND )";
411 411
             $conditional2 = "DESC";
412 412
         }
413
-        $client = 'SP' . $this->identifier . '-' . $this->institution;
414
-        $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client );
413
+        $client = 'SP'.$this->identifier.'-'.$this->institution;
414
+        $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client);
415 415
        
416 416
         return mysqli_fetch_all($stats, \MYSQLI_ASSOC);
417 417
     }
@@ -529,11 +529,11 @@  discard block
 block discarded – undo
529 529
        $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP';
530 530
        $dn['rdnSequence'][2] = array();
531 531
        $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array());
532
-       $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution;
532
+       $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP'.$this->identifier."-".$this->institution;
533 533
        $csr->setDN($dn);
534
-       $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key");
535
-       $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] );
536
-       $pemca = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
534
+       $pemcakey = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key");
535
+       $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass']);
536
+       $pemca = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
537 537
        $ca = new \phpseclib3\File\X509();
538 538
        $ca->loadX509($pemca);
539 539
        $ca->setPrivateKey($cakey);
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
        $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']);
543 543
        $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']);
544 544
        $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false);
545
-       $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days');
545
+       $x509->setEndDate('+'.\config\Master::MANAGEDSP['daystoexpiry'].' days');
546 546
        $this->setTLSSerialNumber(999999999999999999);
547 547
        $x509->setSerialNumber($this->radsec_cert_serial_no, 10);
548 548
        $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr)));
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
     {
585 585
         $customAttrib = $this->getAttributes("managedsp:operatorname");
586 586
         if (count($customAttrib) == 0) {
587
-            return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix'];
587
+            return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix'];
588 588
         }
589 589
         return $customAttrib[0]["value"];
590 590
     }
@@ -599,14 +599,14 @@  discard block
 block discarded – undo
599 599
     private function sendToRADIUS(int $idx, $post)
600 600
     {
601 601
         $hostname = "radius_hostname_$idx";
602
-        $ch = curl_init("http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport']);
602
+        $ch = curl_init("http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']);
603 603
         if ($ch === FALSE) {
604 604
             $res = 'FAILURE';
605 605
         } else {
606 606
             curl_setopt($ch, CURLOPT_USERAGENT, "CAT-ManagedSP");
607 607
             curl_setopt($ch, CURLOPT_POST, 1);
608 608
             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
609
-            $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport'] . "/$post\n");
609
+            $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']."/$post\n");
610 610
             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
611 611
             curl_setopt($ch, CURLOPT_HEADER, 0);
612 612
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -647,19 +647,19 @@  discard block
 block discarded – undo
647 647
         } else {
648 648
             $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed');
649 649
         }
650
-        $txt = $txt . ' ';
650
+        $txt = $txt.' ';
651 651
         if (array_count_values($response)[$status] == 2) {
652
-            $txt = $txt . _('on both RADIUS servers: primary and backup') . '.';
652
+            $txt = $txt._('on both RADIUS servers: primary and backup').'.';
653 653
         } else {
654 654
             if ($response['res[1]'] == $status) {
655
-                $txt = $txt . _('on primary RADIUS server') . '.';
655
+                $txt = $txt._('on primary RADIUS server').'.';
656 656
             } else {
657
-                $txt = $txt . _('on backup RADIUS server') . '.';
657
+                $txt = $txt._('on backup RADIUS server').'.';
658 658
             }
659 659
         }
660 660
         $mail = \core\common\OutsideComm::mailHandle();
661 661
         $email = $this->getAttributes("support:email")[0]['value'];
662
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
662
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
663 663
         $mail->addAddress($email);
664 664
         if ($status == 'OK') {
665 665
             $mail->Subject = _('RADIUS profile update problem fixed');
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
             return NULL;
694 694
         }
695 695
         $timeout = 10;
696
-        curl_setopt($ch, CURLOPT_URL, 'http://' . $host);
696
+        curl_setopt($ch, CURLOPT_URL, 'http://'.$host);
697 697
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
698 698
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
699 699
         curl_exec($ch);
@@ -785,52 +785,52 @@  discard block
 block discarded – undo
785 785
     {
786 786
         $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
787 787
         if ($torevoke != '') {
788
-            $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier .
788
+            $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.
789 789
                     "&torevoke=$torevoke";
790 790
             foreach (array_keys($toPost) as $key) {
791 791
                 $toPost[$key] = $toPostTemplate;
792 792
             }
793 793
         } else {
794 794
             $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1;
795
-            $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . 
796
-                '&secret=' . $this->secret .
797
-                '&country=' . $this->getAttributes("internal:country")[0]['value'] .
798
-                '&pskkey=' . $this->pskkey . '&';
795
+            $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. 
796
+                '&secret='.$this->secret.
797
+                '&country='.$this->getAttributes("internal:country")[0]['value'].
798
+                '&pskkey='.$this->pskkey.'&';
799 799
             if ($remove) {
800
-                $toPostTemplate = $toPostTemplate . 'remove=1&';
800
+                $toPostTemplate = $toPostTemplate.'remove=1&';
801 801
             } else {
802
-                $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; 
802
+                $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; 
803 803
                 if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) {
804 804
                     $allRealms = $this->getAllRealms();
805 805
                     if (!empty($allRealms)) {
806
-                        $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&';
807
-                        $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&';
806
+                        $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&';
807
+                        $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&';
808 808
                     }
809 809
                 }
810 810
                 if ($this->getAttributes("managedsp:guest_vlan")[0]['value'] ?? NULL) {
811
-                    $toPostTemplate = $toPostTemplate . 'guest_vlan=' . $this->getAttributes("managedsp:guest_vlan")[0]['value'] . '&';
811
+                    $toPostTemplate = $toPostTemplate.'guest_vlan='.$this->getAttributes("managedsp:guest_vlan")[0]['value'].'&';
812 812
                 }
813 813
             }
814 814
             foreach (array_keys($toPost) as $key) {
815
-                $elem = 'port' . $key;
816
-                $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem;
815
+                $elem = 'port'.$key;
816
+                $toPost[$key] = $toPostTemplate.'port='.$this->$elem;
817 817
             }
818 818
         }
819 819
         $response = array();
820 820
         foreach ($toPost as $key => $value) {
821
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n");
821
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
822 822
             // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
823 823
             //if ($key == 2) {
824 824
             //    $response['res[2]'] = 'OK'; 
825 825
             //} else {
826
-                $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
826
+                $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
827 827
             //}
828 828
         }
829 829
         if ($onlyone) {
830
-            $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK;
830
+            $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK;
831 831
         }
832 832
         foreach (array('OK', 'FAILURE') as $status) {
833
-            if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) {
833
+            if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) {
834 834
                 $this->sendMailtoAdmin($remove, $response, $status);
835 835
             }
836 836
         }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
     {
848 848
         $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
849 849
         if ($logs) {
850
-            $toPostTemplate = 'logid=DEBUG-' . $this->identifier . '-' .$this->institution . "&backlog=$logs";
850
+            $toPostTemplate = 'logid=DEBUG-'.$this->identifier.'-'.$this->institution."&backlog=$logs";
851 851
             foreach (array_keys($toPost) as $key) {
852 852
                 $toPost[$key] = $toPostTemplate;
853 853
             }
@@ -856,13 +856,13 @@  discard block
 block discarded – undo
856 856
         $tempdir = \core\common\Entity::createTemporaryDirectory("test");
857 857
         $zipdir = $tempdir['dir'];
858 858
         foreach ($toPost as $key => $value) {
859
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n");
860
-            $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
859
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
860
+            $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
861 861
             $paths = [];
862
-            if (substr($response['res[' . $key . ']'], 0, 8) == 'ZIPDATA:') {
863
-                $data = substr($response['res[' . $key . ']'], 8);
862
+            if (substr($response['res['.$key.']'], 0, 8) == 'ZIPDATA:') {
863
+                $data = substr($response['res['.$key.']'], 8);
864 864
                 if (!file_exists("$zipdir/$key")) {
865
-                    mkdir("$zipdir/$key", 0755, true );
865
+                    mkdir("$zipdir/$key", 0755, true);
866 866
                 }
867 867
                 $fileHandle = fopen("$zipdir/$key/detail.zip", "wb");
868 868
                 fwrite($fileHandle, $data);
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
             }
871 871
         }
872 872
         $zipt = new \ZipArchive;
873
-        $zipt->open("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip', \ZipArchive::CREATE);
873
+        $zipt->open("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip', \ZipArchive::CREATE);
874 874
         $cnt = 0;
875 875
         foreach ($toPost as $key => $value) {
876 876
             if (file_exists("$zipdir/$key/detail.zip")) {
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
                 $zipf->close();
883 883
                 unlink("$zipdir/$key/detail.zip");
884 884
                 $files = scandir("$zipdir/$key/");
885
-                foreach($files as $file) {
885
+                foreach ($files as $file) {
886 886
                   if ($file == '.' || $file == '..') continue;
887 887
                   $data = file_get_contents("$zipdir/$key/$file");
888 888
                   $zipt->addFromString("radius-$key/$file", $data);
@@ -898,14 +898,14 @@  discard block
 block discarded – undo
898 898
             $zipt->addEmptyDir('.');
899 899
         }
900 900
         $zipt->close();
901
-        if (file_exists("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip')) {
902
-            $data = file_get_contents("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip');
903
-            unlink("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip'); 
901
+        if (file_exists("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip')) {
902
+            $data = file_get_contents("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip');
903
+            unlink("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip'); 
904 904
             rmdir($zipdir);
905 905
         }     
906 906
         if ($data !== FALSE) {
907 907
             header('Content-Type: application/zip');
908
-            header("Content-Disposition: attachment; filename=\"detail-".$this->identifier . '-' .$this->institution.".zip\"");
908
+            header("Content-Disposition: attachment; filename=\"detail-".$this->identifier.'-'.$this->institution.".zip\"");
909 909
             header("Content-Transfer-Encoding: binary");
910 910
             echo $data;
911 911
         } 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -883,7 +883,9 @@
 block discarded – undo
883 883
                 unlink("$zipdir/$key/detail.zip");
884 884
                 $files = scandir("$zipdir/$key/");
885 885
                 foreach($files as $file) {
886
-                  if ($file == '.' || $file == '..') continue;
886
+                  if ($file == '.' || $file == '..') {
887
+                      continue;
888
+                  }
887 889
                   $data = file_get_contents("$zipdir/$key/$file");
888 890
                   $zipt->addFromString("radius-$key/$file", $data);
889 891
                   $cnt += 1;
Please login to merge, or discard this patch.
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.
web/admin/overview_radsec_readiness.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
         ?>
93 93
         
94 94
     <select name="INST-list" id="INST-list">
95
-        <option value=""><?php echo _('---PLEASE CHOOSE---');?></option>
95
+        <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option>
96 96
         <?php 
97 97
         $instdata = array();
98 98
         foreach ($extInsts as $iid => $oneInst) {
99
-            print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>';
99
+            print '<option value="'.$iid.'">'.$oneInst['name'].'</option>';
100 100
             $instdata[$iid] = array();
101 101
             $instdata[$iid]['name'] = $oneInst['name'];   
102 102
             $instdata[$iid]['type'] = _('no data');
@@ -110,22 +110,22 @@  discard block
 block discarded – undo
110 110
             $contactdata = '';
111 111
             foreach ($oneInst['contacts'] as $oneContact) {
112 112
                 if ($contactdata != '') {
113
-                    $contactdata = $contactdata . '<br>';
113
+                    $contactdata = $contactdata.'<br>';
114 114
                 }
115 115
                 if ($oneContact['name']) {
116
-                    $contactdata = $contactdata . $oneContact['name'];
116
+                    $contactdata = $contactdata.$oneContact['name'];
117 117
                 }
118 118
                 if ($contactdata != '') {
119
-                    $contactdata = $contactdata . '<br>';
119
+                    $contactdata = $contactdata.'<br>';
120 120
                 }
121 121
                 if ($oneContact['mail']) {
122
-                    $contactdata = $contactdata . $oneContact['mail'];
122
+                    $contactdata = $contactdata.$oneContact['mail'];
123 123
                 }
124 124
                 if ($contactdata != '') {
125
-                    $contactdata = $contactdata . '<br>';
125
+                    $contactdata = $contactdata.'<br>';
126 126
                 }
127 127
                 if ($oneContact['phone']) {
128
-                    $contactdata = $contactdata . $oneContact['phone'];
128
+                    $contactdata = $contactdata.$oneContact['phone'];
129 129
                 }        
130 130
             }
131 131
             if ($contactdata == '') {
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
             var instts = [];
145 145
             <?php
146 146
             foreach (array_keys($instdata) as $iid) {
147
-                echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n";
148
-                echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n";
149
-                echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n";
150
-                echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n";
151
-                echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n";
147
+                echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n";
148
+                echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n";
149
+                echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n";
150
+                echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n";
151
+                echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n";
152 152
             }
153 153
             ?>
154 154
             $(document).ready(function(){
@@ -170,18 +170,18 @@  discard block
 block discarded – undo
170 170
     <div id="instdata_area">
171 171
         <table>
172 172
             <tr><th align="left" width="350">
173
-                    <?php echo _('Name');?>
173
+                    <?php echo _('Name'); ?>
174 174
                 </th><th align="left" width="100">
175
-                    <?php echo _('Type');?>
175
+                    <?php echo _('Type'); ?>
176 176
                 </th>
177 177
                 <th align="left" width="200">
178
-                    <?php echo _('Servers');?>
178
+                    <?php echo _('Servers'); ?>
179 179
                 </th>
180 180
                 <th align="left" width="200">
181
-                    <?php echo _('Contact data');?>
181
+                    <?php echo _('Contact data'); ?>
182 182
                 </th>
183 183
                 <th align="left" width="100">
184
-                    <?php echo _('Timestamp');?>
184
+                    <?php echo _('Timestamp'); ?>
185 185
                 </th>
186 186
             </tr>
187 187
             <tr id="toshow"></tr>
Please login to merge, or discard this patch.