Test Setup Failed
Push — master ( 599486...517a25 )
by Tomasz
09:48
created
web/admin/overview_sp.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  * */
22 22
  
23
- /**
24
- * This file is used to display a deployment.
25
- * 
26
- * @author Maja Gorecka-Wolniewicz <[email protected]>
27
- */
23
+    /**
24
+     * This file is used to display a deployment.
25
+     * 
26
+     * @author Maja Gorecka-Wolniewicz <[email protected]>
27
+     */
28 28
 ?>
29 29
 <?php
30 30
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                         if ($deploymentObject->radsec_cert != NULL) {
343 343
                             echo "<i>";
344 344
                             echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
345
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
345
+                                    _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
346 346
                         
347 347
                             echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
348 348
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                         <td>
362 362
                             <?php printf(_("PSK Identity: %s"), "<span id='pskid_data_$depId'>SP".$depId.'-'.$deploymentObject->institution.'</span>');
363 363
                             echo copyIcon("pskid_icon_$depId");
364
-                           ?>
364
+                            ?>
365 365
                             <br>
366 366
                             <?php printf(_("PSK hexphrase: %s"), "<span id='pskkey_data_$depId'>".$deploymentObject->pskkey."</span>");
367 367
                             echo copyIcon("pskkey_icon_$depId");
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
             <h1><?php echo $tablecaption; ?></h1>
565 565
             <h2><?php echo _("5 most recent authentications");?></h2>
566 566
             <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
567
-                     echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
567
+                        echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
568 568
             <table class='authrecord'>
569 569
     <caption><?php echo $tablecaption;?></caption>
570 570
     <tr style='text-align: left;'>
@@ -585,9 +585,9 @@  discard block
 block discarded – undo
585 585
                 . "<td>".$oneRecord['outer_user']."</td>"
586 586
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
587 587
                 . "<td>".$oneRecord['mac']."</td>"
588
-		. "<td>".substr($oneRecord['cui'], 0, 18)
589
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590
-	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
588
+        . "<td>".substr($oneRecord['cui'], 0, 18)
589
+        . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590
+            . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
591 591
                 . "<td>".$oneRecord['ap_id']."</td>"
592 592
                 . "<td>".$oneRecord['prot']."</td>"
593 593
                 . "</tr>";
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
             $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog=";
628 628
             ?></h2>
629 629
             <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' .
630
-                  _('If no logs are available an empty zip file is provided.');?>
630
+                    _('If no logs are available an empty zip file is provided.');?>
631 631
             <div style='height:3px'></div>
632 632
             <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?>
633 633
             </button>
@@ -659,9 +659,9 @@  discard block
 block discarded – undo
659 659
     foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) {
660 660
         $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']);
661 661
         if (is_resource($connection)) {
662
-           fclose($connection);
662
+            fclose($connection);
663 663
         } else {
664
-           return false;
664
+            return false;
665 665
         }
666 666
     }
667 667
     return true;
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                             </button>
684 684
                             <span style='color: red;'>
685 685
                             <?php if ($hasMail == 0) { 
686
-                              echo _("Helpdesk mail address is required but missing!");  
686
+                                echo _("Helpdesk mail address is required but missing!");  
687 687
                             }
688 688
                             ?>
689 689
                             </span>
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 <?php
97 97
 function copyIcon($target) {
98
-    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'. _("Copy to clipboard").'" >';
98
+    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'._("Copy to clipboard").'" >';
99 99
 }
100 100
 
101 101
 /**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  * @param \core\DeploymentManaged $deploymentObject the deployment to work with
105 105
  * @throws Exception
106 106
  */
107
-function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg=[]) {
107
+function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg = []) {
108 108
     // RADIUS status icons
109 109
     $depId = $deploymentObject->identifier;
110 110
     $radiusMessages = [
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     $radius_status = array();
115 115
     $radius_status[0] = $deploymentObject->radius_status_1;
116 116
     $radius_status[1] = $deploymentObject->radius_status_2;
117
-    $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
117
+    $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
118 118
     $retry = $deploymentObject->checkRADIUSHostandConfigDaemon();
119 119
     $isradiusready = radius_ready($deploymentObject);
120 120
     if (is_array($retry)) {
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
     }
127 127
     ?>
128 128
     <div style='display: table-row_id;'>
129
-        <div class='profilebox' id="profilebox_<?php echo $depId;?>" style='display: table-cell;'>
129
+        <div class='profilebox' id="profilebox_<?php echo $depId; ?>" style='display: table-cell;'>
130 130
             <h2><?php
131 131
                 switch ($deploymentObject->consortium) {
132 132
                     case "eduroam":
133
-                        $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME. ": SP$depId-".$deploymentObject->institution;
133
+                        $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME.": SP$depId-".$deploymentObject->institution;
134 134
                         break;
135 135
                     case "OpenRoaming":
136 136
                         $displayname = "OpenRoaming ANP";
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     default:
139 139
                         throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
140 140
                 }
141
-                echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
141
+                echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
142 142
                 ?></h2>
143 143
             <table class="deployments">
144 144
                 <caption><?php echo _("Deployment Details"); ?></caption>
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
                     <td>
172 172
                         <?php
173 173
                         if ($deploymentObject->status) {
174
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
175
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
176
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
174
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
175
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
176
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
177 177
                         }
178 178
                         ?>
179 179
                     </td>
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
                     <td>
204 204
                         <?php
205 205
                         if ($deploymentObject->status && $deploymentObject->radius_status_2) {
206
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
207
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
208
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
206
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
207
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
208
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
209 209
                         }
210 210
                         ?>
211 211
                     </td>
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 <tr style="vertical-align:bottom">
214 214
                     <td><?php echo _("RADIUS shared secret for both servers"); ?></td>
215 215
                     <td>
216
-                        <span id="shared_data_<?php echo $deploymentObject->identifier;?>"><?php echo $deploymentObject->secret;?></span>
216
+                        <span id="shared_data_<?php echo $deploymentObject->identifier; ?>"><?php echo $deploymentObject->secret; ?></span>
217 217
                         <?php echo copyIcon("shared_icon_".$deploymentObject->identifier) ?>
218 218
                     </td>
219 219
                     <td></td>
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
                     <td>
250 250
                         <?php
251 251
                         if ($deploymentObject->status) {
252
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
253
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
254
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
252
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
253
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
254
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
255 255
                         }
256 256
                         ?>
257 257
                     </td>
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
                     <td>
282 282
                         <?php
283 283
                         if ($deploymentObject->status && $deploymentObject->radius_status_2) {
284
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
285
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
286
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
284
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
285
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
286
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
287 287
                         }
288 288
                         ?>
289 289
                     </td>
@@ -299,27 +299,27 @@  discard block
 block discarded – undo
299 299
                     <td>
300 300
                     <?php
301 301
                     if ($deploymentObject->radsec_priv == '') {
302
-                        echo _('The client certificate was created using an uploaded CSR, the private key is not available') . '<br><br>';
302
+                        echo _('The client certificate was created using an uploaded CSR, the private key is not available').'<br><br>';
303 303
                     }
304
-                    echo _('Subject:') . ' ' . $data['name'] . '<br>';
305
-                    echo _('Serial number:') . ' ' . $data['serialNumberHex'] . '<br>';
306
-                    $dleft = floor(($data['validTo_time_t']-time())/(24*60*60));
304
+                    echo _('Subject:').' '.$data['name'].'<br>';
305
+                    echo _('Serial number:').' '.$data['serialNumberHex'].'<br>';
306
+                    $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60));
307 307
                     if ($dleft < 30) {
308 308
                         echo '<font color="red">';
309 309
                     }
310
-                    echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC';
310
+                    echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC';
311 311
                     if ($dleft > 2) {
312
-                        echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft;
312
+                        echo '<br>'._('Number of days to expiry:').' '.$dleft;
313 313
                     } else {
314
-                        echo '<br>' . _('If you are using RADIUS over TLS you should urgently renew your credentials') . '!';
314
+                        echo '<br>'._('If you are using RADIUS over TLS you should urgently renew your credentials').'!';
315 315
                     }
316 316
                     if ($dleft < 30) { echo '</font>'; }
317 317
                     ?></td>
318 318
                 </tr><tr><td></td>
319 319
 
320 320
                     <td>
321
-                        <span style="display: none;" id="cert_data_<?php echo $depId;?>"><?php echo $deploymentObject->radsec_cert;?></span>
322
-                        <span style="display: none;" id="ca_cert_data_<?php echo $depId;?>"><?php echo $cacert;?></span>
321
+                        <span style="display: none;" id="cert_data_<?php echo $depId; ?>"><?php echo $deploymentObject->radsec_cert; ?></span>
322
+                        <span style="display: none;" id="ca_cert_data_<?php echo $depId; ?>"><?php echo $cacert; ?></span>
323 323
                         <?php if ($deploymentObject->radsec_priv != '') {
324 324
                             echo _("private key").copyIcon("priv_key_icon_$depId")."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
325 325
                             echo '<span style="display: none;" id="priv_key_data_'.$depId.'">'.$deploymentObject->radsec_priv.'</span>';
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                             echo _("CA certificate").copyIcon("ca_cert_icon_$depId");
331 331
                         ?>
332 332
                         <br/>
333
-                        <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution;?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data');?></button>
333
+                        <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution; ?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data'); ?></button>
334 334
 
335 335
                     </td>
336 336
                     <td></td>
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
                     <?php
342 342
                         if ($deploymentObject->radsec_cert != NULL) {
343 343
                             echo "<i>";
344
-                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
345
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
344
+                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials').'<br>'.
345
+                                 _('click on "Renew RADIUS over TLS credentials" button').'<br>';
346 346
                         
347
-                            echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
347
+                            echo '<br/>'._('You can upload your own CSR to replace default TLS credentials.').'<br>'. 
348 348
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
349 349
                             echo "</i>";
350 350
                     }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                 
380 380
                 ?>
381 381
                 <tr></tr>
382
-                <tr><th colspan="2"><?php echo _('Additional deployment settings');?></th></tr>
382
+                <tr><th colspan="2"><?php echo _('Additional deployment settings'); ?></th></tr>
383 383
                     <tr>
384 384
                         <td>
385 385
                             <?php
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
460 460
                                 echo '<br>';
461 461
                                 if ($res['FAILURE'] == 2) {
462
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
462
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
463 463
                                 } else {
464 464
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
465
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
465
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
466 466
                                     } else {
467
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
467
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
468 468
                                     }
469 469
                                 }
470 470
                             }
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
                                 if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
492 492
                                     echo '<br>';
493 493
                                     if ($res['FAILURE'] == 2) {
494
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
494
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
495 495
                                     } else {
496 496
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
497
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
497
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
498 498
                                         } else {
499
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
499
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
500 500
                                         }
501 501
                                     }
502 502
                                 }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
             </div>
545 545
             <?php 
546 546
             if (!$isradiusready) { 
547
-                echo '<p>'. _("We are not able to handle a new configuration request requiring contact with RADIUS servers now.") . '<br>' . _("Check later.");
547
+                echo '<p>'._("We are not able to handle a new configuration request requiring contact with RADIUS servers now.").'<br>'._("Check later.");
548 548
                 
549 549
             } 
550 550
             if (count($errormsg) > 0 && array_key_exists($deploymentObject->identifier, $errormsg)) {
@@ -560,38 +560,38 @@  discard block
 block discarded – undo
560 560
         </div>
561 561
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
562 562
         <div style='display: table-cell; min-width:200px;'>
563
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
563
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
564 564
             <h1><?php echo $tablecaption; ?></h1>
565
-            <h2><?php echo _("5 most recent authentications");?></h2>
566
-            <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
565
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
566
+            <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id").'<br>';
567 567
                      echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
568 568
             <table class='authrecord'>
569
-    <caption><?php echo $tablecaption;?></caption>
569
+    <caption><?php echo $tablecaption; ?></caption>
570 570
     <tr style='text-align: left;'>
571
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
572
-        <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th>
573
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
574
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
575
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> 
576
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
577
-        <th scope="col"><strong><?php echo _("Protocol");?></strong></th>
571
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
572
+        <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th>
573
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
574
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
575
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> 
576
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
577
+        <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th>
578 578
     </tr>
579 579
     <?php
580
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
580
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
581 581
     $i = 0;	   
582 582
     foreach ($userAuthData as $oneRecord) {
583
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
583
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
584 584
                 . "<td>".$oneRecord['activity_time']."</td>"
585 585
                 . "<td>".$oneRecord['outer_user']."</td>"
586 586
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
587 587
                 . "<td>".$oneRecord['mac']."</td>"
588 588
 		. "<td>".substr($oneRecord['cui'], 0, 18)
589
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
589
+		. ($oneRecord['cui'] == '' ? "" : "... ".copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590 590
 	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
591 591
                 . "<td>".$oneRecord['ap_id']."</td>"
592 592
                 . "<td>".$oneRecord['prot']."</td>"
593 593
                 . "</tr>";
594
-        if ($oneRecord['cui']!='') {
594
+        if ($oneRecord['cui'] != '') {
595 595
             $i++;
596 596
         }
597 597
     }
@@ -613,11 +613,11 @@  discard block
 block discarded – undo
613 613
             echo _('Get statistics as CSV file:').' '; 
614 614
             $query = 'inc/deploymentStats.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&as=csv&backlog=";
615 615
             ?>
616
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>WEEK';"><?php echo _('Last week');?>
616
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>WEEK';"><?php echo _('Last week'); ?>
617 617
             </button>
618
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>MONTH';"><?php echo _('Last 30 days');?>
618
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>MONTH';"><?php echo _('Last 30 days'); ?>
619 619
             </button>
620
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>FULL';"><?php echo _('Last 6 months');?>
620
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>FULL';"><?php echo _('Last 6 months'); ?>
621 621
             </button>
622 622
         </div><!-- statistics space -->
623 623
         <div style='height:5px'></div>
@@ -626,14 +626,14 @@  discard block
 block discarded – undo
626 626
             <h2><?php echo _('To get detailed logs from RADIUS sites click a button below.'); 
627 627
             $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog=";
628 628
             ?></h2>
629
-            <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' .
630
-                  _('If no logs are available an empty zip file is provided.');?>
629
+            <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).').'<br>'.
630
+                  _('If no logs are available an empty zip file is provided.'); ?>
631 631
             <div style='height:3px'></div>
632
-            <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?>
632
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>1';"><?php echo _('Today'); ?>
633 633
             </button>
634
-            <button name="logs" type="button" onclick="location.href='<?php echo $query;?>2';"><?php echo _('Last 2 days');?>
634
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>2';"><?php echo _('Last 2 days'); ?>
635 635
             </button>
636
-            <button name="logs" type="button" onclick="location.href='<?php echo $query;?>7';"><?php echo _('Last 7 days');?>
636
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>7';"><?php echo _('Last 7 days'); ?>
637 637
             </button>
638 638
         </div>
639 639
     </div> 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                         <div>
682 682
                             <input type="hidden" name="consortium" value="eduroam"/>
683 683
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
684
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
684
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
685 685
                             </button>
686 686
                             <span style='color: red;'>
687 687
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.
docker/MSP/web/html/index.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@  discard block
 block discarded – undo
5 5
 $opn = $vlans = '';
6 6
 $guest_vlan = 0;
7 7
 if ( isset($_POST['enc'])  && $_POST['enc'] != '' && ($enc=base64_decode($_POST['enc'], true)) !== false ) {
8
-	$decrypted = openssl_decrypt($enc, "CHACHA20", SERVER_SECRET, 0, SERVER_IV);
9
-	if ($decrypted === false) {
10
-          echo "FAILURE";
11
-          exit;	  
12
-	} else {
13
-	  parse_str($decrypted, $darr);
14
-	  if (!isset($darr['token']) || $darr['token'] != SERVER_TOKEN) {
15
-		  echo "FAILURE";
16
-		  exit;
17
-          } 
18
-	} 
8
+    $decrypted = openssl_decrypt($enc, "CHACHA20", SERVER_SECRET, 0, SERVER_IV);
9
+    if ($decrypted === false) {
10
+            echo "FAILURE";
11
+            exit;	  
12
+    } else {
13
+        parse_str($decrypted, $darr);
14
+        if (!isset($darr['token']) || $darr['token'] != SERVER_TOKEN) {
15
+            echo "FAILURE";
16
+            exit;
17
+            } 
18
+    } 
19 19
 }
20 20
 # when a request contains logid and backlog ";s:11:"DEBUG-11-52";s:7:"backlog";s:1:"7";}
21 21
 if ( isset($darr['logid']) && isset($darr['backlog']) && isset($darr['iv']) ) {
22
-	if (substr($darr['logid'], 0, 5) == 'DEBUG') {
23
-          $logid = substr($darr['logid'], 6);
22
+    if (substr($darr['logid'], 0, 5) == 'DEBUG') {
23
+            $logid = substr($darr['logid'], 6);
24 24
         }
25
-	$iv = $darr['iv'];
26
-  	$res = cat_socket(implode(':', array($logid, $darr['backlog'])));
27
-	$cnt = 0;
28
-	if (substr($res, 0, strlen(ZIPDIR)) == ZIPDIR) {
29
-	    $content = file_get_contents($res);
25
+    $iv = $darr['iv'];
26
+        $res = cat_socket(implode(':', array($logid, $darr['backlog'])));
27
+    $cnt = 0;
28
+    if (substr($res, 0, strlen(ZIPDIR)) == ZIPDIR) {
29
+        $content = file_get_contents($res);
30 30
             $encrypted = openssl_encrypt(SERVER_TOKEN . $content, "CHACHA20", SERVER_SECRET, 0, $iv);
31
-	    header('Content-Type: application/octet-stream');
31
+        header('Content-Type: application/octet-stream');
32 32
             header("Content-Transfer-Encoding: binary");
33
-	    echo "ZIPDATA:$encrypted";
34
-	}
35
-	if (file_exists($res)) {
36
-	  unlink($res);
37
-	}
38
-	exit;
33
+        echo "ZIPDATA:$encrypted";
34
+    }
35
+    if (file_exists($res)) {
36
+        unlink($res);
37
+    }
38
+    exit;
39 39
 }
40 40
 # MUST provide: deployment_id, inst_id
41 41
 #               and port, secret, pskkey, country or torevoke
@@ -44,33 +44,33 @@  discard block
 block discarded – undo
44 44
     isset($darr['instid']) && isset($darr['deploymentid']) &&
45 45
     (isset($darr['port']) && isset($darr['secret']) && isset($darr['pskkey']) && isset($darr['country']) ||
46 46
      isset($darr['torevoke']))) {
47
-  if (isset($darr['remove'])) {
47
+    if (isset($darr['remove'])) {
48 48
     $remove = 1;
49
-  } else {
49
+    } else {
50 50
     if (isset($darr['operatorname'])) {
51
-      $opn = trim($darr['operatorname']);
51
+        $opn = trim($darr['operatorname']);
52 52
     }
53 53
     if (isset($darr['vlan']) && isset($darr['realmforvlan']) &&
54 54
         is_array($darr['realmforvlan'])) {
55
-      $vlans = $darr['vlan'] . '#' . implode('#', $darr['realmforvlan']);
55
+        $vlans = $darr['vlan'] . '#' . implode('#', $darr['realmforvlan']);
56 56
     }
57 57
     if (isset($darr['guest_vlan'])) {
58
-      $guest_vlan = $darr['guest_vlan'];
58
+        $guest_vlan = $darr['guest_vlan'];
59
+    }
60
+    }
61
+    if (isset($darr['torevoke'])) {
62
+        $el = explode('#', $darr['torevoke']);
63
+        $res = cat_socket(implode(':', array($darr['instid'], $darr['deploymentid'], $el[0], $el[1])));
64
+    } else {
65
+        # arguments 5-7 are Base64 encoded
66
+        $res = cat_socket(implode(':', array($darr['country'],
67
+                                    $darr['instid'], $darr['deploymentid'],
68
+                                    $darr['port'],
69
+                                    base64_encode($darr['secret']),
70
+                                    base64_encode($opn), 
71
+                                    base64_encode($vlans), base64_encode($darr['pskkey']), $guest_vlan, $remove)));
59 72
     }
60
-  }
61
-  if (isset($darr['torevoke'])) {
62
-	  $el = explode('#', $darr['torevoke']);
63
-	  $res = cat_socket(implode(':', array($darr['instid'], $darr['deploymentid'], $el[0], $el[1])));
64
-  } else {
65
-  	# arguments 5-7 are Base64 encoded
66
-  	$res = cat_socket(implode(':', array($darr['country'],
67
-                                 $darr['instid'], $darr['deploymentid'],
68
-                                 $darr['port'],
69
-                                 base64_encode($darr['secret']),
70
-                                 base64_encode($opn), 
71
-                                 base64_encode($vlans), base64_encode($darr['pskkey']), $guest_vlan, $remove)));
72
-  }
73
-  echo $res;
73
+    echo $res;
74 74
 } else {
75
-  echo "FAILURE";
75
+    echo "FAILURE";
76 76
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 $remove = 0;
5 5
 $opn = $vlans = '';
6 6
 $guest_vlan = 0;
7
-if ( isset($_POST['enc'])  && $_POST['enc'] != '' && ($enc=base64_decode($_POST['enc'], true)) !== false ) {
7
+if (isset($_POST['enc']) && $_POST['enc'] != '' && ($enc = base64_decode($_POST['enc'], true)) !== false) {
8 8
 	$decrypted = openssl_decrypt($enc, "CHACHA20", SERVER_SECRET, 0, SERVER_IV);
9 9
 	if ($decrypted === false) {
10 10
           echo "FAILURE";
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	} 
19 19
 }
20 20
 # when a request contains logid and backlog ";s:11:"DEBUG-11-52";s:7:"backlog";s:1:"7";}
21
-if ( isset($darr['logid']) && isset($darr['backlog']) && isset($darr['iv']) ) {
21
+if (isset($darr['logid']) && isset($darr['backlog']) && isset($darr['iv'])) {
22 22
 	if (substr($darr['logid'], 0, 5) == 'DEBUG') {
23 23
           $logid = substr($darr['logid'], 6);
24 24
         }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	$cnt = 0;
28 28
 	if (substr($res, 0, strlen(ZIPDIR)) == ZIPDIR) {
29 29
 	    $content = file_get_contents($res);
30
-            $encrypted = openssl_encrypt(SERVER_TOKEN . $content, "CHACHA20", SERVER_SECRET, 0, $iv);
30
+            $encrypted = openssl_encrypt(SERVER_TOKEN.$content, "CHACHA20", SERVER_SECRET, 0, $iv);
31 31
 	    header('Content-Type: application/octet-stream');
32 32
             header("Content-Transfer-Encoding: binary");
33 33
 	    echo "ZIPDATA:$encrypted";
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     }
53 53
     if (isset($darr['vlan']) && isset($darr['realmforvlan']) &&
54 54
         is_array($darr['realmforvlan'])) {
55
-      $vlans = $darr['vlan'] . '#' . implode('#', $darr['realmforvlan']);
55
+      $vlans = $darr['vlan'].'#'.implode('#', $darr['realmforvlan']);
56 56
     }
57 57
     if (isset($darr['guest_vlan'])) {
58 58
       $guest_vlan = $darr['guest_vlan'];
Please login to merge, or discard this patch.
utils/Update_eduroamDB1_2/update_monitor_copy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  * update the local copy
25 25
  */
26 26
 
27
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
27
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
28 28
 setlocale(LC_CTYPE, "en_US.UTF-8");
29 29
 require 'config.php';
30 30
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->db_ext->query("SET NAMES 'utf8'");
114 114
         $this->db_local->query("SET NAMES 'utf8mb4'");
115 115
         $result = $this->db_ext->query("SELECT * FROM $table");
116
-        $queryFields = implode(',', array_column($this->fields[$db][$table_name],0));
116
+        $queryFields = implode(',', array_column($this->fields[$db][$table_name], 0));
117 117
         while ($row = $result->fetch_assoc()) {
118 118
             $v = [];
119 119
             foreach ($this->fields[$db][$table_name] as $field) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                     }
132 132
                 }
133 133
             }
134
-            $queryValues = implode(',',$v);
134
+            $queryValues = implode(',', $v);
135 135
             $query = "INSERT INTO $tmpTable (".$queryFields.") VALUES (".$queryValues.")";
136 136
             $this->db_local->query($query);
137 137
         }
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
             $realms = explode(',', $row[1]);
154 154
             foreach ($contacts as $contact) {
155 155
                 foreach ($realms as $realm) {
156
-                    $email = empty($contact['mail']) ? 'NULL' :'"'.$contact['mail'].'"';
157
-                    $name = empty($contact['name']) ? 'NULL' :'"'.$contact['name'].'"';
158
-                    $phone = empty($contact['phone']) ? 'NULL' :'"'.$contact['phone'].'"';
156
+                    $email = empty($contact['mail']) ? 'NULL' : '"'.$contact['mail'].'"';
157
+                    $name = empty($contact['name']) ? 'NULL' : '"'.$contact['name'].'"';
158
+                    $phone = empty($contact['phone']) ? 'NULL' : '"'.$contact['phone'].'"';
159 159
                     $id = $db == 'eduroam' ? $row[2] : '"'.$row[2].'"';
160 160
                     $query = "INSERT INTO tmp_institution_admins (name, email, phone, inst_realm, $instid)"
161 161
                             . ' VALUES ('.$name.','.$email.','.$phone.',"'.$realm.'",'.$id.')';
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
     }
176 176
 
177 177
     private function escape($inp) {
178
-        $out=str_replace('\\','\\\\',$inp);
179
-        $out=str_replace('"','\"',$out);
180
-        $out=str_replace('?','\?',$out);
178
+        $out = str_replace('\\', '\\\\', $inp);
179
+        $out = str_replace('"', '\"', $out);
180
+        $out = str_replace('?', '\?', $out);
181 181
         $out = 'convert(cast(convert("'.$out.'" using latin1) as binary) using utf8)';
182 182
         return($out);
183 183
     }
Please login to merge, or discard this patch.
utils/Update_eduroamDB1_2/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 $databases = [
4 4
     'eduroam' => "eduroam1_1_tmp", // this is the local copy of eduroam (v1) database created by update_monitor_copy.php
5 5
     'eduroamv2' => "eduroam2_1_tmp", // this is the local copy of eduroam (v2) database created by update_monitor_copy.php
6
-    'cat' => "cat_twoln_214_test2",  // this is the curent production CAT database where we need to put in new identifiers
6
+    'cat' => "cat_twoln_214_test2", // this is the curent production CAT database where we need to put in new identifiers
7 7
     'eduroam_new' => "monitor_copy2_test_xxx" // this is the resulting monitor_copy database containing all data required by CAT it must exist but tables will be created by the sript
8 8
 ];
9 9
 
Please login to merge, or discard this patch.
utils/Update_eduroamDB1_2/clean_databases.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
3
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
4 4
 setlocale(LC_CTYPE, "en_US.UTF-8");
5 5
 require 'config.php';
6 6
 
Please login to merge, or discard this patch.
utils/Update_eduroamDB1_2/sync_databases.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
  * 
9 9
  */
10 10
 
11
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
11
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
12 12
 setlocale(LC_CTYPE, "en_US.UTF-8");
13 13
 require 'config.php';
14 14
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 // add CAT ids to view_active_institution2
132 132
 print "add CAT ids to view_active_institution2\n";
133
-$q ="update view_active_institution2 join view_active_institution1
133
+$q = "update view_active_institution2 join view_active_institution1
134 134
         on view_active_institution2.instid1=view_active_institution1.id_institution
135 135
         set view_active_institution2.cat_sync_id=view_active_institution1.cat_sync_id";
136 136
 $result = $db_local->query($q);
Please login to merge, or discard this patch.