Passed
Push — release_2_1 ( 76c21d...ea18cf )
by Maja
10:14
created
web/diag/action_realmcheck.php 1 patch
Spacing   +78 added lines, -78 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(__DIR__)) . "/config/_config.php";
22
+require_once dirname(dirname(__DIR__))."/config/_config.php";
23 23
 
24 24
 $loggerInstance = new \core\common\Logging();
25 25
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
             $dnsChecksOR = new \core\diag\RFC7585Tests($check_realm, "aaa+auth:radius.tls.tcp");
70 70
         }
71 71
     } else {
72
-        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>";
72
+        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>";
73 73
     }
74 74
 } else { // someone else's realm, and we don't know anything about it... only shallow checks
75 75
     $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? "");
76 76
     if ($check_realm !== FALSE) {
77 77
         $_SESSION['check_realm'] = $check_realm;
78
-        $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
78
+        $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
79 79
         $dnsChecks = new \core\diag\RFC7585Tests($check_realm);
80 80
     } else {
81 81
         $error_message = _("No valid realm name given, cannot execute any checks!");
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>";
122 122
     var getitfrom = "<?php echo _("Get it from here.") ?>";
123 123
     var listsource = "<?php echo \config\Diagnostics::RADIUSTESTS['accreditedCAsURL'] ?>";
124
-    var moretext = "<?php echo _("more") . "&raquo;" ?>";
124
+    var moretext = "<?php echo _("more")."&raquo;" ?>";
125 125
     var lesstext = "<?php echo "&laquo" ?>";
126 126
     var morealltext = "<?php echo _("Show detailed information for all tests") ?>";
127 127
     var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>";
@@ -268,10 +268,10 @@  discard block
 block discarded – undo
268 268
                     
269 269
                     cliinfo = cliinfo + '<li>';
270 270
                     if (data.ca[key].certificate[c].finalerror && data.ca[key].certificate[c].finalerror==2) {
271
-                        cliinfo = cliinfo + ' <?php echo _("this test was skipped - no appropriate client certificate");?>' + '</ul></li>';
271
+                        cliinfo = cliinfo + ' <?php echo _("this test was skipped - no appropriate client certificate"); ?>' + '</ul></li>';
272 272
                     } else {
273 273
                         cliinfo = cliinfo + '<table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
274
-                        cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
274
+                        cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
275 275
                         cliinfo = cliinfo + '</tbody></table></ul></li>';
276 276
                     }
277 277
                    
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
                 });
471 471
             }
472 472
             o = o + cert_data + '</table>';
473
-            $("#eap_test" + data.hostindex).append('<strong><img style="position: relative; top: 2px;" src="' + icons[v.level] + '"><span style="position: relative; top: -5px; <?php echo $start;?>: 1em">' + v.eap + ' &ndash; <?php printf(_("elapsed time: %sms."), "'+v.time_millisec+'&nbsp;") ?></span></strong><div class="more" style="padding-<?php echo $start;?>: 40px"><div class="morecontent"><div style="display:none; background: #eee;">' + o + '</div><a href="" class="morelink">' + moretext + '</a></div></div>');
473
+            $("#eap_test" + data.hostindex).append('<strong><img style="position: relative; top: 2px;" src="' + icons[v.level] + '"><span style="position: relative; top: -5px; <?php echo $start; ?>: 1em">' + v.eap + ' &ndash; <?php printf(_("elapsed time: %sms."), "'+v.time_millisec+'&nbsp;") ?></span></strong><div class="more" style="padding-<?php echo $start; ?>: 40px"><div class="morecontent"><div style="display:none; background: #eee;">' + o + '</div><a href="" class="morelink">' + moretext + '</a></div></div>');
474 474
         });
475 475
     }
476 476
 
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
 <?php
482 482
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
483 483
     print "
484
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
485
-$(\"#live_src" . $hostindex . "_img\").show();
484
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
485
+$(\"#live_src" . $hostindex."_img\").show();
486 486
 $.ajax({
487 487
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
488 488
     type: 'POST',
@@ -513,15 +513,15 @@  discard block
 block discarded – undo
513 513
 <?php
514 514
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
515 515
     if ($testedProfile !== NULL) {
516
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
516
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
517 517
     } else {
518 518
         $extraarg = "";
519 519
     }
520 520
     print "
521
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
521
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
522 522
 $(\"#src$hostindex\").html('');
523 523
 running_ajax_stat++;
524
-$.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex'}, error: eee, success: udp, dataType: 'json'}); 
524
+$.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex'}, error: eee, success: udp, dataType: 'json'}); 
525 525
 ";
526 526
 }
527 527
 ?>
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
     if ($check_realm === FALSE) {
550 550
         print "<p>$error_message</p>";
551 551
     } else {
552
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
552
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
553 553
         ?>
554 554
         <div id="debug_out" style="display: none"></div>
555 555
         <div id="tabs" style="min-width: 600px; max-width:1000px">
@@ -571,25 +571,25 @@  discard block
 block discarded – undo
571 571
                     // NAPTR existence check
572 572
                     if ($dynType == "") {
573 573
                         $rfc7585suite = $dnsChecks;
574
-                        echo "<strong>" . _("DNS checks") . "</strong><div>";
574
+                        echo "<strong>"._("DNS checks")."</strong><div>";
575 575
                     } else {
576 576
                         if (count($orrealm) == 0) {
577 577
                             continue;
578 578
                         }
579 579
                         $rfc7585suite = $dnsChecksOR;
580
-                        echo "<strong>" . _("OpenRoaming DNS checks") . "</strong><div>";
580
+                        echo "<strong>"._("OpenRoaming DNS checks")."</strong><div>";
581 581
                     }
582 582
                     $naptr = $rfc7585suite->relevantNAPTR();
583 583
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
584 584
                         if ($dynType == "") {
585
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
585
+                        	echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
586 586
                         } else {
587
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
587
+                        	echo "<tr><td>"._("OpenRoaming connectivity test is not configured")."</td><td>";
588 588
                         }
589 589
                     } else {
590 590
                         echo "<table>";
591 591
                         // output in friendly words
592
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
592
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
593 593
                         switch ($naptr) {
594 594
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
595 595
                                 echo _("This realm has no NAPTR records.");
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
                         // compliance checks for NAPTRs
606 606
                         if ($naptr > 0) {
607
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
607
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
608 608
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
609 609
                             switch ($naptr_valid) {
610 610
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
                         // SRV resolution
620 620
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
621 621
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
622
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
622
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
623 623
                             switch ($srv) {
624 624
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
625 625
                                     echo _("This check was skipped.");
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
                         // IP addresses for the hosts
636 636
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
637 637
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
638
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
638
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
639 639
                             switch ($srv) {
640 640
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
641 641
                                     echo _("This check was skipped.");
@@ -652,12 +652,12 @@  discard block
 block discarded – undo
652 652
                         echo "</table><br/>";
653 653
                         if ($dynType == "") {
654 654
                             if (count($testsuite->listerrors()) == 0) {
655
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
655
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
656 656
                             } else {
657
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
657
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
658 658
                                 echo "<div class='notacceptable'><table>";
659 659
                                 foreach ($testsuite->listerrors() as $details) {
660
-                                    echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
660
+                                    echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
661 661
                                 }
662 662
                                 echo "</table></div>";
663 663
                             }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                  $("#dynamic_tests").show();
677 677
               ';             
678 678
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
679
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
679
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
680 680
                             $expectedName = $addr['hostname'];
681 681
                             $ssltest = 1;
682 682
                             if (isset($addr['unavailable']) && $addr['unavailable']) {
@@ -694,9 +694,9 @@  discard block
 block discarded – undo
694 694
                             $protstr = implode(';', $protocols);
695 695
                             print "
696 696
                             running_ajax_dyn++;
697
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: capath, dataType: 'json'});
697
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: capath, dataType: 'json'});
698 698
                             running_ajax_dyn++;
699
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: clients, dataType: 'json'});
699
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: clients, dataType: 'json'});
700 700
                        ";
701 701
                         }
702 702
                         echo "}
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
                  $("#openroaming_tests").show();
713 713
               ';
714 714
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
715
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
715
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
716 716
                             $expectedName = $addr['hostname'];
717 717
                             print "
718 718
                             running_ajax_openroaming++;
719
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: capath, dataType: 'json'});
719
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: capath, dataType: 'json'});
720 720
                        ";
721 721
                         }
722 722
                         echo "}
@@ -729,18 +729,18 @@  discard block
 block discarded – undo
729 729
                          $naptrs[1] = $naptr;
730 730
                      }
731 731
                 }
732
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
732
+                    echo "<strong>"._("Static connectivity tests")."</strong>
733 733
          <table><tr>
734 734
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'>&nbsp;</td>
735 735
          </tr></table>";
736 736
                     if ($naptrs[0] > 0) {
737
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
737
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
738 738
          <table><tr>
739 739
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'>&nbsp;</td>
740 740
          </tr></table>";
741 741
                     }
742 742
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
743
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
743
+                      echo "<hr><strong>"._("OpenRoaming connectivity tests")."</strong>
744 744
          <table><tr>
745 745
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_openroaming_ico' class='icon'></td><td id='main_openroaming_result' style='display:none'>&nbsp;</td>
746 746
          </tr></table>";
@@ -760,12 +760,12 @@  discard block
 block discarded – undo
760 760
                     print "<p>";
761 761
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
762 762
                         print "<hr>";
763
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
763
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
764 764
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
765 765
 <tr>
766
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
766
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
767 767
 <td id='src$hostindex' colspan=2>
768
-" . _("testing...") . "
768
+"._("testing...")."
769 769
 </td>
770 770
 </tr>
771 771
 </table>";
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 
777 777
             </div>
778 778
             <?php
779
-            for ($i=3; $i<5; $i++) {
779
+            for ($i = 3; $i < 5; $i++) {
780 780
                 if ($i == 3 && $naptrs[0] <= 0) {
781 781
                    continue;
782 782
                 }
@@ -791,15 +791,15 @@  discard block
 block discarded – undo
791 791
                     $rfc7585suite = $dnsChecksOR;
792 792
                 }
793 793
             ?>
794
-                <div id="tabs-<?php echo $i;?>">
795
-                    <button id="run_<?php if ($i==3) echo 'd'; else echo 'o';?>_tests"; onclick="run_<?php if ($i==3) echo 'dynamic'; else echo 'openroaming';?>()"><?php if ($i==3) echo _("Repeat dynamic connectivity tests"); else echo _("Repeat OpenRoaming connectivity tests");?></button>
794
+                <div id="tabs-<?php echo $i; ?>">
795
+                    <button id="run_<?php if ($i == 3) echo 'd'; else echo 'o'; ?>_tests"; onclick="run_<?php if ($i == 3) echo 'dynamic'; else echo 'openroaming'; ?>()"><?php if ($i == 3) echo _("Repeat dynamic connectivity tests"); else echo _("Repeat OpenRoaming connectivity tests"); ?></button>
796 796
 
797 797
                 <?php
798 798
                     echo "<div id='";
799
-                    if ($i==3) { echo 'dynamic'; } else { echo 'openroaming'; }
799
+                    if ($i == 3) { echo 'dynamic'; } else { echo 'openroaming'; }
800 800
                     echo "_tests'><fieldset class='option_container'>
801 801
                 <legend><strong>";
802
-                    if ($i==3) {
802
+                    if ($i == 3) {
803 803
                      echo _("DYNAMIC connectivity tests");
804 804
                     } else {
805 805
                      echo _("OpenRoaming connectivity tests");
@@ -813,11 +813,11 @@  discard block
 block discarded – undo
813 813
                     }
814 814
                     $resultstoprint = [];
815 815
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
816
-                        $resultstoprint[] = '<div style="align:'.$end.'; display: none;" id="' . $prefix1 . '_result_fail">' . _("Some errors were found during the tests, see below") . '</div><div style="align:'.$end.'; display: none;" id="' . $prefix1 . '_result_pass">' . _("All tests passed, congratulations!") . '</div>';
817
-                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
816
+                        $resultstoprint[] = '<div style="align:'.$end.'; display: none;" id="'.$prefix1.'_result_fail">'._("Some errors were found during the tests, see below").'</div><div style="align:'.$end.'; display: none;" id="'.$prefix1.'_result_pass">'._("All tests passed, congratulations!").'</div>';
817
+                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
818 818
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
819
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
820
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong> (' . $addr['hostname'] . ')';
819
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
820
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong> ('.$addr['hostname'].')';
821 821
                             $prots = [];
822 822
                             if (isset($addr['protocols'])) {
823 823
                                 foreach ($addr['protocols'] as $protocol) {
@@ -827,18 +827,18 @@  discard block
 block discarded – undo
827 827
                                 }
828 828
                             }
829 829
                             if (!empty($prots)) {
830
-                                $resultstoprint[] = ' ' . _("supported TLS protocols: ");
830
+                                $resultstoprint[] = ' '._("supported TLS protocols: ");
831 831
                                 $resultstoprint[] = implode(', ', $prots);
832 832
                                 if (!isset($addr['istls13']) || !$addr['istls13']) {
833
-                                    $resultstoprint[] = ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
833
+                                    $resultstoprint[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
834 834
                                 }
835 835
                             }
836 836
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
837
-                            $resultstoprint[] = "<table id='" . $prefix2 . "caresults$hostindex'  style='width:100%'>
837
+                            $resultstoprint[] = "<table id='".$prefix2."caresults$hostindex'  style='width:100%'>
838 838
 <tr>
839
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcca$hostindex" . "_img'></td>
840
-<td id='" . $prefix2 . "srcca$hostindex'>
841
-" . _("testing...") . "
839
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcca$hostindex"."_img'></td>
840
+<td id='" . $prefix2."srcca$hostindex'>
841
+"._("testing...")."
842 842
 </td>
843 843
 </tr>
844 844
 </table>";
@@ -846,26 +846,26 @@  discard block
 block discarded – undo
846 846
                         }
847 847
                         $clientstest = [];
848 848
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
849
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
850
-                            $clientstest[] = "<span id='" . $prefix2 . "clientresults$hostindex'><table style='width:100%'>
849
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
850
+                            $clientstest[] = "<span id='".$prefix2."clientresults$hostindex'><table style='width:100%'>
851 851
 <tr>
852 852
 <td class='icon_td'>";
853
-                            if ($i == 4 ) {
853
+                            if ($i == 4) {
854 854
                                 $clientstest[] = "<!--";
855 855
                             }
856
-                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcclient$hostindex" . "_img'></td>
857
-<td id='" . $prefix2 . "srcclient$hostindex'>
858
-" . _("testing...");
856
+                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcclient$hostindex"."_img'></td>
857
+<td id='" . $prefix2."srcclient$hostindex'>
858
+"._("testing...");
859 859
 
860
-                            if ($i == 4 ) {
861
-                                $clientstest[] = "-->" . _("not implemented yet");
860
+                            if ($i == 4) {
861
+                                $clientstest[] = "-->"._("not implemented yet");
862 862
                             }
863 863
                             $clientstest[] = "</td></tr></table></span>";
864 864
                             $clientstest[] = '</ol>';
865 865
                         }
866 866
                         echo '<div style="align:'.$end.';">';
867 867
                         echo join('', $resultstoprint);
868
-                        echo '<span id="' . $prefix2 . 'clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from  CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>';
868
+                        echo '<span id="'.$prefix2.'clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from  CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>';
869 869
                         print join('', $clientstest);
870 870
                         echo '</span>';
871 871
                         echo '</div>';
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
                 //     check if truncates/dies on Operator-Name
880 880
                 if ($my_profile !== NULL) {
881 881
                     echo "<div id='tabs-n'><fieldset class='option_container'>
882
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
882
+                <legend><strong>" . _("Live login test")."</strong></legend>";
883 883
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
884 884
                     if (count($prof_compl) > 0) {
885 885
                         $passwordReqired = FALSE;
@@ -892,34 +892,34 @@  discard block
 block discarded – undo
892 892
                                 $clientCertRequired = TRUE;
893 893
                             }
894 894
                         }
895
-                        echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p>
896
-                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p>
897
-                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div>
895
+                        echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p>
896
+                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p>
897
+                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div>
898 898
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
899 899
                     <input type='hidden' name='test_type' value='udp_login'>
900
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
901
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
900
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
901
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
902 902
                     <table id='live_tests'>";
903 903
 // if any password based EAP methods are available enable this section
904 904
                         if ($passwordReqired) {
905
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
906
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
907
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
908
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
905
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
906
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
907
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
908
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
909 909
                         }
910 910
                         // ask for cert + privkey if TLS-based method is active
911 911
                         if ($clientCertRequired) {
912
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
913
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
914
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
915
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
912
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
913
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
914
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
915
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
916 916
                         }
917
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
917
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
918 918
                         echo "<div id='live_login_results' style='display:none'>";
919 919
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
920 920
                             print "<hr>";
921
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
922
-                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; $start: 20px; bottom: 0px; '></span>";
921
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
922
+                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; $start: 20px; bottom: 0px; '></span>";
923 923
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
924 924
                         }
925 925
                         echo "</div>";
@@ -934,9 +934,9 @@  discard block
 block discarded – undo
934 934
             }
935 935
 
936 936
             if (isset($_POST['comefrom'])) {
937
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
937
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
938 938
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
939
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp) . "</button>"
939
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp)."</button>"
940 940
                 . "</form>";
941 941
             }
942 942
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.
web/diag/show_realmcheck.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
                 ?>
163 163
                 <div id="tabs-3">
164 164
                     <!--<button id="run_d_tests" onclick="run_dynamic()"><?php echo _("Repeat dynamic connectivity tests") ?></button>-->
165
-                    <?php print $realmTests->printDynamic();?>
165
+                    <?php print $realmTests->printDynamic(); ?>
166 166
                     
167 167
                 </div>
168 168
             <?php
Please login to merge, or discard this patch.
core/diag/RADIUSTestsUI.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
          <table><tr>
293 293
          <td class='icon_td'>";
294 294
         $out[] = "<img src='".$this->stateIcons[$this->globalLevelStatic]."' id='main_static_ico' class='icon'></td><td id='main_static_result'>".
295
-                            $this->globalInfo[$this->globalLevelStatic].' '. _("See the appropriate tab for details.").'</td>
295
+                            $this->globalInfo[$this->globalLevelStatic].' '._("See the appropriate tab for details.").'</td>
296 296
          </tr></table>';
297 297
         if ($this->naptr > 0) {
298 298
             $out[] = "<hr><strong>"._("Dynamic connectivity tests")."</strong>
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 <td class='icon_td'><img src='".$this->stateIcons[$result->level]."' id='src".$hostindex."_img'></td>
325 325
 <td id='src$hostindex' colspan=2>
326 326
 ";
327
-            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf (_("elapsed time: %sms."), $result->time_millisec).'<div>'.$result->message.'</div>';
327
+            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf(_("elapsed time: %sms."), $result->time_millisec).'<div>'.$result->message.'</div>';
328 328
                     
329 329
             if ($result->level > \core\common\Entity::L_OK && property_exists($result, 'cert_oddities')) {
330 330
                 foreach ($result->cert_oddities as $oddities) {
@@ -341,16 +341,16 @@  discard block
 block discarded – undo
341 341
                     }
342 342
                 }
343 343
                 if ($result->server_cert->extensions) {
344
-                    $certdesc .= '<li>' . _('Extensions') . '<ul>';
344
+                    $certdesc .= '<li>'._('Extensions').'<ul>';
345 345
                     foreach ($result->server_cert->extensions as $ekey => $eval) {
346
-                        $certdesc .= '<li>' . $ekey . ': ' . $eval;
346
+                        $certdesc .= '<li>'.$ekey.': '.$eval;
347 347
                     }
348 348
                     $certdesc .= '</ul>';
349 349
                 }
350 350
                 $certdesc .= '</ul>';
351 351
                 $more .= '<span class="morecontent"><span>'.$certdesc.
352 352
                         '</span>&nbsp;&nbsp;<a href="" class="morelink">'._("show server certificate details").'&raquo;</a></span></td></tr>';
353
-                $out[] = $more . '</ul>';
353
+                $out[] = $more.'</ul>';
354 354
             }            
355 355
             $out[] = "</td></tr></table></ul>";
356 356
         }
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
             if (isset($this->protocolsMap[$capath->IP]) && $this->protocolsMap[$capath->IP] != '') {
374 374
                 $prots = explode(';', $this->protocolsMap[$capath->IP]);
375 375
                 if (!empty($prots)) {
376
-                    $capathtest[] = ' ' . _("supported TLS protocols: ");
376
+                    $capathtest[] = ' '._("supported TLS protocols: ");
377 377
                     $capathtest[] = implode(', ', $prots);
378 378
                     if (!in_array("TLS1.3", $prots)) {
379
-                        $capathtest[] =  ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
379
+                        $capathtest[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
380 380
                     }
381 381
                 }
382 382
             }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 if ($capath->certdata->validTo) {
400 400
                     $certdesc .= '<li>'.$this->certFields['validTo'].' '.
401 401
                             date_create_from_format('ymdGis', 
402
-                                    substr($capath->certdata->validTo, 0, -1))->format('Y-m-d H:i:s'). ' UTC';
402
+                                    substr($capath->certdata->validTo, 0, -1))->format('Y-m-d H:i:s').' UTC';
403 403
                 }
404 404
                 if ($capath->certdata->extensions) {
405 405
                     if ($capath->certdata->extensions->subjectaltname) {                     
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             } else {
423 423
                 $certdesc = '<br>';
424 424
             }
425
-            $capathtest[] = '<div>'.($capath->message!='' ? $capath->message : _('Test failed')).'</div>'.$more;
425
+            $capathtest[] = '<div>'.($capath->message != '' ? $capath->message : _('Test failed')).'</div>'.$more;
426 426
             $capathtest[] = '</td>
427 427
 </tr>
428 428
 </table>';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                         $srefused = 0;
450 450
                         $cliinfo = '';
451 451
                         $cliinfo .= '<li>'._('Client certificate').' <b>'.$ca->clientcertinfo->from.
452
-                                    '</b>'.', '.$ca->clientcertinfo->message .
452
+                                    '</b>'.', '.$ca->clientcertinfo->message.
453 453
                                     '<br> (CA: '.$ca->clientcertinfo->issuer.')<ul>';
454 454
                         foreach ($ca->certificate as $certificate) {
455 455
                             if ($certificate->returncode == \core\diag\RADIUSTests::RETVAL_CONNECTION_REFUSED) {
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                 } else {
516 516
                     $cliinfo = _('Test failed');
517 517
                     $clientstest[] = "<table><tr><td class='icon_td' id='srcclient".$hostindex."_img'><img src='".
518
-                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>" .
518
+                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>".
519 519
                                     "<td id='srcclient$hostindex'>$cliinfo</td></tr></table>";
520 520
                 }
521 521
             } else {
Please login to merge, or discard this patch.