Test Setup Failed
Push — release_2_1 ( 4878ef...9244c2 )
by Tomasz
29:52
created
web/diag/action_realmcheck.php 1 patch
Spacing   +77 added lines, -77 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 ?>";
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                         }
267 267
                     }
268 268
                     cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
269
-                    cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
269
+                    cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
270 270
                     cliinfo = cliinfo + '</tbody></table></ul></li>';
271 271
                     if (data.ca[key].certificate[c].finalerror === 1) {
272 272
                         cliinfo = cliinfo + '<li>' + restskipped + '</li>';
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                 });
467 467
             }
468 468
             o = o + cert_data + '</table>';
469
-            $("#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>');
469
+            $("#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>');
470 470
         });
471 471
     }
472 472
 
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 <?php
478 478
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
479 479
     print "
480
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
481
-$(\"#live_src" . $hostindex . "_img\").show();
480
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
481
+$(\"#live_src" . $hostindex."_img\").show();
482 482
 $.ajax({
483 483
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
484 484
     type: 'POST',
@@ -509,15 +509,15 @@  discard block
 block discarded – undo
509 509
 <?php
510 510
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
511 511
     if ($testedProfile !== NULL) {
512
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
512
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
513 513
     } else {
514 514
         $extraarg = "";
515 515
     }
516 516
     print "
517
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
517
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
518 518
 $(\"#src$hostindex\").html('');
519 519
 running_ajax_stat++;
520
-$.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'}); 
520
+$.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'}); 
521 521
 ";
522 522
 }
523 523
 ?>
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
     if ($check_realm === FALSE) {
546 546
         print "<p>$error_message</p>";
547 547
     } else {
548
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
548
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
549 549
         ?>
550 550
         <div id="debug_out" style="display: none"></div>
551 551
         <div id="tabs" style="min-width: 600px; max-width:1000px">
@@ -567,25 +567,25 @@  discard block
 block discarded – undo
567 567
                     // NAPTR existence check
568 568
                     if ($dynType == "") {
569 569
                         $rfc7585suite = $dnsChecks;
570
-                        echo "<strong>" . _("DNS checks") . "</strong><div>";
570
+                        echo "<strong>"._("DNS checks")."</strong><div>";
571 571
                     } else {
572 572
                         if (count($orrealm) == 0) {
573 573
                             continue;
574 574
                         }
575 575
                         $rfc7585suite = $dnsChecksOR;
576
-                        echo "<strong>" . _("OpenRoaming DNS checks") . "</strong><div>";
576
+                        echo "<strong>"._("OpenRoaming DNS checks")."</strong><div>";
577 577
                     }
578 578
                     $naptr = $rfc7585suite->relevantNAPTR();
579 579
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
580 580
                         if ($dynType == "") {
581
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
581
+                        	echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
582 582
                         } else {
583
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
583
+                        	echo "<tr><td>"._("OpenRoaming connectivity test is not configured")."</td><td>";
584 584
                         }
585 585
                     } else {
586 586
                         echo "<table>";
587 587
                         // output in friendly words
588
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
588
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
589 589
                         switch ($naptr) {
590 590
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
591 591
                                 echo _("This realm has no NAPTR records.");
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 
601 601
                         // compliance checks for NAPTRs
602 602
                         if ($naptr > 0) {
603
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
603
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
604 604
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
605 605
                             switch ($naptr_valid) {
606 606
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
                         // SRV resolution
616 616
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
617 617
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
618
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
618
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
619 619
                             switch ($srv) {
620 620
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
621 621
                                     echo _("This check was skipped.");
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                         // IP addresses for the hosts
632 632
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
633 633
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
634
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
634
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
635 635
                             switch ($srv) {
636 636
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
637 637
                                     echo _("This check was skipped.");
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
                         echo "</table><br/>";
649 649
                         if ($dynType == "") {
650 650
                             if (count($testsuite->listerrors()) == 0) {
651
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
651
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
652 652
                             } else {
653
-                                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.");
653
+                                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.");
654 654
                                 echo "<div class='notacceptable'><table>";
655 655
                                 foreach ($testsuite->listerrors() as $details) {
656
-                                    echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
656
+                                    echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
657 657
                                 }
658 658
                                 echo "</table></div>";
659 659
                             }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
                  $("#dynamic_tests").show();
673 673
               ';             
674 674
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
675
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
675
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
676 676
                             $expectedName = $addr['hostname'];
677 677
                             $ssltest = 1;
678 678
                             if (isset($addr['unavailable']) && $addr['unavailable']) {
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
                             $protstr = implode(';', $protocols);
691 691
                             print "
692 692
                             running_ajax_dyn++;
693
-                            $.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'});
693
+                            $.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'});
694 694
                             running_ajax_dyn++;
695
-                            $.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'});
695
+                            $.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'});
696 696
                        ";
697 697
                         }
698 698
                         echo "}
@@ -708,11 +708,11 @@  discard block
 block discarded – undo
708 708
                  $("#openroaming_tests").show();
709 709
               ';
710 710
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
711
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
711
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
712 712
                             $expectedName = $addr['hostname'];
713 713
                             print "
714 714
                             running_ajax_openroaming++;
715
-                            $.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'});
715
+                            $.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'});
716 716
                        ";
717 717
                         }
718 718
                         echo "}
@@ -725,18 +725,18 @@  discard block
 block discarded – undo
725 725
                          $naptrs[1] = $naptr;
726 726
                      }
727 727
                 }
728
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
728
+                    echo "<strong>"._("Static connectivity tests")."</strong>
729 729
          <table><tr>
730 730
          <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>
731 731
          </tr></table>";
732 732
                     if ($naptrs[0] > 0) {
733
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
733
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
734 734
          <table><tr>
735 735
          <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>
736 736
          </tr></table>";
737 737
                     }
738 738
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
739
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
739
+                      echo "<hr><strong>"._("OpenRoaming connectivity tests")."</strong>
740 740
          <table><tr>
741 741
          <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>
742 742
          </tr></table>";
@@ -756,12 +756,12 @@  discard block
 block discarded – undo
756 756
                     print "<p>";
757 757
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
758 758
                         print "<hr>";
759
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
759
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
760 760
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
761 761
 <tr>
762
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
762
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
763 763
 <td id='src$hostindex' colspan=2>
764
-" . _("testing...") . "
764
+"._("testing...")."
765 765
 </td>
766 766
 </tr>
767 767
 </table>";
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 
773 773
             </div>
774 774
             <?php
775
-            for ($i=3; $i<5; $i++) {
775
+            for ($i = 3; $i < 5; $i++) {
776 776
                 if ($i == 3 && $naptrs[0] <= 0) {
777 777
                    continue;
778 778
                 }
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
                     $rfc7585suite = $dnsChecksOR;
788 788
                 }
789 789
             ?>
790
-                <div id="tabs-<?php echo $i;?>">
791
-                    <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>
790
+                <div id="tabs-<?php echo $i; ?>">
791
+                    <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>
792 792
 
793 793
                 <?php
794 794
                     echo "<div id='";
795
-                    if ($i==3) { echo 'dynamic'; } else { echo 'openroaming'; }
795
+                    if ($i == 3) { echo 'dynamic'; } else { echo 'openroaming'; }
796 796
                     echo "_tests'><fieldset class='option_container'>
797 797
                 <legend><strong>";
798
-                    if ($i==3) {
798
+                    if ($i == 3) {
799 799
                      echo _("DYNAMIC connectivity tests");
800 800
                     } else {
801 801
                      echo _("OpenRoaming connectivity tests");
@@ -809,11 +809,11 @@  discard block
 block discarded – undo
809 809
                     }
810 810
                     $resultstoprint = [];
811 811
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
812
-                        $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>';
813
-                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
812
+                        $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>';
813
+                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
814 814
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
815
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
816
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong> (' . $addr['hostname'] . ')';
815
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
816
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong> ('.$addr['hostname'].')';
817 817
                             $prots = [];
818 818
                             if (isset($addr['protocols'])) {
819 819
                                 foreach ($addr['protocols'] as $protocol) {
@@ -823,18 +823,18 @@  discard block
 block discarded – undo
823 823
                                 }
824 824
                             }
825 825
                             if (!empty($prots)) {
826
-                                $resultstoprint[] = ' ' . _("supported TLS protocols: ");
826
+                                $resultstoprint[] = ' '._("supported TLS protocols: ");
827 827
                                 $resultstoprint[] = implode(', ', $prots);
828 828
                                 if (!isset($addr['istls13']) || !$addr['istls13']) {
829
-                                    $resultstoprint[] = ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
829
+                                    $resultstoprint[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
830 830
                                 }
831 831
                             }
832 832
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
833
-                            $resultstoprint[] = "<table id='" . $prefix2 . "caresults$hostindex'  style='width:100%'>
833
+                            $resultstoprint[] = "<table id='".$prefix2."caresults$hostindex'  style='width:100%'>
834 834
 <tr>
835
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcca$hostindex" . "_img'></td>
836
-<td id='" . $prefix2 . "srcca$hostindex'>
837
-" . _("testing...") . "
835
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcca$hostindex"."_img'></td>
836
+<td id='" . $prefix2."srcca$hostindex'>
837
+"._("testing...")."
838 838
 </td>
839 839
 </tr>
840 840
 </table>";
@@ -842,26 +842,26 @@  discard block
 block discarded – undo
842 842
                         }
843 843
                         $clientstest = [];
844 844
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
845
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
846
-                            $clientstest[] = "<span id='" . $prefix2 . "clientresults$hostindex'><table style='width:100%'>
845
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
846
+                            $clientstest[] = "<span id='".$prefix2."clientresults$hostindex'><table style='width:100%'>
847 847
 <tr>
848 848
 <td class='icon_td'>";
849
-                            if ($i == 4 ) {
849
+                            if ($i == 4) {
850 850
                                 $clientstest[] = "<!--";
851 851
                             }
852
-                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcclient$hostindex" . "_img'></td>
853
-<td id='" . $prefix2 . "srcclient$hostindex'>
854
-" . _("testing...");
852
+                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcclient$hostindex"."_img'></td>
853
+<td id='" . $prefix2."srcclient$hostindex'>
854
+"._("testing...");
855 855
 
856
-                            if ($i == 4 ) {
857
-                                $clientstest[] = "-->" . _("not implemented yet");
856
+                            if ($i == 4) {
857
+                                $clientstest[] = "-->"._("not implemented yet");
858 858
                             }
859 859
                             $clientstest[] = "</td></tr></table></span>";
860 860
                             $clientstest[] = '</ol>';
861 861
                         }
862 862
                         echo '<div style="align:'.$end.';">';
863 863
                         echo join('', $resultstoprint);
864
-                        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>';
864
+                        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>';
865 865
                         print join('', $clientstest);
866 866
                         echo '</span>';
867 867
                         echo '</div>';
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                 //     check if truncates/dies on Operator-Name
876 876
                 if ($my_profile !== NULL) {
877 877
                     echo "<div id='tabs-n'><fieldset class='option_container'>
878
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
878
+                <legend><strong>" . _("Live login test")."</strong></legend>";
879 879
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
880 880
                     if (count($prof_compl) > 0) {
881 881
                         $passwordReqired = FALSE;
@@ -888,34 +888,34 @@  discard block
 block discarded – undo
888 888
                                 $clientCertRequired = TRUE;
889 889
                             }
890 890
                         }
891
-                        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>
892
-                    <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>
893
-                    <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>
891
+                        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>
892
+                    <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>
893
+                    <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>
894 894
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
895 895
                     <input type='hidden' name='test_type' value='udp_login'>
896
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
897
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
896
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
897
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
898 898
                     <table id='live_tests'>";
899 899
 // if any password based EAP methods are available enable this section
900 900
                         if ($passwordReqired) {
901
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
902
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
903
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
904
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
901
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
902
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
903
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
904
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
905 905
                         }
906 906
                         // ask for cert + privkey if TLS-based method is active
907 907
                         if ($clientCertRequired) {
908
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
909
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
910
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
911
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
908
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
909
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
910
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
911
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
912 912
                         }
913
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
913
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
914 914
                         echo "<div id='live_login_results' style='display:none'>";
915 915
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
916 916
                             print "<hr>";
917
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
918
-                            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>";
917
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
918
+                            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>";
919 919
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
920 920
                         }
921 921
                         echo "</div>";
@@ -930,9 +930,9 @@  discard block
 block discarded – undo
930 930
             }
931 931
 
932 932
             if (isset($_POST['comefrom'])) {
933
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
933
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
934 934
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
935
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp) . "</button>"
935
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp)."</button>"
936 936
                 . "</form>";
937 937
             }
938 938
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.