Passed
Push — master ( 051646...70edc1 )
by Tomasz
13:02 queued 17s
created
web/admin/overview_sp.php 1 patch
Spacing   +63 added lines, -63 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) {
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) {
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,12 +626,12 @@  discard block
 block discarded – undo
626 626
             <h2><?php echo _('To get detailed logs from RADIUS sites click a button bellow.'); 
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;?>7';"><?php echo _('Last 7 days');?>
634
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>7';"><?php echo _('Last 7 days'); ?>
635 635
             </button>
636 636
         </div>
637 637
     </div> 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
                         <div>
680 680
                             <input type="hidden" name="consortium" value="eduroam"/>
681 681
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
682
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
682
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
683 683
                             </button>
684 684
                             <span style='color: red;'>
685 685
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.