@@ -19,7 +19,7 @@ discard block |
||
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 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $testsuite = new \core\diag\RADIUSTests($check_realm, $testedProfile->getRealmCheckOuterUsername(), $testedProfile->getEapMethodsinOrderOfPreference(1), $testedProfile->getCollapsedAttributes()['eap:server_name'], $testedProfile->getCollapsedAttributes()["eap:ca_file"]); |
66 | 66 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
67 | 67 | } else { |
68 | - $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>"; |
|
68 | + $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>"; |
|
69 | 69 | } |
70 | 70 | } else { // someone else's realm, and we don't know anything about it... only shallow checks |
71 | 71 | $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? ""); |
72 | 72 | if ($check_realm !== FALSE) { |
73 | 73 | $_SESSION['check_realm'] = $check_realm; |
74 | - $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm); |
|
74 | + $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm); |
|
75 | 75 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
76 | 76 | } else { |
77 | 77 | $error_message = _("No valid realm name given, cannot execute any checks!"); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>"; |
120 | 120 | var getitfrom = "<?php echo _("Get it from here.") ?>"; |
121 | 121 | var listsource = "<?php echo CONFIG_DIAGNOSTICS['RADIUSTESTS']['accreditedCAsURL'] ?>"; |
122 | - var moretext = "<?php echo _("more") . "»" ?>"; |
|
122 | + var moretext = "<?php echo _("more")."»" ?>"; |
|
123 | 123 | var lesstext = "<?php echo "«" ?>"; |
124 | 124 | var morealltext = "<?php echo _("Show detailed information for all tests") ?>"; |
125 | 125 | var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>"; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state; |
259 | - cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ") . ")"; ?>' + add + '</td></tr>'; |
|
259 | + cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ").")"; ?>' + add + '</td></tr>'; |
|
260 | 260 | cliinfo = cliinfo + '</tbody></table></ul></li>'; |
261 | 261 | if (data.ca[key].certificate[c].finalerror === 1) { |
262 | 262 | cliinfo = cliinfo + '<li>' + restskipped + '</li>'; |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | <?php |
427 | 427 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
428 | 428 | print " |
429 | -$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading); |
|
430 | -$(\"#live_src" . $hostindex . "_img\").show(); |
|
429 | +$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading); |
|
430 | +$(\"#live_src" . $hostindex."_img\").show(); |
|
431 | 431 | $.ajax({ |
432 | 432 | url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm, |
433 | 433 | type: 'POST', |
@@ -457,15 +457,15 @@ discard block |
||
457 | 457 | <?php |
458 | 458 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
459 | 459 | if ($testedProfile !== NULL) { |
460 | - $extraarg = "profile_id: " . $testedProfile->identifier . ", "; |
|
460 | + $extraarg = "profile_id: ".$testedProfile->identifier.", "; |
|
461 | 461 | } else { |
462 | 462 | $extraarg = ""; |
463 | 463 | } |
464 | 464 | print " |
465 | -$(\"#src" . $hostindex . "_img\").attr('src',icon_loading); |
|
465 | +$(\"#src" . $hostindex."_img\").attr('src',icon_loading); |
|
466 | 466 | $(\"#src$hostindex\").html(''); |
467 | 467 | running_ajax_stat++; |
468 | -$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, udp, 'json'); |
|
468 | +$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, udp, 'json'); |
|
469 | 469 | |
470 | 470 | "; |
471 | 471 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if ($check_realm === FALSE) { |
493 | 493 | print "<p>$error_message</p>"; |
494 | 494 | } else { |
495 | - print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n"; |
|
495 | + print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n"; |
|
496 | 496 | ?> |
497 | 497 | <div id="debug_out" style="display: none"></div> |
498 | 498 | <div id="tabs" style="min-width: 600px; max-width:800px"> |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | </legend> |
510 | 510 | <?php |
511 | 511 | // NAPTR existence check |
512 | - echo "<strong>" . _("DNS chekcs") . "</strong><div>"; |
|
512 | + echo "<strong>"._("DNS chekcs")."</strong><div>"; |
|
513 | 513 | $naptr = $rfc7585suite->relevantNAPTR(); |
514 | 514 | if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) { |
515 | 515 | echo "<table>"; |
516 | 516 | // output in friendly words |
517 | - echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>"; |
|
517 | + echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>"; |
|
518 | 518 | switch ($naptr) { |
519 | 519 | case \core\diag\RFC7585Tests::RETVAL_NONAPTR: |
520 | 520 | echo _("This realm has no NAPTR records."); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | // compliance checks for NAPTRs |
531 | 531 | if ($naptr > 0) { |
532 | - echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>"; |
|
532 | + echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>"; |
|
533 | 533 | $naptr_valid = $rfc7585suite->relevantNAPTRcompliance(); |
534 | 534 | switch ($naptr_valid) { |
535 | 535 | case \core\diag\RADIUSTests::RETVAL_OK: |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | |
547 | 547 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) { |
548 | 548 | $srv = $rfc7585suite->relevantNAPTRsrvResolution(); |
549 | - echo "<tr><td>" . _("Checking SRVs:") . "</td><td>"; |
|
549 | + echo "<tr><td>"._("Checking SRVs:")."</td><td>"; |
|
550 | 550 | switch ($srv) { |
551 | 551 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
552 | 552 | echo _("This check was skipped."); |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | // IP addresses for the hosts |
563 | 563 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) { |
564 | 564 | $hosts = $rfc7585suite->relevantNAPTRhostnameResolution(); |
565 | - echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>"; |
|
565 | + echo "<tr><td>"._("Checking IP address resolution:")."</td><td>"; |
|
566 | 566 | switch ($srv) { |
567 | 567 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
568 | 568 | echo _("This check was skipped."); |
@@ -578,12 +578,12 @@ discard block |
||
578 | 578 | |
579 | 579 | echo "</table><br/><br/>"; |
580 | 580 | if (count($testsuite->listerrors()) == 0) { |
581 | - echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!"); |
|
581 | + echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!"); |
|
582 | 582 | } else { |
583 | - 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."); |
|
583 | + 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."); |
|
584 | 584 | echo "<div class='notacceptable'><table>"; |
585 | 585 | foreach ($testsuite->listerrors() as $details) { |
586 | - echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>"; |
|
586 | + echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>"; |
|
587 | 587 | } |
588 | 588 | echo "</table></div>"; |
589 | 589 | } |
@@ -599,25 +599,25 @@ discard block |
||
599 | 599 | $("#dynamic_tests").show(); |
600 | 600 | '; |
601 | 601 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
602 | - $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port']; |
|
602 | + $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port']; |
|
603 | 603 | print " |
604 | 604 | running_ajax_dyn++; |
605 | - $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); |
|
605 | + $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); |
|
606 | 606 | running_ajax_dyn++; |
607 | - $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
607 | + $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
608 | 608 | "; |
609 | 609 | } |
610 | 610 | echo "} |
611 | 611 | </script><hr>"; |
612 | 612 | } else { |
613 | - echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>"; |
|
613 | + echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>"; |
|
614 | 614 | } |
615 | - echo "<strong>" . _("Static connectivity tests") . "</strong> |
|
615 | + echo "<strong>"._("Static connectivity tests")."</strong> |
|
616 | 616 | <table><tr> |
617 | 617 | <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'> </td> |
618 | 618 | </tr></table>"; |
619 | 619 | if ($naptr > 0) { |
620 | - echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong> |
|
620 | + echo "<hr><strong>"._("Dynamic connectivity tests")."</strong> |
|
621 | 621 | <table><tr> |
622 | 622 | <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'> </td> |
623 | 623 | </tr></table>"; |
@@ -637,12 +637,12 @@ discard block |
||
637 | 637 | print "<p>"; |
638 | 638 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
639 | 639 | print "<hr>"; |
640 | - printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
640 | + printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
641 | 641 | print "<table id='results$hostindex' style='width:100%' class='udp_results'> |
642 | 642 | <tr> |
643 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td> |
|
643 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td> |
|
644 | 644 | <td id='src$hostindex' colspan=2> |
645 | -" . _("testing...") . " |
|
645 | +"._("testing...")." |
|
646 | 646 | </td> |
647 | 647 | </tr> |
648 | 648 | </table>"; |
@@ -661,21 +661,21 @@ discard block |
||
661 | 661 | |
662 | 662 | <?php |
663 | 663 | echo "<div id='dynamic_tests'><fieldset class='option_container'> |
664 | - <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>"; |
|
664 | + <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>"; |
|
665 | 665 | |
666 | 666 | $resultstoprint = []; |
667 | 667 | if (count($rfc7585suite->NAPTR_hostname_records) > 0) { |
668 | - $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</table><table style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</table>'; |
|
669 | - $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>"; |
|
668 | + $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</table><table style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</table>'; |
|
669 | + $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>"; |
|
670 | 670 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
671 | - $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]); |
|
672 | - $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>'; |
|
671 | + $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]); |
|
672 | + $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>'; |
|
673 | 673 | $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>'; |
674 | 674 | $resultstoprint[] = "<table id='caresults$hostindex' style='width:100%'> |
675 | 675 | <tr> |
676 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td> |
|
676 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td> |
|
677 | 677 | <td id='srcca$hostindex'> |
678 | -" . _("testing...") . " |
|
678 | +"._("testing...")." |
|
679 | 679 | </td> |
680 | 680 | </tr> |
681 | 681 | </table>"; |
@@ -683,12 +683,12 @@ discard block |
||
683 | 683 | } |
684 | 684 | $clientstest = []; |
685 | 685 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
686 | - $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>'; |
|
686 | + $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>'; |
|
687 | 687 | $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'> |
688 | 688 | <tr> |
689 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td> |
|
689 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td> |
|
690 | 690 | <td id='srcclient$hostindex'> |
691 | -" . _("testing...") . " |
|
691 | +"._("testing...")." |
|
692 | 692 | </td> |
693 | 693 | </tr> |
694 | 694 | </table></span>"; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | } |
697 | 697 | echo '<div style="align:right;">'; |
698 | 698 | echo join('', $resultstoprint); |
699 | - echo '<span id="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>'; |
|
699 | + echo '<span id="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>'; |
|
700 | 700 | print join('', $clientstest); |
701 | 701 | echo '</span>'; |
702 | 702 | echo '</div>'; |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | // check if truncates/dies on Operator-Name |
711 | 711 | if ($my_profile !== NULL) { |
712 | 712 | echo "<div id='tabs-4'><fieldset class='option_container'> |
713 | - <legend><strong>" . _("Live login test") . "</strong></legend>"; |
|
713 | + <legend><strong>" . _("Live login test")."</strong></legend>"; |
|
714 | 714 | $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1); |
715 | 715 | if (count($prof_compl) > 0) { |
716 | 716 | $passwordReqired = FALSE; |
@@ -723,34 +723,34 @@ discard block |
||
723 | 723 | $clientCertRequired = TRUE; |
724 | 724 | } |
725 | 725 | } |
726 | - 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> |
|
727 | - <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> |
|
728 | - <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> |
|
726 | + 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> |
|
727 | + <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> |
|
728 | + <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> |
|
729 | 729 | <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'> |
730 | 730 | <input type='hidden' name='test_type' value='udp_login'> |
731 | - <input type='hidden' name='lang' value='" . $gui->langObject->getLang() . "'> |
|
732 | - <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'> |
|
731 | + <input type='hidden' name='lang' value='" . $gui->langObject->getLang()."'> |
|
732 | + <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'> |
|
733 | 733 | <table id='live_tests'>"; |
734 | 734 | // if any password based EAP methods are available enable this section |
735 | 735 | if ($passwordReqired) { |
736 | - echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr> |
|
737 | - <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | - echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | - echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
736 | + echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr> |
|
737 | + <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | + echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | + echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
740 | 740 | } |
741 | 741 | // ask for cert + privkey if TLS-based method is active |
742 | 742 | if ($clientCertRequired) { |
743 | - echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr> |
|
744 | - <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | - <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | - <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
743 | + echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr> |
|
744 | + <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | + <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | + <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
747 | 747 | } |
748 | - echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>"; |
|
748 | + echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>"; |
|
749 | 749 | echo "<div id='live_login_results' style='display:none'>"; |
750 | 750 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
751 | 751 | print "<hr>"; |
752 | - printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
753 | - print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
752 | + printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
753 | + print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
754 | 754 | print "<div id='eap_test$hostindex' class='eap_test_results'></div>"; |
755 | 755 | } |
756 | 756 | echo "</div>"; |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | } |
766 | 766 | |
767 | 767 | if (isset($_POST['comefrom'])) { |
768 | - $return = htmlspecialchars_decode($_POST['comefrom']) . "?inst_id=" . $my_inst->identifier; |
|
768 | + $return = htmlspecialchars_decode($_POST['comefrom'])."?inst_id=".$my_inst->identifier; |
|
769 | 769 | echo "<form method='post' action='$return' accept-charset='UTF-8'> |
770 | - <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>" |
|
770 | + <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>" |
|
771 | 771 | . "</form>"; |
772 | 772 | } |
773 | 773 | if ($check_realm !== FALSE) { |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | use GeoIp2\Database\Reader; |
50 | 50 | use \Exception; |
51 | 51 | |
52 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
53 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php"; |
|
54 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php"; |
|
52 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
53 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php"; |
|
54 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php"; |
|
55 | 55 | |
56 | 56 | class SanityTests extends CAT |
57 | 57 | { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $this->test_result = []; |
94 | 94 | $this->test_result['global'] = 0; |
95 | 95 | // parse the schema file to find out the number of expected rows... |
96 | - $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql"); |
|
96 | + $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql"); |
|
97 | 97 | $this->profile_option_ct = 0; |
98 | 98 | $passedTheWindmill = FALSE; |
99 | 99 | foreach ($schema as $schemaLine) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $this->out[$test] = []; |
122 | 122 | $this->name = $test; |
123 | - $m_name = $test . '_test'; |
|
123 | + $m_name = $test.'_test'; |
|
124 | 124 | $this->test_result[$test] = 0; |
125 | 125 | if (!method_exists($this, $m_name)) { |
126 | 126 | $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>."); |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | private function php_test() |
230 | 230 | { |
231 | 231 | if (version_compare(phpversion(), $this->php_needversion, '>=')) { |
232 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
232 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
233 | 233 | } else { |
234 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have " . phpversion() . "."); |
|
234 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have ".phpversion()."."); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
249 | 249 | } else { |
250 | 250 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
251 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>"); |
|
251 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>"); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | $SSPconfig = \SimpleSAML\Configuration::getInstance(); |
267 | 267 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
268 | 268 | if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) { |
269 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
269 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
270 | 270 | } else { |
271 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion)); |
|
271 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion)); |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | */ |
330 | 330 | private function logdir_test() |
331 | 331 | { |
332 | - if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) { |
|
333 | - $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!"); |
|
332 | + if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) { |
|
333 | + $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!"); |
|
334 | 334 | } else { |
335 | 335 | $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable."); |
336 | 336 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | } else { |
368 | 368 | $classname = 'Imagick'; |
369 | 369 | } |
370 | - if (class_exists('\\' . $classname)) { |
|
370 | + if (class_exists('\\'.$classname)) { |
|
371 | 371 | $this->testReturn(\core\common\Entity::L_OK, "PHP extension <strong>$classname</strong> is installed."); |
372 | 372 | } else { |
373 | - $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/" . strtolower($classname) . "'>here</a>."); |
|
373 | + $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/".strtolower($classname)."'>here</a>."); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | if (function_exists('ImageCreate')) { |
@@ -468,15 +468,15 @@ discard block |
||
468 | 468 | } |
469 | 469 | $output = []; |
470 | 470 | $retval = -100; |
471 | - $t = exec($A['exec'] . ' version', $output, $retval); |
|
471 | + $t = exec($A['exec'].' version', $output, $retval); |
|
472 | 472 | if ($retval != 0 || count($output) != 1) { |
473 | 473 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>openssl</strong> was not found on your system despite being configured!"); |
474 | 474 | return; |
475 | 475 | } |
476 | 476 | if ($A['exec_is'] == "EXPLICIT") { |
477 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>" . $output[0] . "</strong> was found and is configured explicitly in your config."); |
|
477 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>".$output[0]."</strong> was found and is configured explicitly in your config."); |
|
478 | 478 | } else { |
479 | - $this->testReturn(\core\common\Entity::L_WARN, "<strong>" . $output[0] . "</strong> was found, but is not configured with an absolute path in your config."); |
|
479 | + $this->testReturn(\core\common\Entity::L_WARN, "<strong>".$output[0]."</strong> was found, but is not configured with an absolute path in your config."); |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | $output = []; |
504 | 504 | $retval = -100; |
505 | - $t = exec($A['exec'] . ' -VERSION', $output, $retval); |
|
505 | + $t = exec($A['exec'].' -VERSION', $output, $retval); |
|
506 | 506 | if ($retval != 0 || count($output) != 1) { |
507 | 507 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>makensis</strong> was not found on your system despite being configured!"); |
508 | 508 | return; |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
514 | 514 | } |
515 | 515 | $outputArray = []; |
516 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
516 | + exec($A['exec'].' -HELP', $outputArray); |
|
517 | 517 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
518 | 518 | if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) { |
519 | 519 | $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $NSIS_Module_status = []; |
541 | 541 | foreach ($this->NSIS_Modules as $module) { |
542 | 542 | unset($out); |
543 | - exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
543 | + exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
544 | 544 | if ($retval > 0) { |
545 | 545 | $NSIS_Module_status[$module] = 0; |
546 | 546 | } else { |
@@ -605,8 +605,8 @@ discard block |
||
605 | 605 | $locales = shell_exec("locale -a"); |
606 | 606 | $allthere = ""; |
607 | 607 | foreach (CONFIG['LANGUAGES'] as $onelanguage) { |
608 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
609 | - $allthere .= $onelanguage['locale'] . " "; |
|
608 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
609 | + $allthere .= $onelanguage['locale']." "; |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | if ($allthere == "") { |
@@ -620,47 +620,47 @@ discard block |
||
620 | 620 | ["SETTING" => CONFIG['APPEARANCE']['from-mail'], |
621 | 621 | "DEFVALUE" => "[email protected]", |
622 | 622 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
623 | - "REQUIRED" => FALSE,], |
|
623 | + "REQUIRED" => FALSE, ], |
|
624 | 624 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'], |
625 | 625 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
626 | 626 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
627 | - "REQUIRED" => FALSE,], |
|
627 | + "REQUIRED" => FALSE, ], |
|
628 | 628 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'], |
629 | 629 | "DEFVALUE" => "[email protected]", |
630 | 630 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
631 | - "REQUIRED" => FALSE,], |
|
631 | + "REQUIRED" => FALSE, ], |
|
632 | 632 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'], |
633 | 633 | "DEFVALUE" => "[email protected]", |
634 | 634 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
635 | - "REQUIRED" => FALSE,], |
|
635 | + "REQUIRED" => FALSE, ], |
|
636 | 636 | ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'], |
637 | 637 | "DEFVALUE" => "[email protected]", |
638 | 638 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
639 | - "REQUIRED" => FALSE,], |
|
639 | + "REQUIRED" => FALSE, ], |
|
640 | 640 | ["SETTING" => CONFIG['APPEARANCE']['MOTD'], |
641 | 641 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
642 | 642 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
643 | - "REQUIRED" => FALSE,], |
|
643 | + "REQUIRED" => FALSE, ], |
|
644 | 644 | ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'], |
645 | 645 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
646 | 646 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
647 | - "REQUIRED" => TRUE,], |
|
647 | + "REQUIRED" => TRUE, ], |
|
648 | 648 | ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'], |
649 | 649 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
650 | 650 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
651 | - "REQUIRED" => TRUE,], |
|
651 | + "REQUIRED" => TRUE, ], |
|
652 | 652 | ["SETTING" => CONFIG['DB']['INST']['host'], |
653 | 653 | "DEFVALUE" => "db.host.example", |
654 | 654 | "COMPLAINTSTRING" => "DB/INST ", |
655 | - "REQUIRED" => TRUE,], |
|
655 | + "REQUIRED" => TRUE, ], |
|
656 | 656 | ["SETTING" => CONFIG['DB']['INST']['host'], |
657 | 657 | "DEFVALUE" => "db.host.example", |
658 | 658 | "COMPLAINTSTRING" => "DB/USER ", |
659 | - "REQUIRED" => TRUE,], |
|
659 | + "REQUIRED" => TRUE, ], |
|
660 | 660 | ["SETTING" => CONFIG['DB']['EXTERNAL']['host'], |
661 | 661 | "DEFVALUE" => "customerdb.otherhost.example", |
662 | 662 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
663 | - "REQUIRED" => FALSE,], |
|
663 | + "REQUIRED" => FALSE, ], |
|
664 | 664 | ]; |
665 | 665 | |
666 | 666 | /** |
@@ -688,11 +688,11 @@ discard block |
||
688 | 688 | if (isset(CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'])) { |
689 | 689 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) { |
690 | 690 | foreach ($cadata['certificates'] as $cert_files) { |
691 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
692 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
691 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
692 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
693 | 693 | } |
694 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
695 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
694 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
695 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | } |
@@ -785,14 +785,14 @@ discard block |
||
785 | 785 | if ($global_no_cache) { |
786 | 786 | foreach ($Devs as $dev => $D) { |
787 | 787 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
788 | - $no_cache_dev .= $dev . " "; |
|
788 | + $no_cache_dev .= $dev." "; |
|
789 | 789 | $no_cache_dev_count++; |
790 | 790 | } |
791 | 791 | } |
792 | 792 | } else { |
793 | 793 | foreach ($Devs as $dev => $D) { |
794 | 794 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
795 | - $no_cache_dev .= $dev . " "; |
|
795 | + $no_cache_dev .= $dev." "; |
|
796 | 796 | $no_cache_dev_count++; |
797 | 797 | } |
798 | 798 | } |
@@ -831,13 +831,13 @@ discard block |
||
831 | 831 | $mail->isHTML(FALSE); |
832 | 832 | $mail->CharSet = 'UTF-8'; |
833 | 833 | $mail->From = CONFIG['APPEARANCE']['from-mail']; |
834 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
834 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
835 | 835 | $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']); |
836 | 836 | $mail->Subject = "testing CAT configuration mail"; |
837 | 837 | $mail->Body = "Testing CAT mailing\n"; |
838 | 838 | $sent = $mail->send(); |
839 | 839 | if ($sent) { |
840 | - $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced."); |
|
840 | + $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced."); |
|
841 | 841 | } else { |
842 | 842 | $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
843 | 843 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function __construct() { |
96 | 96 | $this->loggerInstance = new Logging(); |
97 | - $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n"); |
|
97 | + $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n"); |
|
98 | 98 | $this->languageInstance = new Language(); |
99 | 99 | Entity::intoThePotatoes("core"); |
100 | 100 | // some config elements are displayable. We need some dummies to |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $dummy_inst2 = _("organisation"); |
107 | 107 | $dummy_inst3 = _("Identity Provider"); |
108 | 108 | // and do something useless with the strings so that there's no "unused" complaint |
109 | - if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) { |
|
109 | + if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3) < 0) { |
|
110 | 110 | throw new \Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole."); |
111 | 111 | } |
112 | 112 | Entity::$nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * Logs the end of lifetime of the entity to the debug log on level 5. |
122 | 122 | */ |
123 | 123 | public function __destruct() { |
124 | - (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n"); |
|
124 | + (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n"); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) { |
153 | 153 | $loggerInstance = new Logging(); |
154 | - $name = md5(time() . rand()); |
|
154 | + $name = md5(time().rand()); |
|
155 | 155 | $path = ROOT; |
156 | 156 | switch ($purpose) { |
157 | 157 | case 'silverbullet': |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | default: |
170 | 170 | throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n"); |
171 | 171 | } |
172 | - $tmpDir = $path . '/' . $name; |
|
172 | + $tmpDir = $path.'/'.$name; |
|
173 | 173 | $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n"); |
174 | 174 | if (!mkdir($tmpDir, 0700, true)) { |
175 | 175 | if ($failIsFatal) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @return void |
190 | 190 | */ |
191 | 191 | public static function rrmdir($dir) { |
192 | - foreach (glob($dir . '/*') as $file) { |
|
192 | + foreach (glob($dir.'/*') as $file) { |
|
193 | 193 | if (is_dir($file)) { |
194 | 194 | Entity::rrmdir($file); |
195 | 195 | } else { |
@@ -214,12 +214,12 @@ discard block |
||
214 | 214 | } |
215 | 215 | // these substr() are guaranteed to yield actual string data, as the |
216 | 216 | // base string is an MD5 hash - has sufficient length |
217 | - $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-'; |
|
218 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-'; |
|
219 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-'; |
|
220 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-'; |
|
217 | + $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-'; |
|
218 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-'; |
|
219 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-'; |
|
220 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-'; |
|
221 | 221 | $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12); |
222 | - return $prefix . $uuid; |
|
222 | + return $prefix.$uuid; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | for ($i = count($trace); $i--; $i > 0) { |
259 | 259 | if (isset($trace[$i - 1]['class']) && preg_match('/Entity/', $trace[$i - 1]['class'])) { |
260 | 260 | if ($showTrace) { |
261 | - echo "FOUND caller: ".print_r($trace[$i],true). " - class is ".$trace[$i]['class']; |
|
261 | + echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class']; |
|
262 | 262 | } |
263 | 263 | $caller = $trace[$i]; |
264 | 264 | break; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT)); |
270 | 270 | if ($showTrace === TRUE) { |
271 | 271 | echo "<pre>".print_r($trace, true)."</pre>"; |
272 | - echo "CLASS = " . $myName ."<br/>"; |
|
272 | + echo "CLASS = ".$myName."<br/>"; |
|
273 | 273 | } |
274 | 274 | if (preg_match("/diag/", $myName) == 1) { |
275 | 275 | $ret = "diagnostics"; |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | if ($catalogue === NULL) { |
303 | 303 | $theCatalogue = Entity::determineOwnCatalogue($trace); |
304 | 304 | textdomain($theCatalogue); |
305 | - bindtextdomain($theCatalogue, ROOT . "/translation/"); |
|
305 | + bindtextdomain($theCatalogue, ROOT."/translation/"); |
|
306 | 306 | } else { |
307 | 307 | textdomain($catalogue); |
308 | - bindtextdomain($catalogue, ROOT . "/translation/"); |
|
308 | + bindtextdomain($catalogue, ROOT."/translation/"); |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | class CertificationAuthorityEduPkiServer extends EntityWithDBProperties implements CertificationAuthorityInterface |
18 | 18 | { |
19 | 19 | |
20 | - private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | - private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | - private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
20 | + private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | + private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | + private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
23 | 23 | private const EDUPKI_RA_ID = 700; |
24 | 24 | private const EDUPKI_CERT_PROFILE = "Radius Server SOAP"; |
25 | 25 | private const EDUPKI_RA_PKEY_PASSPHRASE = "..."; |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | parent::__construct(); |
36 | 36 | |
37 | 37 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) { |
38 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
38 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
39 | 39 | } |
40 | 40 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) { |
41 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
41 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
42 | 42 | } |
43 | 43 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) { |
44 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
44 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | // initialise connection to eduPKI CA / eduroam RA and send the request to them |
92 | 92 | try { |
93 | 93 | $altArray = [# Array mit den Subject Alternative Names |
94 | - "email:" . $csr["USERMAIL"] |
|
94 | + "email:".$csr["USERMAIL"] |
|
95 | 95 | ]; |
96 | 96 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
97 | 97 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
98 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n"); |
|
99 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n"); |
|
98 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n"); |
|
99 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n"); |
|
100 | 100 | $this->loggerInstance->debug(5, "PARAM_3: "); |
101 | 101 | $this->loggerInstance->debug(5, $altArray); |
102 | - $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n"); |
|
103 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
104 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
105 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n"); |
|
106 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
102 | + $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n"); |
|
103 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
104 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
105 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n"); |
|
106 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
107 | 107 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
108 | 108 | $soapNewRequest = $soapPub->newRequest( |
109 | 109 | CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | } catch (Exception $e) { |
126 | 126 | // PHP 7.1 can do this much better |
127 | 127 | if (is_soap_fault($e)) { |
128 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
128 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
129 | 129 | $e->faultstring |
130 | 130 | }\n"); |
131 | 131 | } |
132 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
132 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
133 | 133 | } |
134 | 134 | try { |
135 | 135 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
164 | 164 | // rather than just using the string. Grr. |
165 | 165 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
166 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
166 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
167 | 167 | // retrieve our RA cert from filesystem |
168 | 168 | // the RA certificates are not needed right now because we |
169 | 169 | // have resorted to S/MIME signatures with openssl command-line |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
176 | 176 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
177 | 177 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
178 | - $execCmd = CONFIG['PATHS']['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
178 | + $execCmd = CONFIG['PATHS']['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
179 | 179 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
180 | 180 | $output = []; |
181 | 181 | $return = 999; |
@@ -184,21 +184,21 @@ discard block |
||
184 | 184 | throw new Exception("Non-zero return value from openssl smime!"); |
185 | 185 | } |
186 | 186 | // and get the signature blob back from the filesystem |
187 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
187 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
188 | 188 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
189 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
190 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
191 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
189 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
190 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
191 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
192 | 192 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
193 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
194 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
193 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
194 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
195 | 195 | if ($soapIssueCert === FALSE) { |
196 | 196 | throw new Exception("The locally approved request was NOT processed by the CA."); |
197 | 197 | } |
198 | 198 | } catch (SoapFault $e) { |
199 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
199 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
200 | 200 | } catch (Exception $e) { |
201 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
201 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
202 | 202 | } |
203 | 203 | return $soapReqnum; |
204 | 204 | } |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | throw new Exception("CAInfo has no root certificate for us!"); |
249 | 249 | } |
250 | 250 | } catch (SoapFault $e) { |
251 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
251 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
252 | 252 | } catch (Exception $e) { |
253 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
253 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
254 | 254 | } |
255 | 255 | return [ |
256 | 256 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
284 | 284 | // rather than just using the string. Grr. |
285 | 285 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
286 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
286 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
287 | 287 | // retrieve our RA cert from filesystem |
288 | 288 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
289 | 289 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
290 | 290 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
291 | - $execCmd = CONFIG['PATHS']['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
291 | + $execCmd = CONFIG['PATHS']['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
292 | 292 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
293 | 293 | $output = []; |
294 | 294 | $return = 999; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | throw new Exception("Non-zero return value from openssl smime!"); |
298 | 298 | } |
299 | 299 | // and get the signature blob back from the filesystem |
300 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
300 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
301 | 301 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
302 | 302 | if ($soapIssueRev === FALSE) { |
303 | 303 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | } catch (Exception $e) { |
306 | 306 | // PHP 7.1 can do this much better |
307 | 307 | if (is_soap_fault($e)) { |
308 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
308 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
309 | 309 | } |
310 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
310 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function soapToXmlInteger($x) |
409 | 409 | { |
410 | - return '<' . $x[0] . '>' |
|
410 | + return '<'.$x[0].'>' |
|
411 | 411 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
412 | - . '</' . $x[0] . '>'; |
|
412 | + . '</'.$x[0].'>'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
@@ -428,9 +428,9 @@ discard block |
||
428 | 428 | // dump private key into directory |
429 | 429 | $outstring = ""; |
430 | 430 | openssl_pkey_export($privateKey, $outstring); |
431 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
431 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
432 | 432 | // PHP can only do one DC in the Subject. But we need three. |
433 | - $execCmd = CONFIG['PATHS']['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username"; |
|
433 | + $execCmd = CONFIG['PATHS']['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username"; |
|
434 | 434 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
435 | 435 | $output = []; |
436 | 436 | $return = 999; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert |
82 | 82 | $status = $oneCert['STATUS']; |
83 | 83 | if ($status == "ISSUED") { |
84 | - $status = "<span onclick='alert(\"".str_replace("\n","\\n",$oneCert['CERT'])."\");'>$status</span>"; |
|
84 | + $status = "<span onclick='alert(\"".str_replace("\n", "\\n", $oneCert['CERT'])."\");'>$status</span>"; |
|
85 | 85 | } |
86 | 86 | echo "<tr><td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td></tr>"; |
87 | 87 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // also send user back to the overview page |
73 | 73 | if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
74 | 74 | // basic sanity checks before we hand this over to openssl |
75 | - $sanitisedCsr = $validator->string($_POST['CSR'] ?? "" , TRUE); |
|
75 | + $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE); |
|
76 | 76 | if (openssl_csr_get_public_key($sanitisedCsr) === FALSE) { |
77 | 77 | throw new Exception("Sorry: Unable to parse the submitted public key - no public key inside?"); |
78 | 78 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $fed = $validator->Federation($_POST['NRO-list']); |
87 | 87 | $country = strtoupper($fed->tld); |
88 | 88 | $DN[] = "C=$country"; |
89 | - $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)]; |
|
89 | + $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)]; |
|
90 | 90 | $DN[] = "CN=comes.from.eduroam.db"; |
91 | 91 | $policies[] = "eduroam IdP"; |
92 | 92 | $policies[] = "eduroam SP"; |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | default: |
105 | 105 | throw new Exception("Sorry: Unknown level of issuance requested."); |
106 | 106 | } |
107 | - echo "<p>" . _("Requesting a certificate with the following properties"); |
|
107 | + echo "<p>"._("Requesting a certificate with the following properties"); |
|
108 | 108 | echo "<ul>"; |
109 | - echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
|
110 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>"; |
|
111 | - echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, <[email protected]>').") . "</li>"; |
|
109 | + echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; |
|
110 | + echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>"; |
|
111 | + echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, <[email protected]>').")."</li>"; |
|
112 | 112 | echo "</ul></p>"; |
113 | 113 | /* $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes); |
114 | 114 | if (is_resource($ossl)) { |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | throw new Exception("Calling openssl in a fancy way did not work."); |
122 | 122 | } |
123 | 123 | echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */ |
124 | - $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country]; |
|
124 | + $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country]; |
|
125 | 125 | // our certs can be good for max 5 years |
126 | 126 | $fed->requestCertificate($newCsrWithMeta, 1825); |
127 | 127 | echo "<p>"._("The certificate was requested.")."</p>"; |
128 | 128 | ?> |
129 | 129 | <form action="overview_certificates.php" method="GET"> |
130 | - <button type="submit"><?php echo _("Back to Certificate Overview");?></button> |
|
130 | + <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> |
|
131 | 131 | </form> |
132 | 132 | <?php |
133 | 133 | echo $deco->footer(); |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | |
137 | 137 | // if we did not get a SAVE button, display UI for a fresh request instead |
138 | 138 | ?> |
139 | - <h2><?php echo _("1. Certificate Holder Details");?></h2> |
|
139 | + <h2><?php echo _("1. Certificate Holder Details"); ?></h2> |
|
140 | 140 | <form action="action_req_certificate.php" method="POST"> |
141 | 141 | <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input> |
142 | 142 | <?php |
143 | 143 | if (count($feds) == 1) { |
144 | 144 | $fedObject = new \core\Federation($feds[0]['value']); |
145 | - echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>"; |
|
146 | - echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>'; |
|
145 | + echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>"; |
|
146 | + echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>'; |
|
147 | 147 | } else { |
148 | 148 | ?> |
149 | 149 | <select name="NRO-list" id="NRO-list"> |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | <?php |
152 | 152 | foreach ($feds as $oneFed) { |
153 | 153 | $fedObject = new \core\Federation($oneFed['value']); |
154 | - echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>"; |
|
154 | + echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>"; |
|
155 | 155 | } |
156 | 156 | ?> |
157 | 157 | </select> |
@@ -171,15 +171,15 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | foreach ($allIdPs as $id => $name) { |
174 | - echo '<option value="' . $id . '">' . $name . "</option>"; |
|
174 | + echo '<option value="'.$id.'">'.$name."</option>"; |
|
175 | 175 | } |
176 | 176 | ?> |
177 | 177 | </select> |
178 | 178 | <br/> |
179 | - <h2><?php echo _("2. CSR generation");?></h2> |
|
180 | - <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p> |
|
179 | + <h2><?php echo _("2. CSR generation"); ?></h2> |
|
180 | + <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> |
|
181 | 181 | <p>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /DC=test/DC=test/DC=eduroam/C=XY/O=WillBeReplaced/CN=will.be.replaced</p> |
182 | - <h2><?php echo _("3. Submission");?></h2> |
|
182 | + <h2><?php echo _("3. Submission"); ?></h2> |
|
183 | 183 | <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |
184 | 184 | <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button> |
185 | 185 | </form> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * <base_url>/copyright.php after deploying the software |
21 | 21 | */ |
22 | 22 | |
23 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
23 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
24 | 24 | |
25 | 25 | $auth = new \web\lib\admin\Authentication(); |
26 | 26 | $loggerInstance = new \core\common\Logging(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | switch ($_POST['submitbutton']) { |
41 | 41 | case web\lib\common\FormElements::BUTTON_DELETE: |
42 | 42 | $myInstOriginal->destroy(); |
43 | - $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId); |
|
43 | + $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId); |
|
44 | 44 | header("Location: overview_user.php"); |
45 | 45 | exit; |
46 | 46 | case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART: |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | // flush all IdP attributes and send user to creation wizard |
52 | 52 | $myInstOriginal->flushAttributes(); |
53 | - $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId); |
|
53 | + $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId); |
|
54 | 54 | header("Location: edit_idp.php?inst_id=$instId&wizard=true"); |
55 | 55 | exit; |
56 | 56 | case web\lib\common\FormElements::BUTTON_SAVE: |
@@ -63,19 +63,19 @@ discard block |
||
63 | 63 | exit(0); |
64 | 64 | } |
65 | 65 | $inst_name = $myInstOriginal->name; |
66 | - echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>"; |
|
66 | + echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>"; |
|
67 | 67 | echo "<table>"; |
68 | 68 | echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES); |
69 | 69 | echo "</table>"; |
70 | 70 | // delete cached logo, if present |
71 | - $dir = ROOT . '/web/downloads/logos/'; |
|
72 | - $globResult = glob($dir . $myInstOriginal->identifier . "_*.png"); |
|
71 | + $dir = ROOT.'/web/downloads/logos/'; |
|
72 | + $globResult = glob($dir.$myInstOriginal->identifier."_*.png"); |
|
73 | 73 | if ($globResult === FALSE) { // we should catch the improbable error condition |
74 | 74 | $globResult = []; |
75 | 75 | } |
76 | 76 | array_map('unlink', $globResult); |
77 | 77 | $loggerInstance->debug(4, "UNLINK from $dir\n"); |
78 | - $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed"); |
|
78 | + $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed"); |
|
79 | 79 | |
80 | 80 | // re-instantiate ourselves... profiles need fresh data |
81 | 81 | |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | |
86 | 86 | if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) { |
87 | 87 | foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) { |
88 | - $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") ); |
|
88 | + $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)")); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | 92 | foreach ($myInstReinstantiated->getAttributes("media:SSID_with_legacy") as $ssidname) { |
93 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)"); |
|
93 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)"); |
|
94 | 94 | } |
95 | 95 | foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) { |
96 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)"); |
|
96 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES)"); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | echo "<table>"; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if (count($ssids) > 0) { |
102 | 102 | $printedlist = ""; |
103 | 103 | foreach ($ssids as $names) { |
104 | - $printedlist = $printedlist . "$names "; |
|
104 | + $printedlist = $printedlist."$names "; |
|
105 | 105 | } |
106 | 106 | echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured")); |
107 | 107 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // did we get an email address? then, show the silverbullet jumpstart button |
130 | 130 | // otherwise, issue a smartass comment |
131 | 131 | if (count($myInstReinstantiated->getAttributes("support:email")) > 0) { |
132 | - echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>"; |
|
132 | + echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>"; |
|
133 | 133 | } else { |
134 | 134 | echo "<table>"; |
135 | 135 | echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!")); |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") { |
140 | - echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>"; |
|
140 | + echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>"; |
|
141 | 141 | } |
142 | 142 | } |
143 | - echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>"; |
|
143 | + echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>"; |
|
144 | 144 | echo $deco->footer(); |
145 | 145 | break; |
146 | 146 | default: |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $auth = new \web\lib\admin\Authentication(); |
25 | 25 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $profile = $validator->Profile($_GET['profile_id'], $my_inst->identifier); |
56 | 56 | } else { |
57 | 57 | $profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS); |
58 | - $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $my_inst->identifier . " - Profile created"); |
|
58 | + $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$my_inst->identifier." - Profile created"); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if (!$profile instanceof \core\ProfileRADIUS) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $uiElements = new web\lib\admin\UIElements(); |
118 | 118 | // set realm info, if submitted |
119 | 119 | if ($realm !== FALSE) { |
120 | - $profile->setRealm($anonLocal . "@" . $realm); |
|
120 | + $profile->setRealm($anonLocal."@".$realm); |
|
121 | 121 | echo $uiElements->boxOkay(sprintf(_("Realm: <strong>%s</strong>"), $realm)); |
122 | 122 | } else { |
123 | 123 | $profile->setRealm(""); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!")); |
141 | 141 | } else { |
142 | 142 | $profile->setRealmcheckUser(true, $checkuser_name); |
143 | - echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm)); |
|
143 | + echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm)); |
|
144 | 144 | } |
145 | 145 | } else { |
146 | 146 | $profile->setRealmCheckUser(false); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } else { |
154 | 154 | $profile->setInputVerificationPreference($verify, $hint); |
155 | 155 | if ($hint !== FALSE) { |
156 | - $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm); |
|
156 | + $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm); |
|
157 | 157 | } else { |
158 | 158 | $extratext = "."; |
159 | 159 | } |
@@ -190,30 +190,30 @@ discard block |
||
190 | 190 | echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>")); |
191 | 191 | } |
192 | 192 | |
193 | - $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed"); |
|
193 | + $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed"); |
|
194 | 194 | |
195 | 195 | // re-instantiate $profile, we need to do completion checks and need fresh data for isEapTypeDefinitionComplete() |
196 | 196 | foreach (\core\common\EAP::listKnownEAPTypes() as $a) { |
197 | 197 | if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor |
198 | 198 | continue; |
199 | 199 | } |
200 | - if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) { |
|
201 | - $priority = (int) $_POST[$a->getPrintableRep() . "-priority"]; |
|
200 | + if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) { |
|
201 | + $priority = (int) $_POST[$a->getPrintableRep()."-priority"]; |
|
202 | 202 | // add EAP type to profile as requested, but ... |
203 | 203 | $profile->addSupportedEapMethod($a, $priority); |
204 | - $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed"); |
|
204 | + $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed"); |
|
205 | 205 | // see if we can enable the EAP type, or if info is missing |
206 | 206 | $eapcompleteness = $profile->isEapTypeDefinitionComplete($a); |
207 | 207 | if ($eapcompleteness === true) { |
208 | - echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>"); |
|
208 | + echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>"); |
|
209 | 209 | } else { |
210 | 210 | $warntext = ""; |
211 | 211 | if (is_array($eapcompleteness)) { |
212 | 212 | foreach ($eapcompleteness as $item) { |
213 | - $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> "; |
|
213 | + $warntext .= "<strong>".$uiElements->displayName($item)."</strong> "; |
|
214 | 214 | } |
215 | 215 | } |
216 | - echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you.")); |
|
216 | + echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext)."<br/>"._("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you.")); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | <?php |
230 | 230 | if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) { |
231 | 231 | echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'> |
232 | - <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button> |
|
232 | + <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button> |
|
233 | 233 | </form>"; |
234 | 234 | } |
235 | 235 | echo $deco->footer(); |