Passed
Push — master ( 4bf09c...a2eb0f )
by Maja
08:36
created
web/admin/overview_sp.php 2 patches
Spacing   +32 added lines, -32 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
 $deco = new \web\lib\admin\PageDecoration();
32 32
 $validator = new \web\lib\common\InputValidation();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 } else {
39 39
     $link = 'http://';
40 40
 }
41
-$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
41
+$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
42 42
 $link = htmlspecialchars($link);
43 43
 
44 44
 echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureHotspot));
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
     <?php echo $mapCode->bodyTagCode(); ?>>
76 76
     <?php
77 77
     echo $deco->productheader("ADMIN-SP");
78
-    function check_url ($host) {
78
+    function check_url($host) {
79 79
         $ch = curl_init();
80 80
         $timeout = 10;
81 81
         if ($ch === FALSE) {
82 82
             return NULL;
83 83
         }
84
-        curl_setopt ( $ch, CURLOPT_URL, 'http://'.$host );
85
-        curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
86
-        curl_setopt ( $ch, CURLOPT_TIMEOUT, $timeout );
84
+        curl_setopt($ch, CURLOPT_URL, 'http://'.$host);
85
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
86
+        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
87 87
         $http_respond = curl_exec($ch);
88
-        $http_respond = trim( strip_tags( $http_respond ) );
89
-        $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
88
+        $http_respond = trim(strip_tags($http_respond));
89
+        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
90 90
         if ($http_code == 200) {
91 91
             return 1;
92 92
         }
@@ -131,21 +131,21 @@  discard block
 block discarded – undo
131 131
         <?php
132 132
         if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) {
133 133
             echo "<tr>
134
-                        <td>" . _("Check another realm's reachability") . "</td>
134
+                        <td>" . _("Check another realm's reachability")."</td>
135 135
                         <td><form method='post' action='../diag/action_realmcheck.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'>
136 136
                               <input type='text' name='realm' id='realm'>
137 137
                               <input type='hidden' name='comefrom' id='comefrom' value='$link'/>
138
-                              <button type='submit'>" . _("Go!") . "</button>
138
+                              <button type='submit'>"._("Go!")."</button>
139 139
                             </form>
140 140
                         </td>
141 141
                     </tr>";
142 142
         }
143 143
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam") { // SW: APPROVED
144 144
             echo "<tr>
145
-                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed) . "</td>
145
+                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed)."</td>
146 146
                         <td>
147 147
                            <form action='https://monitor.eduroam.org/mon_direct.php' accept-charset='UTF-8'>
148
-                              <button type='submit'>" . _("Go!") . "</button>
148
+                              <button type='submit'>" . _("Go!")."</button>
149 149
                            </form>
150 150
                         </td>
151 151
                     </tr>";
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
     <?php
157 157
     $hotspotProfiles = $my_inst->listDeployments();
158 158
     if (count($hotspotProfiles) == 0) { // no profiles yet.
159
-        echo "<h2>" . sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot) . "</h2>";
159
+        echo "<h2>".sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot)."</h2>";
160 160
     }
161 161
     if (count($hotspotProfiles) > 0) { // no profiles yet.
162
-        echo "<h2>" . sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot) . "</h2>";
162
+        echo "<h2>".sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot)."</h2>";
163 163
         // display an info box with the connection data
164 164
     }
165 165
    
@@ -171,19 +171,19 @@  discard block
 block discarded – undo
171 171
         ?>
172 172
         <div style='display: table-row; margin-bottom: 20px;'>
173 173
             <div class='profilebox' style='display: table-cell;'>
174
-                <h2><?php echo core\DeploymentManaged::PRODUCTNAME . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; ?></h2>
174
+                <h2><?php echo core\DeploymentManaged::PRODUCTNAME." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; ?></h2>
175 175
                 <table>
176 176
                     <tr>
177 177
                         <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
178 178
                         <?php
179 179
                             if ($deploymentObject->host1_v4 !== NULL) {
180
-                                echo _("IPv4") . ": " . $deploymentObject->host1_v4;
180
+                                echo _("IPv4").": ".$deploymentObject->host1_v4;
181 181
                             }
182 182
                             if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
183 183
                                 echo "<br/>";
184 184
                             }
185 185
                             if ($deploymentObject->host1_v6 !== NULL) {
186
-                                echo _("IPv6") . ": " . $deploymentObject->host1_v6;
186
+                                echo _("IPv6").": ".$deploymentObject->host1_v6;
187 187
                             }
188 188
                             ?>
189 189
                         </td>
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
                         <td><?php echo $deploymentObject->port1; ?></td>
192 192
                         <td>
193 193
                             <?php
194
-                                echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . 
195
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . 
196
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>";
194
+                                echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. 
195
+                                     "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. 
196
+                                     "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."'>";
197 197
                             ?>
198 198
                         </td>
199 199
                     </tr>
@@ -201,22 +201,22 @@  discard block
 block discarded – undo
201 201
                         <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
202 202
                             <?php
203 203
                             if ($deploymentObject->host2_v4 !== NULL) {
204
-                                echo _("IPv4") . ": " . $deploymentObject->host2_v4;
204
+                                echo _("IPv4").": ".$deploymentObject->host2_v4;
205 205
                             }
206 206
                             if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
207 207
                                 echo "<br/>";
208 208
                             }
209 209
                             if ($deploymentObject->host2_v6 !== NULL) {
210
-                                echo _("IPv6") . ": " . $deploymentObject->host2_v6;
210
+                                echo _("IPv6").": ".$deploymentObject->host2_v6;
211 211
                             }
212 212
                             ?></td>
213 213
                         <td><?php echo _("RADIUS port number: ") ?></td>
214 214
                         <td><?php echo $deploymentObject->port2; ?></td>
215 215
                         <td>
216 216
                             <?php
217
-                                echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
218
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . 
219
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>";
217
+                                echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
218
+                                     "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. 
219
+                                     "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."'>";
220 220
                             ?>
221 221
                         </td>
222 222
                     </tr>
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
                                     if (isset($res['FAILURE']) && $res[] > 0) {
268 268
                                         echo '<br>';
269 269
                                         if ($res['FAILURE'] == 2) 
270
-                                            echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
270
+                                            echo ' <span style="color: red;">'._("Activation failure.").'</span>';
271 271
                                         } else {
272 272
                                             if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
273
-                                                echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
273
+                                                echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
274 274
                                             } else {
275
-                                                echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
275
+                                                echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
276 276
                                             }
277 277
                                         }
278 278
                                     }
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
                                     if ($res['FAILURE'] > 0) {
293 293
                                         echo '<br>';
294 294
                                         if ($res['FAILURE'] == 2) {
295
-                                            echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
295
+                                            echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
296 296
                                         } else {
297 297
                                             if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
298
-                                                echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
298
+                                                echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
299 299
                                             } else {
300
-                                                echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
300
+                                                echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
301 301
                                             }
302 302
                                         }
303 303
                                     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                 foreach ($retry as $key => $value) {
317 317
                                     if ($value == 1) {
318 318
                                     ?>
319
-                                    <input type="hidden" name='update[]' value='<?php echo $key;?>'>
319
+                                    <input type="hidden" name='update[]' value='<?php echo $key; ?>'>
320 320
                                     <?php
321 321
                                     }
322 322
                                 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,8 +266,9 @@
 block discarded – undo
266 266
                                     $res = array_count_values($_GET['res']);
267 267
                                     if (isset($res['FAILURE']) && $res[] > 0) {
268 268
                                         echo '<br>';
269
-                                        if ($res['FAILURE'] == 2) 
270
-                                            echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
269
+                                        if ($res['FAILURE'] == 2) {
270
+                                                                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
271
+                                        }
271 272
                                         } else {
272 273
                                             if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
273 274
                                                 echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
Please login to merge, or discard this patch.
core/DeploymentManaged.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id;
251 251
             }
252 252
             if ($clients > $maxSupportedClients * 0.9) {
253
-                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!");
253
+                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!");
254 254
             }
255 255
         }
256 256
         if (count($serverCandidates) == 0 && $federation != "DEFAULT") {
@@ -281,28 +281,28 @@  discard block
 block discarded – undo
281 281
             $ourLocation = ['lon' => $geoip['geo']['lon'], 'lat' => $geoip['geo']['lat']];
282 282
         }
283 283
         $inst = new IdP($this->institution);
284
-        $ourserver = $this->findGoodServerLocation($ourLocation, $inst->federation , []);
284
+        $ourserver = $this->findGoodServerLocation($ourLocation, $inst->federation, []);
285 285
         // now, find an unused port in the preferred server
286 286
         $foundFreePort1 = 0;
287 287
         while ($foundFreePort1 == 0) {
288 288
             $portCandidate = random_int(1200, 65535);
289
-            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '" . $ourserver . "' AND port_instance_1 = $portCandidate");
289
+            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '".$ourserver."' AND port_instance_1 = $portCandidate");
290 290
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
291 291
                 $foundFreePort1 = $portCandidate;
292 292
             }
293 293
         }
294
-        $ourSecondServer = $this->findGoodServerLocation($ourLocation, $inst->federation , [$ourserver]);
294
+        $ourSecondServer = $this->findGoodServerLocation($ourLocation, $inst->federation, [$ourserver]);
295 295
         $foundFreePort2 = 0;
296 296
         while ($foundFreePort2 == 0) {
297 297
             $portCandidate = random_int(1200, 65535);
298
-            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '" . $ourSecondServer . "' AND port_instance_2 = $portCandidate");
298
+            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '".$ourSecondServer."' AND port_instance_2 = $portCandidate");
299 299
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
300 300
                 $foundFreePort2 = $portCandidate;
301 301
             }
302 302
         }
303 303
         // and make up a shared secret that is halfways readable
304 304
         $futureSecret = $this->randomString(16, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
305
-        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '" . $ourserver . "', radius_instance_2 = '" . $ourSecondServer . "', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier");
305
+        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '".$ourserver."', radius_instance_2 = '".$ourSecondServer."', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier");
306 306
         return ["port_instance_1" => $foundFreePort1, "port_instance_2" => $foundFreePort2, "secret" => $futureSecret, "radius_instance_1" => $ourserver, "radius_instance_2" => $ourserver];
307 307
     }
308 308
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      * @return void
346 346
      */
347 347
     public function deactivate() {
348
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::INACTIVE . " WHERE deployment_id = $this->identifier");
348
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::INACTIVE." WHERE deployment_id = $this->identifier");
349 349
     }
350 350
 
351 351
     /**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      * @return void
356 356
      */
357 357
     public function activate() {
358
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::ACTIVE . " WHERE deployment_id = $this->identifier");
358
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::ACTIVE." WHERE deployment_id = $this->identifier");
359 359
     }
360 360
 
361 361
     /**
@@ -381,15 +381,15 @@  discard block
 block discarded – undo
381 381
     public function sendToRADIUS($idx, $post) {
382 382
             
383 383
         $hostname = "radius_hostname_$idx";
384
-        $ch = curl_init( "http://" . $this->$hostname );
384
+        $ch = curl_init("http://".$this->$hostname);
385 385
         if ($ch) {
386
-            curl_setopt( $ch, CURLOPT_POST, 1);
387
-            curl_setopt( $ch, CURLOPT_POSTFIELDS, $post);
388
-            $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ": $post\n");
389
-            curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
390
-            curl_setopt( $ch, CURLOPT_HEADER, 0);
391
-            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
392
-            $res = curl_exec( $ch );
386
+            curl_setopt($ch, CURLOPT_POST, 1);
387
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
388
+            $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.": $post\n");
389
+            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
390
+            curl_setopt($ch, CURLOPT_HEADER, 0);
391
+            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
392
+            $res = curl_exec($ch);
393 393
             if ($res === FALSE) {
394 394
                 $res = 'FAILURE';
395 395
             }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         } else {
399 399
             $res = 'FAILURE';
400 400
         }
401
-        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = " . ($res == 'OK'? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE) . " WHERE deployment_id = $this->identifier");
401
+        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = ".($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE)." WHERE deployment_id = $this->identifier");
402 402
         return $res;
403 403
     }
404 404
     /**
@@ -412,28 +412,28 @@  discard block
 block discarded – undo
412 412
     private function sendMailtoAdmin($remove, $response) {
413 413
         $txt = '';
414 414
         if ($remove) {
415
-            $txt = _('Profile dectivation failed' . ' ');
415
+            $txt = _('Profile dectivation failed'.' ');
416 416
         } else {
417
-            $txt = _('Profile activation/modification failed' . ' ');
417
+            $txt = _('Profile activation/modification failed'.' ');
418 418
         }
419 419
         if (array_count_values($response)['FAILURE'] == 2) {
420
-            $txt = $txt . _('on both RADIUS servers: primary and backup') . '.';
420
+            $txt = $txt._('on both RADIUS servers: primary and backup').'.';
421 421
         } else {
422 422
             if ($response['res[1]'] == 'FAILURE') {
423
-                $txt = $txt . _('on primary RADIUS server') . '.';
423
+                $txt = $txt._('on primary RADIUS server').'.';
424 424
             } else {
425
-                $txt = $txt . _('on backup RADIUS server') . '.';
425
+                $txt = $txt._('on backup RADIUS server').'.';
426 426
             }
427 427
         }
428 428
         $mail = \core\common\OutsideComm::mailHandle();
429 429
         $email = $this->getAttributes("support:email")[0]['value'];
430
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
430
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
431 431
         $mail->addAddress($email);
432 432
         $mail->Subject = _('RADIUS profile update problem');
433 433
         $mail->Body = $txt;
434 434
 
435 435
         $sent = $mail->send();
436
-        if ( $sent === FALSE)
436
+        if ($sent === FALSE)
437 437
         $this->loggerInstance->debug(1, 'Mailing on RADIUS problem failed');
438 438
     }
439 439
     /**
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
     public function setRADIUSconfig($remove = 0, $onlyone = 0) {
447 447
         $toPost = array();
448 448
         if ($onlyone) {
449
-            $toPost[$onlyone]  = '';
449
+            $toPost[$onlyone] = '';
450 450
         } else {
451 451
             // run on both servers
452 452
             $toPost[1] = '';
453 453
             $toPost[2] = '';
454 454
         }
455
-        $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&';
455
+        $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.'&secret='.$this->secret.'&country='.$this->getAttributes("internal:country")[0]['value'].'&';
456 456
         if ($remove) {
457
-            $toPostTemplate = $toPostTemplate . 'remove=1&';
457
+            $toPostTemplate = $toPostTemplate.'remove=1&';
458 458
         } else {
459 459
             if ($this->getAttributes("managedsp:operatorname")[0]['value'] ?? NULL) {
460
-                $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getAttributes("managedsp:operatorname")[0]['value'] . '&';
460
+                $toPostTemplate = $toPostTemplate.'operatorname='.$this->getAttributes("managedsp:operatorname")[0]['value'].'&';
461 461
             }
462 462
             if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) {
463 463
                 $idp = new IdP($this->institution);
@@ -474,25 +474,25 @@  discard block
 block discarded – undo
474 474
                     }
475 475
                 }
476 476
                 if (!empty($allRealms)) {
477
-                    $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&';
478
-                    $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&';
477
+                    $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&';
478
+                    $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&';
479 479
                 }
480 480
             }
481 481
         }
482 482
         foreach (array_keys($toPost) as $key) {
483 483
             if ($key == 1) {
484
-                $toPost[$key] = $toPostTemplate . 'port=' . $this->port1;
484
+                $toPost[$key] = $toPostTemplate.'port='.$this->port1;
485 485
             } else {
486
-                $toPost[$key] = $toPostTemplate . 'port=' . $this->port2;
486
+                $toPost[$key] = $toPostTemplate.'port='.$this->port2;
487 487
             }      
488 488
         }
489 489
         $response = array();
490 490
         foreach ($toPost as $key => $value) {
491
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] ."\n");
491
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
492 492
             $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
493 493
         }
494 494
         if ($onlyone) {
495
-            $response['res['.($onlyone==1)? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK;
495
+            $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK;
496 496
         }
497 497
         if (in_array('FAILURE', $response)) {
498 498
             $this->sendMailtoAdmin($remove, $response);
Please login to merge, or discard this patch.