Passed
Push — release_2_1 ( 6b1ac5...89c4c6 )
by Tomasz
10:24
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!");
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>";
128 128
     var getitfrom = "<?php echo _("Get it from here.") ?>";
129 129
     var listsource = "<?php echo \config\Diagnostics::RADIUSTESTS['accreditedCAsURL'] ?>";
130
-    var moretext = "<?php echo _("more") . "&raquo;" ?>";
130
+    var moretext = "<?php echo _("more")."&raquo;" ?>";
131 131
     var lesstext = "<?php echo "&laquo" ?>";
132 132
     var morealltext = "<?php echo _("Show detailed information for all tests") ?>";
133 133
     var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>";
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                         }
273 273
                     }
274 274
                     cliinfo = cliinfo + '<li><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
                     if (data.ca[key].certificate[c].finalerror === 1) {
278 278
                         cliinfo = cliinfo + '<li>' + restskipped + '</li>';
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                 });
473 473
             }
474 474
             o = o + cert_data + '</table>';
475
-            $("#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
+            $("#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>');
476 476
         });
477 477
     }
478 478
 
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 <?php
484 484
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
485 485
     print "
486
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
487
-$(\"#live_src" . $hostindex . "_img\").show();
486
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
487
+$(\"#live_src" . $hostindex."_img\").show();
488 488
 $.ajax({
489 489
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
490 490
     type: 'POST',
@@ -515,15 +515,15 @@  discard block
 block discarded – undo
515 515
 <?php
516 516
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
517 517
     if ($testedProfile !== NULL) {
518
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
518
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
519 519
     } else {
520 520
         $extraarg = "";
521 521
     }
522 522
     print "
523
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
523
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
524 524
 $(\"#src$hostindex\").html('');
525 525
 running_ajax_stat++;
526
-$.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'}); 
526
+$.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'}); 
527 527
 ";
528 528
 }
529 529
 ?>
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
     if ($check_realm === FALSE) {
552 552
         print "<p>$error_message</p>";
553 553
     } else {
554
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
554
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
555 555
         ?>
556 556
         <div id="debug_out" style="display: none"></div>
557 557
         <div id="tabs" style="min-width: 600px; max-width:1000px">
@@ -573,25 +573,25 @@  discard block
 block discarded – undo
573 573
                     // NAPTR existence check
574 574
                     if ($dynType == "") {
575 575
                         $rfc7585suite = $dnsChecks;
576
-                        echo "<strong>" . _("DNS checks") . "</strong><div>";
576
+                        echo "<strong>"._("DNS checks")."</strong><div>";
577 577
                     } else {
578 578
                         if (count($orrealm) == 0) {
579 579
                             continue;
580 580
                         }
581 581
                         $rfc7585suite = $dnsChecksOR;
582
-                        echo "<strong>" . _("OpenRoaming DNS checks") . "</strong><div>";
582
+                        echo "<strong>"._("OpenRoaming DNS checks")."</strong><div>";
583 583
                     }
584 584
                     $naptr = $rfc7585suite->relevantNAPTR();
585 585
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
586 586
                         if ($dynType == "") {
587
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
587
+                        	echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
588 588
                         } else {
589
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
589
+                        	echo "<tr><td>"._("OpenRoaming connectivity test is not configured")."</td><td>";
590 590
                         }
591 591
                     } else {
592 592
                         echo "<table>";
593 593
                         // output in friendly words
594
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
594
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
595 595
                         switch ($naptr) {
596 596
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
597 597
                                 echo _("This realm has no NAPTR records.");
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
                         // compliance checks for NAPTRs
608 608
                         if ($naptr > 0) {
609
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
609
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
610 610
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
611 611
                             switch ($naptr_valid) {
612 612
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
                         // SRV resolution
622 622
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
623 623
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
624
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
624
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
625 625
                             switch ($srv) {
626 626
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
627 627
                                     echo _("This check was skipped.");
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
                         // IP addresses for the hosts
638 638
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
639 639
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
640
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
640
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
641 641
                             switch ($srv) {
642 642
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
643 643
                                     echo _("This check was skipped.");
@@ -654,12 +654,12 @@  discard block
 block discarded – undo
654 654
                         echo "</table><br/>";
655 655
                         if ($dynType == "") {
656 656
                             if (count($testsuite->listerrors()) == 0) {
657
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
657
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
658 658
                             } else {
659
-                                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.");
659
+                                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.");
660 660
                                 echo "<div class='notacceptable'><table>";
661 661
                                 foreach ($testsuite->listerrors() as $details) {
662
-                                    echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
662
+                                    echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
663 663
                                 }
664 664
                                 echo "</table></div>";
665 665
                             }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                  $("#dynamic_tests").show();
679 679
               ';             
680 680
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
681
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
681
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
682 682
                             $expectedName = $addr['hostname'];
683 683
                             $ssltest = 1;
684 684
                             if (isset($addr['unavailable']) && $addr['unavailable']) {
@@ -696,9 +696,9 @@  discard block
 block discarded – undo
696 696
                             $protstr = implode(';', $protocols);
697 697
                             print "
698 698
                             running_ajax_dyn++;
699
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
699
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout,  data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
700 700
                             running_ajax_dyn++;
701
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
701
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
702 702
                        ";
703 703
                         }
704 704
                         echo "}
@@ -714,11 +714,11 @@  discard block
 block discarded – undo
714 714
                  $("#openroaming_tests").show();
715 715
               ';
716 716
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
717
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
717
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
718 718
                             $expectedName = $addr['hostname'];
719 719
                             print "
720 720
                             running_ajax_openroaming++;
721
-                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
721
+                            $.ajax({url:'radius_tests.php', timeout: ajax_timeout, data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
722 722
                        ";
723 723
                         }
724 724
                         echo "}
@@ -731,18 +731,18 @@  discard block
 block discarded – undo
731 731
                          $naptrs[1] = $naptr;
732 732
                      }
733 733
                 }
734
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
734
+                    echo "<strong>"._("Static connectivity tests")."</strong>
735 735
          <table><tr>
736 736
          <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>
737 737
          </tr></table>";
738 738
                     if ($naptrs[0] > 0) {
739
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
739
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
740 740
          <table><tr>
741 741
          <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>
742 742
          </tr></table>";
743 743
                     }
744 744
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
745
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
745
+                      echo "<hr><strong>"._("OpenRoaming connectivity tests")."</strong>
746 746
          <table><tr>
747 747
          <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>
748 748
          </tr></table>";
@@ -762,12 +762,12 @@  discard block
 block discarded – undo
762 762
                     print "<p>";
763 763
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
764 764
                         print "<hr>";
765
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
765
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
766 766
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
767 767
 <tr>
768
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
768
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
769 769
 <td id='src$hostindex' colspan=2>
770
-" . _("testing...") . "
770
+"._("testing...")."
771 771
 </td>
772 772
 </tr>
773 773
 </table>";
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 
779 779
             </div>
780 780
             <?php
781
-            for ($i=3; $i<5; $i++) {
781
+            for ($i = 3; $i < 5; $i++) {
782 782
                 if ($i == 3 && $naptrs[0] <= 0) {
783 783
                    continue;
784 784
                 }
@@ -793,15 +793,15 @@  discard block
 block discarded – undo
793 793
                     $rfc7585suite = $dnsChecksOR;
794 794
                 }
795 795
             ?>
796
-                <div id="tabs-<?php echo $i;?>">
797
-                    <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
+                <div id="tabs-<?php echo $i; ?>">
797
+                    <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>
798 798
 
799 799
                 <?php
800 800
                     echo "<div id='";
801
-                    if ($i==3) { echo 'dynamic'; } else { echo 'openroaming'; }
801
+                    if ($i == 3) { echo 'dynamic'; } else { echo 'openroaming'; }
802 802
                     echo "_tests'><fieldset class='option_container'>
803 803
                 <legend><strong>";
804
-                    if ($i==3) {
804
+                    if ($i == 3) {
805 805
                      echo _("DYNAMIC connectivity tests");
806 806
                     } else {
807 807
                      echo _("OpenRoaming connectivity tests");
@@ -815,11 +815,11 @@  discard block
 block discarded – undo
815 815
                     }
816 816
                     $resultstoprint = [];
817 817
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
818
-                        $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>';
819
-                        $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
+                        $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>';
819
+                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
820 820
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
821
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
822
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong> (' . $addr['hostname'] . ')';
821
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
822
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong> ('.$addr['hostname'].')';
823 823
                             $prots = [];
824 824
                             if (isset($addr['protocols'])) {
825 825
                                 foreach ($addr['protocols'] as $protocol) {
@@ -829,18 +829,18 @@  discard block
 block discarded – undo
829 829
                                 }
830 830
                             }
831 831
                             if (!empty($prots)) {
832
-                                $resultstoprint[] = ' ' . _("supported TLS protocols: ");
832
+                                $resultstoprint[] = ' '._("supported TLS protocols: ");
833 833
                                 $resultstoprint[] = implode(', ', $prots);
834 834
                                 if (!isset($addr['istls13']) || !$addr['istls13']) {
835
-                                    $resultstoprint[] = ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
835
+                                    $resultstoprint[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
836 836
                                 }
837 837
                             }
838 838
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
839
-                            $resultstoprint[] = "<table id='" . $prefix2 . "caresults$hostindex'  style='width:100%'>
839
+                            $resultstoprint[] = "<table id='".$prefix2."caresults$hostindex'  style='width:100%'>
840 840
 <tr>
841
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcca$hostindex" . "_img'></td>
842
-<td id='" . $prefix2 . "srcca$hostindex'>
843
-" . _("testing...") . "
841
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcca$hostindex"."_img'></td>
842
+<td id='" . $prefix2."srcca$hostindex'>
843
+"._("testing...")."
844 844
 </td>
845 845
 </tr>
846 846
 </table>";
@@ -848,26 +848,26 @@  discard block
 block discarded – undo
848 848
                         }
849 849
                         $clientstest = [];
850 850
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
851
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
852
-                            $clientstest[] = "<span id='" . $prefix2 . "clientresults$hostindex'><table style='width:100%'>
851
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
852
+                            $clientstest[] = "<span id='".$prefix2."clientresults$hostindex'><table style='width:100%'>
853 853
 <tr>
854 854
 <td class='icon_td'>";
855
-                            if ($i == 4 ) {
855
+                            if ($i == 4) {
856 856
                                 $clientstest[] = "<!--";
857 857
                             }
858
-                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcclient$hostindex" . "_img'></td>
859
-<td id='" . $prefix2 . "srcclient$hostindex'>
860
-" . _("testing...");
858
+                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcclient$hostindex"."_img'></td>
859
+<td id='" . $prefix2."srcclient$hostindex'>
860
+"._("testing...");
861 861
 
862
-                            if ($i == 4 ) {
863
-                                $clientstest[] = "-->" . _("not implemented yet");
862
+                            if ($i == 4) {
863
+                                $clientstest[] = "-->"._("not implemented yet");
864 864
                             }
865 865
                             $clientstest[] = "</td></tr></table></span>";
866 866
                             $clientstest[] = '</ol>';
867 867
                         }
868 868
                         echo '<div style="align:'.$end.';">';
869 869
                         echo join('', $resultstoprint);
870
-                        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>';
870
+                        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>';
871 871
                         print join('', $clientstest);
872 872
                         echo '</span>';
873 873
                         echo '</div>';
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
                 //     check if truncates/dies on Operator-Name
882 882
                 if ($my_profile !== NULL) {
883 883
                     echo "<div id='tabs-n'><fieldset class='option_container'>
884
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
884
+                <legend><strong>" . _("Live login test")."</strong></legend>";
885 885
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
886 886
                     if (count($prof_compl) > 0) {
887 887
                         $passwordReqired = FALSE;
@@ -894,34 +894,34 @@  discard block
 block discarded – undo
894 894
                                 $clientCertRequired = TRUE;
895 895
                             }
896 896
                         }
897
-                        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>
898
-                    <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>
899
-                    <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>
897
+                        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>
898
+                    <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>
899
+                    <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>
900 900
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
901 901
                     <input type='hidden' name='test_type' value='udp_login'>
902
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
903
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
902
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
903
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
904 904
                     <table id='live_tests'>";
905 905
 // if any password based EAP methods are available enable this section
906 906
                         if ($passwordReqired) {
907
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
908
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
909
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
910
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
907
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
908
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
909
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
910
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
911 911
                         }
912 912
                         // ask for cert + privkey if TLS-based method is active
913 913
                         if ($clientCertRequired) {
914
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
915
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
916
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
917
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
914
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
915
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
916
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
917
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
918 918
                         }
919
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
919
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
920 920
                         echo "<div id='live_login_results' style='display:none'>";
921 921
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
922 922
                             print "<hr>";
923
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
924
-                            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
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
924
+                            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>";
925 925
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
926 926
                         }
927 927
                         echo "</div>";
@@ -936,9 +936,9 @@  discard block
 block discarded – undo
936 936
             }
937 937
 
938 938
             if (isset($_POST['comefrom'])) {
939
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
939
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
940 940
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
941
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp) . "</button>"
941
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp)."</button>"
942 942
                 . "</form>";
943 943
             }
944 944
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.