Passed
Push — release_2_1 ( a82df5...ff920e )
by Tomasz
11:44
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 ?>";
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
                     
270 270
                     cliinfo = cliinfo + '<li>';
271 271
                     if (data.ca[key].certificate[c].finalerror && data.ca[key].certificate[c].finalerror==2) {
272
-                        cliinfo = cliinfo + ' <?php echo _("this test was skipped - no appropriate client certificate");?>' + '</ul></li>';
272
+                        cliinfo = cliinfo + ' <?php echo _("this test was skipped - no appropriate client certificate"); ?>' + '</ul></li>';
273 273
                     } else {
274 274
                         cliinfo = cliinfo + '<table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
275
-                        cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
275
+                        cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
276 276
                         cliinfo = cliinfo + '</tbody></table></ul></li>';
277 277
                     }
278 278
                    
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                 });
472 472
             }
473 473
             o = o + cert_data + '</table>';
474
-            $("#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
+            $("#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>');
475 475
         });
476 476
     }
477 477
 
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
 <?php
483 483
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
484 484
     print "
485
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
486
-$(\"#live_src" . $hostindex . "_img\").show();
485
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
486
+$(\"#live_src" . $hostindex."_img\").show();
487 487
 $.ajax({
488 488
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
489 489
     type: 'POST',
@@ -516,15 +516,15 @@  discard block
 block discarded – undo
516 516
 <?php
517 517
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
518 518
     if ($testedProfile !== NULL) {
519
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
519
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
520 520
     } else {
521 521
         $extraarg = "";
522 522
     }
523 523
     print "
524
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
524
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
525 525
 $(\"#src$hostindex\").html('');
526 526
 running_ajax_stat++;
527
-$.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex'}, hostindex: '$hostindex', error: error_handler, success: udp, dataType: 'json'}); 
527
+$.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex'}, hostindex: '$hostindex', error: error_handler, success: udp, dataType: 'json'}); 
528 528
 ";
529 529
 }
530 530
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
     if ($check_realm === FALSE) {
579 579
         print "<p>$error_message</p>";
580 580
     } else {
581
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
581
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
582 582
         ?>
583 583
         <div id="debug_out" style="display: none"></div>
584 584
         <div id="tabs" style="min-width: 600px; max-width:1000px">
@@ -600,25 +600,25 @@  discard block
 block discarded – undo
600 600
                     // NAPTR existence check
601 601
                     if ($dynType == "") {
602 602
                         $rfc7585suite = $dnsChecks;
603
-                        echo "<strong>" . _("DNS checks") . "</strong><div>";
603
+                        echo "<strong>"._("DNS checks")."</strong><div>";
604 604
                     } else {
605 605
                         if (count($orrealm) == 0) {
606 606
                             continue;
607 607
                         }
608 608
                         $rfc7585suite = $dnsChecksOR;
609
-                        echo "<strong>" . _("OpenRoaming DNS checks") . "</strong><div>";
609
+                        echo "<strong>"._("OpenRoaming DNS checks")."</strong><div>";
610 610
                     }
611 611
                     $naptr = $rfc7585suite->relevantNAPTR();
612 612
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
613 613
                         if ($dynType == "") {
614
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
614
+                        	echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
615 615
                         } else {
616
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
616
+                        	echo "<tr><td>"._("OpenRoaming connectivity test is not configured")."</td><td>";
617 617
                         }
618 618
                     } else {
619 619
                         echo "<table>";
620 620
                         // output in friendly words
621
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
621
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
622 622
                         switch ($naptr) {
623 623
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
624 624
                                 echo _("This realm has no NAPTR records.");
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
                         // compliance checks for NAPTRs
635 635
                         if ($naptr > 0) {
636
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
636
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
637 637
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
638 638
                             switch ($naptr_valid) {
639 639
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
                         // SRV resolution
649 649
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
650 650
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
651
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
651
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
652 652
                             switch ($srv) {
653 653
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
654 654
                                     echo _("This check was skipped.");
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
                         // IP addresses for the hosts
665 665
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
666 666
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
667
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
667
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
668 668
                             switch ($srv) {
669 669
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
670 670
                                     echo _("This check was skipped.");
@@ -681,12 +681,12 @@  discard block
 block discarded – undo
681 681
                         echo "</table><br/>";
682 682
                         if ($dynType == "") {
683 683
                             if (count($testsuite->listerrors()) == 0) {
684
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
684
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
685 685
                             } else {
686
-                                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.");
686
+                                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.");
687 687
                                 echo "<div class='notacceptable'><table>";
688 688
                                 foreach ($testsuite->listerrors() as $details) {
689
-                                    echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
689
+                                    echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
690 690
                                 }
691 691
                                 echo "</table></div>";
692 692
                             }
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
                  $("#dynamic_tests").show();
706 706
               ';             
707 707
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
708
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
708
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
709 709
                             $expectedName = $addr['hostname'];
710 710
                             $ssltest = 1;
711 711
                             if (isset($addr['unavailable']) && $addr['unavailable']) {
@@ -723,9 +723,9 @@  discard block
 block discarded – undo
723 723
                             $protstr = implode(';', $protocols);
724 724
                             print "
725 725
                             running_ajax_dyn++;
726
-                            $.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' }, hostindex: '$hostindex', error: error_handler, success: capath, dataType: 'json'});
726
+                            $.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' }, hostindex: '$hostindex', error: error_handler, success: capath, dataType: 'json'});
727 727
                             running_ajax_dyn++;
728
-                            $.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' }, hostindex: '$hostindex', error: error_handler, success: clients, dataType: 'json'});
728
+                            $.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' }, hostindex: '$hostindex', error: error_handler, success: clients, dataType: 'json'});
729 729
                        ";
730 730
                         }
731 731
                         echo "}
@@ -741,11 +741,11 @@  discard block
 block discarded – undo
741 741
                  $("#openroaming_tests").show();
742 742
               ';
743 743
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
744
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
744
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
745 745
                             $expectedName = $addr['hostname'];
746 746
                             print "
747 747
                             running_ajax_openroaming++;
748
-                            $.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' }, hostindex: '$hostindex', openroaming: true, error: error_handler, success: capath, dataType: 'json'});
748
+                            $.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' }, hostindex: '$hostindex', openroaming: true, error: error_handler, success: capath, dataType: 'json'});
749 749
                        ";
750 750
                         }
751 751
                         echo "}
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
                          $naptrs[1] = $naptr;
759 759
                      }
760 760
                 }
761
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
761
+                    echo "<strong>"._("Static connectivity tests")."</strong>
762 762
          <table><tr>
763 763
          <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>
764 764
          </tr></table>";
765 765
                     if ($naptrs[0] > 0) {
766
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
766
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
767 767
          <table><tr>
768 768
          <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>
769 769
          </tr></table>";
770 770
                     }
771 771
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
772
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
772
+                      echo "<hr><strong>"._("OpenRoaming connectivity tests")."</strong>
773 773
          <table><tr>
774 774
          <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>
775 775
          </tr></table>";
@@ -789,12 +789,12 @@  discard block
 block discarded – undo
789 789
                     print "<p>";
790 790
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
791 791
                         print "<hr>";
792
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
792
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
793 793
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
794 794
 <tr>
795
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
795
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
796 796
 <td id='src$hostindex' colspan=2>
797
-" . _("testing...") . "
797
+"._("testing...")."
798 798
 </td>
799 799
 </tr>
800 800
 </table>";
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 
806 806
             </div>
807 807
             <?php
808
-            for ($i=3; $i<5; $i++) {
808
+            for ($i = 3; $i < 5; $i++) {
809 809
                 if ($i == 3 && $naptrs[0] <= 0) {
810 810
                    continue;
811 811
                 }
@@ -820,15 +820,15 @@  discard block
 block discarded – undo
820 820
                     $rfc7585suite = $dnsChecksOR;
821 821
                 }
822 822
             ?>
823
-                <div id="tabs-<?php echo $i;?>">
824
-                    <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>
823
+                <div id="tabs-<?php echo $i; ?>">
824
+                    <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>
825 825
 
826 826
                 <?php
827 827
                     echo "<div id='";
828
-                    if ($i==3) { echo 'dynamic'; } else { echo 'openroaming'; }
828
+                    if ($i == 3) { echo 'dynamic'; } else { echo 'openroaming'; }
829 829
                     echo "_tests'><fieldset class='option_container'>
830 830
                 <legend><strong>";
831
-                    if ($i==3) {
831
+                    if ($i == 3) {
832 832
                      echo _("DYNAMIC connectivity tests");
833 833
                     } else {
834 834
                      echo _("OpenRoaming connectivity tests");
@@ -842,11 +842,11 @@  discard block
 block discarded – undo
842 842
                     }
843 843
                     $resultstoprint = [];
844 844
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
845
-                        $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>';
846
-                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
845
+                        $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>';
846
+                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
847 847
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
848
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
849
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong> (' . $addr['hostname'] . ')';
848
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
849
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong> ('.$addr['hostname'].')';
850 850
                             $prots = [];
851 851
                             if (isset($addr['protocols'])) {
852 852
                                 foreach ($addr['protocols'] as $protocol) {
@@ -856,18 +856,18 @@  discard block
 block discarded – undo
856 856
                                 }
857 857
                             }
858 858
                             if (!empty($prots)) {
859
-                                $resultstoprint[] = ' ' . _("supported TLS protocols: ");
859
+                                $resultstoprint[] = ' '._("supported TLS protocols: ");
860 860
                                 $resultstoprint[] = implode(', ', $prots);
861 861
                                 if (!isset($addr['istls13']) || !$addr['istls13']) {
862
-                                    $resultstoprint[] = ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
862
+                                    $resultstoprint[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
863 863
                                 }
864 864
                             }
865 865
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
866
-                            $resultstoprint[] = "<table id='" . $prefix2 . "caresults$hostindex'  style='width:100%'>
866
+                            $resultstoprint[] = "<table id='".$prefix2."caresults$hostindex'  style='width:100%'>
867 867
 <tr>
868
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcca$hostindex" . "_img'></td>
869
-<td id='" . $prefix2 . "srcca$hostindex'>
870
-" . _("testing...") . "
868
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcca$hostindex"."_img'></td>
869
+<td id='" . $prefix2."srcca$hostindex'>
870
+"._("testing...")."
871 871
 </td>
872 872
 </tr>
873 873
 </table>";
@@ -875,26 +875,26 @@  discard block
 block discarded – undo
875 875
                         }
876 876
                         $clientstest = [];
877 877
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
878
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
879
-                            $clientstest[] = "<span id='" . $prefix2 . "clientresults$hostindex'><table style='width:100%'>
878
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
879
+                            $clientstest[] = "<span id='".$prefix2."clientresults$hostindex'><table style='width:100%'>
880 880
 <tr>
881 881
 <td class='icon_td'>";
882
-                            if ($i == 4 ) {
882
+                            if ($i == 4) {
883 883
                                 $clientstest[] = "<!--";
884 884
                             }
885
-                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcclient$hostindex" . "_img'></td>
886
-<td id='" . $prefix2 . "srcclient$hostindex'>
887
-" . _("testing...");
885
+                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcclient$hostindex"."_img'></td>
886
+<td id='" . $prefix2."srcclient$hostindex'>
887
+"._("testing...");
888 888
 
889
-                            if ($i == 4 ) {
890
-                                $clientstest[] = "-->" . _("not implemented yet");
889
+                            if ($i == 4) {
890
+                                $clientstest[] = "-->"._("not implemented yet");
891 891
                             }
892 892
                             $clientstest[] = "</td></tr></table></span>";
893 893
                             $clientstest[] = '</ol>';
894 894
                         }
895 895
                         echo '<div style="align:'.$end.';">';
896 896
                         echo join('', $resultstoprint);
897
-                        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>';
897
+                        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>';
898 898
                         print join('', $clientstest);
899 899
                         echo '</span>';
900 900
                         echo '</div>';
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
                 //     check if truncates/dies on Operator-Name
909 909
                 if ($my_profile !== NULL) {
910 910
                     echo "<div id='tabs-n'><fieldset class='option_container'>
911
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
911
+                <legend><strong>" . _("Live login test")."</strong></legend>";
912 912
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
913 913
                     if (count($prof_compl) > 0) {
914 914
                         $passwordReqired = FALSE;
@@ -921,34 +921,34 @@  discard block
 block discarded – undo
921 921
                                 $clientCertRequired = TRUE;
922 922
                             }
923 923
                         }
924
-                        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>
925
-                    <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>
926
-                    <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>
924
+                        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>
925
+                    <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>
926
+                    <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>
927 927
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
928 928
                     <input type='hidden' name='test_type' value='udp_login'>
929
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
930
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
929
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
930
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
931 931
                     <table id='live_tests'>";
932 932
 // if any password based EAP methods are available enable this section
933 933
                         if ($passwordReqired) {
934
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
935
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
936
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
937
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
934
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
935
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
936
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
937
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
938 938
                         }
939 939
                         // ask for cert + privkey if TLS-based method is active
940 940
                         if ($clientCertRequired) {
941
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
942
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
943
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
944
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
941
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
942
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
943
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
944
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
945 945
                         }
946
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
946
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
947 947
                         echo "<div id='live_login_results' style='display:none'>";
948 948
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
949 949
                             print "<hr>";
950
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
951
-                            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>";
950
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
951
+                            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>";
952 952
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
953 953
                         }
954 954
                         echo "</div>";
@@ -963,9 +963,9 @@  discard block
 block discarded – undo
963 963
             }
964 964
 
965 965
             if (isset($_POST['comefrom'])) {
966
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
966
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
967 967
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
968
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp) . "</button>"
968
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp)."</button>"
969 969
                 . "</form>";
970 970
             }
971 971
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.