Test Setup Failed
Push — master ( a0e404...64401d )
by Tomasz
10:27
created
web/admin/overview_sp.php 2 patches
Indentation   +14 added lines, -14 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
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
                         if ($deploymentObject->radsec_cert != NULL) {
344 344
                             echo "<i>";
345 345
                             echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
346
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
346
+                                    _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
347 347
                         
348 348
                             echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
349 349
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                         <td>
363 363
                             <?php printf(_("PSK Identity: %s"), "<span id='pskid_data_$depId'>SP".$depId.'-'.$deploymentObject->institution.'</span>');
364 364
                             echo copyIcon("pskid_icon_$depId");
365
-                           ?>
365
+                            ?>
366 366
                             <br>
367 367
                             <?php printf(_("PSK hexphrase: %s"), "<span id='pskkey_data_$depId'>".$deploymentObject->pskkey."</span>");
368 368
                             echo copyIcon("pskkey_icon_$depId");
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
             <h1><?php echo $tablecaption; ?></h1>
551 551
             <h2><?php echo _("5 most recent authentications");?></h2>
552 552
             <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
553
-                     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>
553
+                        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>
554 554
             <table class='authrecord'>
555 555
     <caption><?php echo $tablecaption;?></caption>
556 556
     <tr style='text-align: left;'>
@@ -571,9 +571,9 @@  discard block
 block discarded – undo
571 571
                 . "<td>".$oneRecord['outer_user']."</td>"
572 572
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
573 573
                 . "<td>".$oneRecord['mac']."</td>"
574
-		. "<td>".substr($oneRecord['cui'], 0, 18)
575
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
576
-	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
574
+        . "<td>".substr($oneRecord['cui'], 0, 18)
575
+        . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
576
+            . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
577 577
                 . "<td>".$oneRecord['ap_id']."</td>"
578 578
                 . "<td>".$oneRecord['prot']."</td>"
579 579
                 . "</tr>";
@@ -630,9 +630,9 @@  discard block
 block discarded – undo
630 630
     foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) {
631 631
         $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']);
632 632
         if (is_resource($connection)) {
633
-           fclose($connection);
633
+            fclose($connection);
634 634
         } else {
635
-           return false;
635
+            return false;
636 636
         }
637 637
     }
638 638
     return true;
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                             </button>
655 655
                             <span style='color: red;'>
656 656
                             <?php if ($hasMail == 0) { 
657
-                              echo _("Helpdesk mail address is required but missing!");  
657
+                                echo _("Helpdesk mail address is required but missing!");  
658 658
                             }
659 659
                             ?>
660 660
                             </span>
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 <?php
98 98
 function copyIcon($target) {
99
-    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'. _("Copy to clipboard").'" >';
99
+    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'._("Copy to clipboard").'" >';
100 100
 }
101 101
 
102 102
 /**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
  * @param \core\DeploymentManaged $deploymentObject the deployment to work with
106 106
  * @throws Exception
107 107
  */
108
-function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg=[]) {
108
+function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg = []) {
109 109
     // RADIUS status icons
110 110
     $depId = $deploymentObject->identifier;
111 111
     $radiusMessages = [
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     $radius_status = array();
116 116
     $radius_status[0] = $deploymentObject->radius_status_1;
117 117
     $radius_status[1] = $deploymentObject->radius_status_2;
118
-    $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
118
+    $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
119 119
     $retry = $deploymentObject->checkRADIUSHostandConfigDaemon();
120 120
     $isradiusready = radius_ready($deploymentObject);
121 121
     if (is_array($retry)) {
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
     }
128 128
     ?>
129 129
     <div style='display: table-row_id;'>
130
-        <div class='profilebox' id="profilebox_<?php echo $depId;?>" style='display: table-cell;'>
130
+        <div class='profilebox' id="profilebox_<?php echo $depId; ?>" style='display: table-cell;'>
131 131
             <h2><?php
132 132
                 switch ($deploymentObject->consortium) {
133 133
                     case "eduroam":
134
-                        $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME. ": SP$depId-".$deploymentObject->institution;
134
+                        $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME.": SP$depId-".$deploymentObject->institution;
135 135
                         break;
136 136
                     case "OpenRoaming":
137 137
                         $displayname = "OpenRoaming ANP";
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     default:
140 140
                         throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
141 141
                 }
142
-                echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
142
+                echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
143 143
                 ?></h2>
144 144
             <table class="deployments">
145 145
                 <caption><?php echo _("Deployment Details"); ?></caption>
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
                     <td>
173 173
                         <?php
174 174
                         if ($deploymentObject->status) {
175
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
176
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
177
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
175
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
176
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
177
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
178 178
                         }
179 179
                         ?>
180 180
                     </td>
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
                     <td>
205 205
                         <?php
206 206
                         if ($deploymentObject->status) {
207
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
208
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
209
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
207
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
208
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
209
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
210 210
                         }
211 211
                         ?>
212 212
                     </td>
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                 <tr style="vertical-align:bottom">
215 215
                     <td><?php echo _("RADIUS shared secret for both servers"); ?></td>
216 216
                     <td>
217
-                        <span id="shared_data_<?php echo $deploymentObject->identifier;?>"><?php echo $deploymentObject->secret;?></span>
217
+                        <span id="shared_data_<?php echo $deploymentObject->identifier; ?>"><?php echo $deploymentObject->secret; ?></span>
218 218
                         <?php echo copyIcon("shared_icon_".$deploymentObject->identifier) ?>
219 219
                     </td>
220 220
                     <td></td>
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
                     <td>
251 251
                         <?php
252 252
                         if ($deploymentObject->status) {
253
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
254
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
255
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
253
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
254
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
255
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
256 256
                         }
257 257
                         ?>
258 258
                     </td>
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
                     <td>
283 283
                         <?php
284 284
                         if ($deploymentObject->status) {
285
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
286
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
287
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
285
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
286
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
287
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
288 288
                         }
289 289
                         ?>
290 290
                     </td>
@@ -300,27 +300,27 @@  discard block
 block discarded – undo
300 300
                     <td>
301 301
                     <?php
302 302
                     if ($deploymentObject->radsec_priv == '') {
303
-                        echo _('The client certificate was created using an uploaded CSR, the private key is not available') . '<br><br>';
303
+                        echo _('The client certificate was created using an uploaded CSR, the private key is not available').'<br><br>';
304 304
                     }
305
-                    echo _('Subject:') . ' ' . $data['name'] . '<br>';
306
-                    echo _('Serial number:') . ' ' . $data['serialNumberHex'] . '<br>';
307
-                    $dleft = floor(($data['validTo_time_t']-time())/(24*60*60));
305
+                    echo _('Subject:').' '.$data['name'].'<br>';
306
+                    echo _('Serial number:').' '.$data['serialNumberHex'].'<br>';
307
+                    $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60));
308 308
                     if ($dleft < 30) {
309 309
                         echo '<font color="red">';
310 310
                     }
311
-                    echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC';
311
+                    echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC';
312 312
                     if ($dleft > 2) {
313
-                        echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft;
313
+                        echo '<br>'._('Number of days to expiry:').' '.$dleft;
314 314
                     } else {
315
-                        echo '<br>' . _('If you are using RADIUS over TLS you should urgently renew your credentisls') . '!';
315
+                        echo '<br>'._('If you are using RADIUS over TLS you should urgently renew your credentisls').'!';
316 316
                     }
317 317
                     if ($dleft < 30) { echo '</font>'; }
318 318
                     ?></td>
319 319
                 </tr><tr><td></td>
320 320
 
321 321
                     <td>
322
-                        <span style="display: none;" id="cert_data_<?php echo $depId;?>"><?php echo $deploymentObject->radsec_cert;?></span>
323
-                        <span style="display: none;" id="ca_cert_data_<?php echo $depId;?>"><?php echo $cacert;?></span>
322
+                        <span style="display: none;" id="cert_data_<?php echo $depId; ?>"><?php echo $deploymentObject->radsec_cert; ?></span>
323
+                        <span style="display: none;" id="ca_cert_data_<?php echo $depId; ?>"><?php echo $cacert; ?></span>
324 324
                         <?php if ($deploymentObject->radsec_priv != '') {
325 325
                             echo _("private key:").copyIcon("priv_key_icon_$depId");
326 326
                             echo '<span style="display: none;" id="priv_key_data_'.$depId.'">'.$deploymentObject->radsec_priv.'</span>';
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                             echo _("CA certificate:").copyIcon("ca_cert_icon_$depId");
332 332
                         ?>
333 333
                         <br/>
334
-                        <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
+                        <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>
335 335
 
336 336
                     </td>
337 337
                     <td></td>
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
                     <?php
343 343
                         if ($deploymentObject->radsec_cert != NULL) {
344 344
                             echo "<i>";
345
-                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
346
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
345
+                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials').'<br>'.
346
+                                 _('click on "Renew RADIUS over TLS credentials" button').'<br>';
347 347
                         
348
-                            echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
348
+                            echo '<br/>'._('You can upload your own CSR to replace default TLS credentials.').'<br>'. 
349 349
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
350 350
                             echo "</i>";
351 351
                     }
@@ -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
@@ -445,12 +445,12 @@  discard block
 block discarded – undo
445 445
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
446 446
                                 echo '<br>';
447 447
                                 if ($res['FAILURE'] == 2) {
448
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
448
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
449 449
                                 } else {
450 450
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
451
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
451
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
452 452
                                     } else {
453
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
453
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
454 454
                                     }
455 455
                                 }
456 456
                             }
@@ -477,12 +477,12 @@  discard block
 block discarded – undo
477 477
                                 if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
478 478
                                     echo '<br>';
479 479
                                     if ($res['FAILURE'] == 2) {
480
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
480
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
481 481
                                     } else {
482 482
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
483
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
483
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
484 484
                                         } else {
485
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
485
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
486 486
                                         }
487 487
                                     }
488 488
                                 }
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
             </div>
531 531
             <?php 
532 532
             if (!$isradiusready) { 
533
-                echo '<p>'. _("We are not able to handle a new configuration request requiring contact with RADIUS servers now.") . '<br>' . _("Check later.");
533
+                echo '<p>'._("We are not able to handle a new configuration request requiring contact with RADIUS servers now.").'<br>'._("Check later.");
534 534
                 
535 535
             } 
536 536
             if (count($errormsg) > 0 && array_key_exists($deploymentObject->identifier, $errormsg)) {
@@ -546,38 +546,38 @@  discard block
 block discarded – undo
546 546
         </div>
547 547
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
548 548
         <div style='display: table-cell; min-width:200px;'>
549
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
549
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
550 550
             <h1><?php echo $tablecaption; ?></h1>
551
-            <h2><?php echo _("5 most recent authentications");?></h2>
552
-            <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
551
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
552
+            <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id").'<br>';
553 553
                      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>
554 554
             <table class='authrecord'>
555
-    <caption><?php echo $tablecaption;?></caption>
555
+    <caption><?php echo $tablecaption; ?></caption>
556 556
     <tr style='text-align: left;'>
557
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
558
-        <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th>
559
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
560
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
561
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> 
562
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
563
-        <th scope="col"><strong><?php echo _("Protocol");?></strong></th>
557
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
558
+        <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th>
559
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
560
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
561
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> 
562
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
563
+        <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th>
564 564
     </tr>
565 565
     <?php
566
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
566
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
567 567
     $i = 0;	   
568 568
     foreach ($userAuthData as $oneRecord) {
569
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
569
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
570 570
                 . "<td>".$oneRecord['activity_time']."</td>"
571 571
                 . "<td>".$oneRecord['outer_user']."</td>"
572 572
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
573 573
                 . "<td>".$oneRecord['mac']."</td>"
574 574
 		. "<td>".substr($oneRecord['cui'], 0, 18)
575
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
575
+		. ($oneRecord['cui'] == '' ? "" : "... ".copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
576 576
 	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
577 577
                 . "<td>".$oneRecord['ap_id']."</td>"
578 578
                 . "<td>".$oneRecord['prot']."</td>"
579 579
                 . "</tr>";
580
-        if ($oneRecord['cui']!='') {
580
+        if ($oneRecord['cui'] != '') {
581 581
             $i++;
582 582
         }
583 583
     }
@@ -599,11 +599,11 @@  discard block
 block discarded – undo
599 599
             echo _('Get statistics as CSV file:').' '; 
600 600
             $query = 'inc/deploymentStats.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&as=csv&backlog=";
601 601
             ?>
602
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>WEEK';"><?php echo _('Last week');?>
602
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>WEEK';"><?php echo _('Last week'); ?>
603 603
             </button>
604
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>MONTH';"><?php echo _('Last 30 days');?>
604
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>MONTH';"><?php echo _('Last 30 days'); ?>
605 605
             </button>
606
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>FULL';"><?php echo _('Last 6 months');?>
606
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>FULL';"><?php echo _('Last 6 months'); ?>
607 607
             </button>
608 608
         </div><!-- statistics space -->
609 609
     </div> 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
                         <div>
651 651
                             <input type="hidden" name="consortium" value="eduroam"/>
652 652
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
653
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
653
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
654 654
                             </button>
655 655
                             <span style='color: red;'>
656 656
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.
web/admin/overview_org.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  */
29 29
 ?>
30 30
 <?php
31
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
31
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
32 32
 
33 33
 function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
34 34
     ?>
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
                 <ul style='margin:1px'>
46 46
                     <?php
47 47
                     foreach ($completeness as $missing_attrib) {
48
-                        echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
48
+                        echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
49 49
                     }
50 50
                     ?>
51 51
                 </ul>
52 52
             </div>
53 53
             <?php
54 54
         } else {
55
-            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
55
+            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
56 56
         }
57 57
         ?>
58 58
         <br/>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         if ($readonly === FALSE) {
62 62
             ?>
63 63
             <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&amp;profile_id=<?php echo $theProfile->identifier; ?>' method='POST'>
64
-                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
64
+                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
65 65
             </form>
66 66
             <?php
67 67
         }
@@ -97,21 +97,21 @@  discard block
 block discarded – undo
97 97
                 $has_overrides = TRUE;
98 98
             }
99 99
         }
100
-        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
100
+        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
101 101
         $typelist = $theProfile->getEapMethodsinOrderOfPreference();
102 102
         $allcomplete = TRUE;
103 103
         foreach ($typelist as $eaptype) {
104 104
             $buffer_eaptypediv .= $eaptype->getPrintableRep();
105 105
             $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype);
106 106
             if ($completeness === true) {
107
-                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
107
+                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
108 108
             } else {
109 109
                 $buffer_eaptypediv .= " <div class='notacceptable'>";
110 110
                 $buffer_eaptypediv .= _("Information needed!");
111 111
                 if (is_array($completeness)) {
112 112
                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
113 113
                     foreach ($completeness as $missing_attrib) {
114
-                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
114
+                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
115 115
                     }
116 116
                     $buffer_eaptypediv .= "</ul>";
117 117
                 }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             foreach ($attribs as $attrib) {
124 124
                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
125 125
                     $justOnce = TRUE;
126
-                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
126
+                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
127 127
                 }
128 128
             }
129 129
             $buffer_eaptypediv .= "<br/>";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         if ($theProfile->isRedirected()) {
150 150
             $iconData = $uiElements->iconData('PROFILES_REDIRECTED');
151 151
             $iconData['text'] = _("Profile redirected");
152
-            $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
152
+            $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
153 153
             
154 154
         } 
155 155
         
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
         switch ($certStatus) {
158 158
             case core\AbstractProfile::CERT_STATUS_OK:
159 159
                 $iconData = $uiElements->iconData('CERT_STATUS_OK');
160
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
160
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
161 161
                 break;
162 162
             case core\AbstractProfile::CERT_STATUS_WARN:
163 163
                 $iconData = $uiElements->iconData('CERT_STATUS_WARN');
164
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));                
164
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));                
165 165
                 break;
166 166
             case core\AbstractProfile::CERT_STATUS_ERROR:
167 167
                 $iconData = $uiElements->iconData('CERT_STATUS_ERROR');
168
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
168
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
169 169
                 break;            
170 170
         }
171 171
         $buffer_headline .= "</div>";
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
192 192
                     $diagUrl = "../diag/";
193 193
                 } else {
194
-                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
194
+                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
195 195
                 }
196 196
                 ?>
197
-                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
198
-                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/>
197
+                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
198
+                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/>
199 199
                     <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'>
200 200
                         <?php echo _("Check realm reachability"); ?>
201 201
                     </button>
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
                 ?>
243 243
                 <div style='display: flex;'>
244 244
                     <?php
245
-                    $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution;
246
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $theProfile->identifier;
247
-                    $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier;
245
+                    $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution;
246
+                    $displayurl = $idpLevelUrl."&amp;profile=".$theProfile->identifier;
247
+                    $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier;
248 248
                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
249 249
                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
250 250
                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
                     if (empty($rawQr)) {
257 257
                         throw new Exception("Something went seriously wrong during QR code generation!");
258 258
                     }
259
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
259
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
260 260
                     $size = getimagesize($uri);
261
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
261
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
262 262
 
263 263
                     //echo "<nobr>$displayurl</nobr></a>";
264 264
                     echo "<p>$displayurl</p></a>";
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
             }
424 424
             ?>
425 425
         </h2>
426
-        <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
426
+        <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
427 427
                     <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'>
428 428
                         <div>
429 429
                             <button type='submit' name='profile_sorting'>
Please login to merge, or discard this patch.
web/admin/edit_federation.php 1 patch
Spacing   +11 added lines, -11 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();
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
         ?>
80 80
     </h1>
81 81
     <div class='infobox'>
82
-        <h2><?php $tablecaption = sprintf(_("%s Properties"),$uiElements->nomenclatureFed); echo $tablecaption?></h2>
82
+        <h2><?php $tablecaption = sprintf(_("%s Properties"), $uiElements->nomenclatureFed); echo $tablecaption?></h2>
83 83
         <table>
84
-            <caption><?php echo $tablecaption;?></caption>
84
+            <caption><?php echo $tablecaption; ?></caption>
85 85
             <tr>
86
-                <th class="wai-invisible" scope="col"><?php echo _("Property Type");?></th>
87
-                <th class="wai-invisible" scope="col"><?php echo _("Language if applicable");?></th>
88
-                <th class="wai-invisible" scope="col"><?php echo _("Property Value");?></th>
86
+                <th class="wai-invisible" scope="col"><?php echo _("Property Type"); ?></th>
87
+                <th class="wai-invisible" scope="col"><?php echo _("Language if applicable"); ?></th>
88
+                <th class="wai-invisible" scope="col"><?php echo _("Property Value"); ?></th>
89 89
             </tr>
90 90
             <tr>
91 91
                 <td><?php echo _("Country:"); ?></td>
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
         </table>
97 97
     </div>
98 98
     <?php
99
-    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld" . "' method='post' accept-charset='UTF-8'>
100
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
99
+    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld"."' method='post' accept-charset='UTF-8'>
100
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE."'>";
101 101
     ?>
102 102
     <fieldset class="option_container">
103
-        <legend><strong><?php echo sprintf(_("%s Properties"),$uiElements->nomenclatureFed); ?></strong></legend>
103
+        <legend><strong><?php echo sprintf(_("%s Properties"), $uiElements->nomenclatureFed); ?></strong></legend>
104 104
         <?php
105 105
         $options = [
106 106
             'level' => 'fed',
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
     <?php
116 116
     echo "<div>";
117 117
     if ($editMode === 'fullaccess') {
118
-        echo "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button>";
118
+        echo "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button>";
119 119
         $discardLabel = _("Discard changes");
120 120
     } else {
121 121
         $discardLabel = _("Return");
122 122
     }
123
-    echo "<button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php?fed_id=$fedPost\"'>" . $discardLabel . "</button></div></form>";
123
+    echo "<button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php?fed_id=$fedPost\"'>".$discardLabel."</button></div></form>";
124 124
     echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/inc/toggleRedirect.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $loggerInstance = new \core\common\Logging();
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $remaining_attribs = $my_profile->beginFlushMethodLevelAttributes($eaptype->getIntegerRep(), NULL);
91 91
         $optionParser->processSubmittedFields($my_profile, $_POST, $_FILES, $eaptype->getIntegerRep(), NULL);
92 92
     }
93
-    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $my_profile->identifier . " - device/EAP-Type settings changed");
93
+    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$my_profile->identifier." - device/EAP-Type settings changed");
94 94
     header("Location: ../overview_installers.php?inst_id=$my_inst->identifier&profile_id=$my_profile->identifier");
95 95
     exit;
96 96
 }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     }
105 105
     $captiontext = sprintf(_("device <strong>%s</strong>"), $device['display']);
106 106
     $keyword = "device-specific";
107
-    $extrainput = "<input type='hidden' name='device' value='" . $device_key . "'/>";
107
+    $extrainput = "<input type='hidden' name='device' value='".$device_key."'/>";
108 108
     $dev = $device_key;
109 109
 } elseif ($eaptype !== NULL) {
110 110
     foreach ($my_profile->getAttributes() as $attrib) {
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 
116 116
     $captiontext = sprintf(_("EAP-Type <strong>%s</strong>"), $eaptype->getPrintableRep());
117 117
     $keyword = "eap-specific";
118
-    $extrainput = "<input type='hidden' name='eaptype' value='" . $eaptype->getIntegerRep() . "'>";
118
+    $extrainput = "<input type='hidden' name='eaptype' value='".$eaptype->getIntegerRep()."'>";
119 119
     $dev = '';
120 120
 } else {
121 121
     throw new Exception("previous type checks make it impossible to reach this code path.");
122 122
 }
123 123
 ?>
124
-<p><?php echo _("Fine-tuning options for ") . $captiontext; ?></p>
124
+<p><?php echo _("Fine-tuning options for ").$captiontext; ?></p>
125 125
 <hr/>
126 126
 
127 127
 <form action='inc/toggleRedirect.inc.php?inst_id=<?php echo $my_inst->identifier; ?>&amp;profile_id=<?php echo $my_profile->identifier; ?>' method='post' accept-charset='UTF-8'><?php echo $extrainput; ?>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 // see if we already have any attributes; if so, display these
130 130
     $interesting_attribs = [];
131 131
     foreach ($attribs as $attrib) {
132
-        if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^' . $keyword . ':/', $attrib['name'])) {
132
+        if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^'.$keyword.':/', $attrib['name'])) {
133 133
             $interesting_attribs[] = $attrib;
134 134
         }
135 135
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     if (\config\Master::DB['INST']['readonly'] === FALSE) {
139 139
         if ($editMode == 'fullaccess') {
140 140
         ?>
141
-        <button type='button' class='newoption' onclick='getXML("<?php echo $keyword;?>", "<?php echo $my_inst->federation;?>")'><?php echo _("Add new option"); ?></button>
141
+        <button type='button' class='newoption' onclick='getXML("<?php echo $keyword; ?>", "<?php echo $my_inst->federation; ?>")'><?php echo _("Add new option"); ?></button>
142 142
         <br/>
143 143
         <hr/>
144 144
         <button type='submit' name='submitbutton' id='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_SAVE; ?>'><?php echo _("Save data"); ?></button>
Please login to merge, or discard this patch.
web/admin/inc/sendZip.inc.php 2 patches
Indentation   +21 added lines, -21 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 pack and send RADSEC credentials.
25
- * 
26
- * @author Maja Gorecka-Wolniewicz <[email protected]>
27
- */
23
+    /**
24
+     * This file is used to pack and send RADSEC credentials.
25
+     * 
26
+     * @author Maja Gorecka-Wolniewicz <[email protected]>
27
+     */
28 28
 ?>
29 29
 <?php
30 30
 
@@ -36,26 +36,26 @@  discard block
 block discarded – undo
36 36
 if ($editMode == 'fullaccess') {
37 37
     $hotspotProfiles = $my_inst->listDeployments();
38 38
     if (count($hotspotProfiles) > 0) { // no profiles yet.
39
-       foreach ($hotspotProfiles as $counter => $deploymentObject) {
40
-           if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
-               $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
42
-               $zip = new ZipArchive;
43
-               $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44
-               if ($deploymentObject->radsec_priv != '') {
39
+        foreach ($hotspotProfiles as $counter => $deploymentObject) {
40
+            if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
+                $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
42
+                $zip = new ZipArchive;
43
+                $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44
+                if ($deploymentObject->radsec_priv != '') {
45 45
                     $zip->addFromString('priv.key', $deploymentObject->radsec_priv);
46
-               }
47
-               $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48
-               $zip->addFromString('ca.pem', $cacert);
49
-               $zip->close();
50
-               $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
-               unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
52
-               if ($data !== FALSE) {
46
+                }
47
+                $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48
+                $zip->addFromString('ca.pem', $cacert);
49
+                $zip->close();
50
+                $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
+                unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
52
+                if ($data !== FALSE) {
53 53
                     header('Content-Type: application/zip');
54 54
                     header("Content-Disposition: attachment; filename=\"full_".$deploymentObject->identifier.".zip\"");
55 55
                     header("Content-Transfer-Encoding: binary");
56 56
                     echo $data;
57
-               }
58
-           }
59
-       }
57
+                }
58
+            }
59
+        }
60 60
     }
61 61
 }
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 ?>
29 29
 <?php
30 30
 
31
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
31
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
32 32
 $auth = new \web\lib\admin\Authentication();
33 33
 $auth->authenticate();
34 34
 $validator = new \web\lib\common\InputValidation();
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
     if (count($hotspotProfiles) > 0) { // no profiles yet.
39 39
        foreach ($hotspotProfiles as $counter => $deploymentObject) {
40 40
            if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
-               $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
41
+               $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
42 42
                $zip = new ZipArchive;
43
-               $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
43
+               $zip->open(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44 44
                if ($deploymentObject->radsec_priv != '') {
45 45
                     $zip->addFromString('priv.key', $deploymentObject->radsec_priv);
46 46
                }
47 47
                $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48 48
                $zip->addFromString('ca.pem', $cacert);
49 49
                $zip->close();
50
-               $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
-               unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
50
+               $data = file_get_contents(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip');
51
+               unlink(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip');
52 52
                if ($data !== FALSE) {
53 53
                     header('Content-Type: application/zip');
54 54
                     header("Content-Disposition: attachment; filename=\"full_".$deploymentObject->identifier.".zip\"");
Please login to merge, or discard this patch.
web/admin/inc/manageNewInst.inc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 ?>
22 22
 <?php
23
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $uiElements = new \web\lib\admin\UIElements();
@@ -57,30 +57,30 @@  discard block
 block discarded – undo
57 57
 <?php
58 58
 echo sprintf(_("On this page, you can add a new %s to your %s. Please fill out the form below to send out an email invitation to the new %s administrator."), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant);
59 59
 if (\config\Master::DB['enforce-external-sync']) {
60
-    echo "<p>" . sprintf(_("You can either register a known %s (as defined in the %s database) or create a totally new %s."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant) . "</p>";
61
-    echo "<p>" . sprintf(_("The latter one is typically for an %s which is yet in a testing phase and therefore doesn't appear in the %s database yet."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";    
60
+    echo "<p>".sprintf(_("You can either register a known %s (as defined in the %s database) or create a totally new %s."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant)."</p>";
61
+    echo "<p>".sprintf(_("The latter one is typically for an %s which is yet in a testing phase and therefore doesn't appear in the %s database yet."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";    
62 62
 }
63 63
 ?>
64 64
 <hr/>
65 65
 <img alt='Loading ...' src='../resources/images/icons/loading51.gif' id='spin' style='position:absolute;left: 50%; top: 50%; transform: translate(-100px, -50px); display:none;'>
66 66
 <form name='sendinvite' action='inc/sendinvite.inc.php' method='post' accept-charset='UTF-8'>
67 67
     <table>
68
-            <caption><?php echo _("Invitation Details");?></caption>
68
+            <caption><?php echo _("Invitation Details"); ?></caption>
69 69
             <tr>
70
-                <th class="wai-invisible" scope="col"><?php echo _("From database or ad-hoc?");?></th>
71
-                <th class="wai-invisible" scope="col"><?php echo _("Name");?></th>
72
-                <th class="wai-invisible" scope="col"><?php echo _("Type");?></th>
73
-                <th class="wai-invisible" scope="col"><?php echo _("Country");?></th>
70
+                <th class="wai-invisible" scope="col"><?php echo _("From database or ad-hoc?"); ?></th>
71
+                <th class="wai-invisible" scope="col"><?php echo _("Name"); ?></th>
72
+                <th class="wai-invisible" scope="col"><?php echo _("Type"); ?></th>
73
+                <th class="wai-invisible" scope="col"><?php echo _("Country"); ?></th>
74 74
             </tr>
75 75
         <?php
76 76
         if (\config\Master::DB['enforce-external-sync']) {
77 77
             echo "<tr><td>
78
-                <input type='radio' name='creation' value='existing'>" . sprintf(_("Existing %s:"), $uiElements->nomenclatureParticipant) . "</input>
78
+                <input type='radio' name='creation' value='existing'>" . sprintf(_("Existing %s:"), $uiElements->nomenclatureParticipant)."</input>
79 79
                      </td>";
80 80
 
81 81
             echo "<td colspan='3'>
82 82
                 <select id='externals' name='externals' onchange='document.sendinvite.creation[0].checked=true; document.sendinvite.mailaddr.value=this.options[this.selectedIndex].id;'>
83
-                    <option value='FREETEXT'>" . sprintf(_("--- select %s here ---"),$uiElements->nomenclatureParticipant) . "</option>";
83
+                    <option value='FREETEXT'>" . sprintf(_("--- select %s here ---"), $uiElements->nomenclatureParticipant)."</option>";
84 84
 
85 85
             foreach ($feds as $fed_value) {
86 86
                 $thefed = new \core\Federation(strtoupper($fed_value['value']));
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 $entities = $thefed->listExternalEntities(TRUE, NULL);
90 90
 
91 91
                 foreach ($entities as $v) {
92
-                    echo "<option id='" . $v['contactlist'] . "' value='" . $fed_value['value']. '-' . $v['ID'] . "'>[" . $fed_value['value'] . "] " . $v['name'] . "</option>";
92
+                    echo "<option id='".$v['contactlist']."' value='".$fed_value['value'].'-'.$v['ID']."'>[".$fed_value['value']."] ".$v['name']."</option>";
93 93
                 }
94 94
             }
95 95
 
@@ -98,19 +98,19 @@  discard block
 block discarded – undo
98 98
         ?>
99 99
         <tr>
100 100
             <td>
101
-                <input type='radio' name='creation' value='new'><?php echo sprintf(_("New %s"),$uiElements->nomenclatureParticipant); ?></input>
101
+                <input type='radio' name='creation' value='new'><?php echo sprintf(_("New %s"), $uiElements->nomenclatureParticipant); ?></input>
102 102
             </td>
103 103
             <td>
104 104
                 <?php echo _("Name"); ?> <input type='text' size='30' id='name' name='name' onchange='document.sendinvite.creation[1].checked = true'/>
105 105
             </td>
106 106
             <td>
107
-                <?php if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { ?>
107
+                <?php if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { ?>
108 108
                 &nbsp; <input type='hidden' name='participant_type' value='SP'>
109 109
                 <?php } else { ?>
110 110
                 <select name="participant_type">
111
-                    <option value="IdPSP" selected><?php printf(_("%s and %s"),$uiElements->nomenclatureIdP, $uiElements->nomenclatureHotspot)?></option>
112
-                    <option value="IdP"><?php printf(_("%s"),$uiElements->nomenclatureIdP)?></option>
113
-                    <option value="SP"><?php printf(_("%s"),$uiElements->nomenclatureHotspot)?></option>
111
+                    <option value="IdPSP" selected><?php printf(_("%s and %s"), $uiElements->nomenclatureIdP, $uiElements->nomenclatureHotspot)?></option>
112
+                    <option value="IdP"><?php printf(_("%s"), $uiElements->nomenclatureIdP)?></option>
113
+                    <option value="SP"><?php printf(_("%s"), $uiElements->nomenclatureHotspot)?></option>
114 114
                 </select>
115 115
                 <?php } ?>
116 116
             </td>
Please login to merge, or discard this patch.
web/admin/inc/manageAdmins.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 ?>
22 22
 <?php
23
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $languageInstance = new \core\common\Language();
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 default:
121 121
                     throw new Exception("Error: unknown encryption status of invitation!?!");
122 122
             }
123
-            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully."));
123
+            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully."));
124 124
             break;
125 125
         case "FAILURE":
126 126
             echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!"));
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 default:
141 141
                     throw new Exception("Error: unknown encryption status of invitation!?!");
142 142
             }
143
-            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success."));
143
+            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success."));
144 144
             break;
145 145
         case "INVALIDSYNTAX":
146 146
             echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!"));
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                 <?php echo $invite; ?>
193 193
             </td>
194 194
             <td>
195
-                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ); ?> accept-charset='UTF-8'>
195
+                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : ""); ?> accept-charset='UTF-8'>
196 196
                     <input type='hidden' name='admin_id' value='<?php echo $oneowner['ID']; ?>'></input>
197 197
                     <button type='submit' name='submitbutton' class='delete' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>'><?php echo _("Delete Administrator") ?></button>
198 198
                 </form>
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 $pending_invites = $mgmt->listPendingInvitations($my_inst->identifier);
217 217
 $loggerInstance->debug(4, "Displaying pending invitations for $my_inst->identifier.\n");
218 218
 if (count($pending_invites) > 0) {
219
-    echo "<strong>" . _("Pending invitations for this IdP") . "</strong>";
219
+    echo "<strong>"._("Pending invitations for this IdP")."</strong>";
220 220
     echo "<table>";
221 221
     foreach ($pending_invites as $invitee) {
222
-        echo "<tr><td>" . $invitee['mail'] . "</td><td>" . sprintf(_("(expires %s)"), $invitee['expiry']) . "</td></tr>";
222
+        echo "<tr><td>".$invitee['mail']."</td><td>".sprintf(_("(expires %s)"), $invitee['expiry'])."</td></tr>";
223 223
     }
224 224
     echo "</table>";
225 225
 }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
     if (!$is_admin_himself) {
243 243
         echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
244
-    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_TAKECONTROL . "'>" . sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant) . "</button>
244
+    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_TAKECONTROL."'>".sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant)."</button>
245 245
 </form>";
246 246
     }
247 247
 }
Please login to merge, or discard this patch.
web/admin/inc/deploymentStats.inc.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst);
21 21
     $format = '';
22 22
     if (isset($_GET['as']) && $_GET['as']=='csv') {
23
-    	$format = 'csv';
23
+        $format = 'csv';
24 24
     }
25 25
     if (!isset($_POST['stats'])) {
26 26
         $backlog = $_GET['backlog'];
@@ -47,25 +47,25 @@  discard block
 block discarded – undo
47 47
     
48 48
     $userAuthData = $deployment->retrieveStatistics($backlogTime);
49 49
     if ($format == 'csv') {
50
-	    header('Content-Type: text/csv');
50
+        header('Content-Type: text/csv');
51 51
             header('Content-Disposition: attachment; filename="backlog_'.$deployment->identifier.'_'.$backlog.'"');
52
-	    $fp = fopen('php://output', 'w');
53
-	    fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"),
54
-		          _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', '');
55
-	    foreach ($userAuthData as $oneRecord) {
56
-		    fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'],
57
-			    ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")),
58
-			    $oneRecord['mac'], $oneRecord['cui'],
59
-			    $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', '');
52
+        $fp = fopen('php://output', 'w');
53
+        fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"),
54
+                    _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', '');
55
+        foreach ($userAuthData as $oneRecord) {
56
+            fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'],
57
+                ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")),
58
+                $oneRecord['mac'], $oneRecord['cui'],
59
+                $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', '');
60 60
             }
61
-	    fclose($fp);
61
+        fclose($fp);
62 62
     } else {
63 63
     ?>
64 64
     
65 65
     <h1><?php $tablecaption = _("Deployment Usage Records"); echo $tablecaption; ?></h1>
66 66
     <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");
67
-             echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68
-       ?></p>
67
+                echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68
+        ?></p>
69 69
     <table class='authrecord'>
70 70
         <caption><?php echo $tablecaption;?></caption>
71 71
         <tr>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 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();
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 if ($editMode == 'fullaccess') {
20 20
     $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst);
21 21
     $format = '';
22
-    if (isset($_GET['as']) && $_GET['as']=='csv') {
22
+    if (isset($_GET['as']) && $_GET['as'] == 'csv') {
23 23
     	$format = 'csv';
24 24
     }
25 25
     if (!isset($_POST['stats'])) {
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
              echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68 68
        ?></p>
69 69
     <table class='authrecord'>
70
-        <caption><?php echo $tablecaption;?></caption>
70
+        <caption><?php echo $tablecaption; ?></caption>
71 71
         <tr>
72
-            <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
73
-            <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th>
74
-            <th scope="col"><strong><?php echo _("Result");?></strong></th>
75
-            <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
76
-            <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th>    
77
-            <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
78
-            <th scope="col"><strong><?php echo _("Protocol");?></strong></th>
72
+            <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
73
+            <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th>
74
+            <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
75
+            <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
76
+            <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th>    
77
+            <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
78
+            <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th>
79 79
         </tr>
80 80
         <?php
81 81
         foreach ($userAuthData as $oneRecord) {    
82
-            echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
82
+            echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
83 83
                     . "<td>".$oneRecord['activity_time']."</td>"
84 84
                     // $oneRecord['CN'] is a simple string, not an array, so disable Scrutinizer type check here
85 85
                     . "<td>".$oneRecord['outer_user']."</td>"
Please login to merge, or discard this patch.
web/admin/inc/option_xhr.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
23 23
 
24 24
 \core\CAT::sessionStart();
25 25
 $validator = new \web\lib\common\InputValidation();
26 26
 
27
-if (!isset($_GET["class"] )) {
27
+if (!isset($_GET["class"])) {
28 28
     throw new Exception("Unknown type of option!");
29 29
 }
30 30
 
@@ -42,6 +42,6 @@  discard block
 block discarded – undo
42 42
 
43 43
 // add one option of the specified class
44 44
 
45
-$list = \web\lib\admin\OptionDisplay::enumerateOptionsToDisplay($_GET["class"], $_GET['fedid'], (isset($_GET["device"])?$_GET["device"]:NULL));
45
+$list = \web\lib\admin\OptionDisplay::enumerateOptionsToDisplay($_GET["class"], $_GET['fedid'], (isset($_GET["device"]) ? $_GET["device"] : NULL));
46 46
 $optionDisplay = new \web\lib\admin\OptionDisplay($list);
47 47
 echo $optionDisplay->optiontext(array_values($list));
Please login to merge, or discard this patch.