@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | !define MUI_HEADERIMAGE_BITMAP "cat_150.bmp" |
136 | 136 | !define MUI_COMPONENTSPAGE_SMALLDESC |
137 | 137 | |
138 | -!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>" |
|
139 | -!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi( _("Installation complete"))?>" |
|
140 | -!define FAREWELL_TEXT "<?php WindowsCommon::echo_nsi( _("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi( _("Your system is ready."))?>" |
|
141 | -!define FAREWELL_FAIL "<?php WindowsCommon::echo_nsi( _("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi( _("Please contact \${SUPPORT}."))?>" |
|
138 | +!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>" |
|
139 | +!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi(_("Installation complete"))?>" |
|
140 | +!define FAREWELL_TEXT "<?php WindowsCommon::echo_nsi(_("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Your system is ready."))?>" |
|
141 | +!define FAREWELL_FAIL "<?php WindowsCommon::echo_nsi(_("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Please contact \${SUPPORT}."))?>" |
|
142 | 142 | ;-------------------------------- |
143 | 143 | ;Languages |
144 | 144 | !insertmacro MUI_LANGUAGE "${LANG}" |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | ;-------------------------------- |
147 | 147 | ; License file |
148 | 148 | !ifdef LICENSE_FILE |
149 | -LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi( _("Accept"))?>" |
|
149 | +LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi(_("Accept"))?>" |
|
150 | 150 | LicenseText "<?php WindowsCommon::echo_nsi(_("If you accept the conditions then select Accept and then click Install to continue."))?>" |
151 | 151 | LicenseData ${LICENSE_FILE} |
152 | 152 | !endif |
153 | 153 | |
154 | 154 | ;----------------------------------- |
155 | 155 | |
156 | -MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi( _("Finish"))?>" |
|
156 | +MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi(_("Finish"))?>" |
|
157 | 157 | ;---------------------------------- |
158 | 158 | ; FUNCTIONS |
159 | 159 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | !macro install_ca_cert ca_file ca_fingerprint level |
188 | 188 | !insertmacro debug_cat 2 "locating certificate SHA=${ca_fingerprint} Level=${level}" |
189 | - DetailPrint "<?php WindowsCommon::echo_nsi( _("searching for certificate"))?> ${ca_file}" |
|
189 | + DetailPrint "<?php WindowsCommon::echo_nsi(_("searching for certificate"))?> ${ca_file}" |
|
190 | 190 | File "${ca_file}" |
191 | 191 | nsArray::Set Delete_files "${ca_file}" |
192 | 192 | !insertmacro debug_cat 2 "Testing machine store root" |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | ${EndIf} |
249 | 249 | !insertmacro debug_cat 2 "installing certificate $TEMP\${ca_file}" |
250 | 250 | !insertmacro debug_cat 3 "Execute: certutil -addstore -user ${level} $TEMP\${ca_file}" |
251 | - DetailPrint "<?php WindowsCommon::echo_nsi( _("installing certificate"))?> ${ca_file}" |
|
251 | + DetailPrint "<?php WindowsCommon::echo_nsi(_("installing certificate"))?> ${ca_file}" |
|
252 | 252 | nsExec::Exec '"certutil" -addstore -user ${level} "$TEMP"\${ca_file}' |
253 | 253 | Pop $0 |
254 | 254 | !insertmacro debug_cat 3 "certutil returned $0" |
255 | 255 | ${If} $0 != 0 |
256 | 256 | IfSilent +2 |
257 | - MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("could not install certificate"))?> ${ca_file}" |
|
257 | + MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("could not install certificate"))?> ${ca_file}" |
|
258 | 258 | !insertmacro debug_cat 1 "could not install certificate ${ca_file}" |
259 | 259 | ${EndIf} |
260 | 260 | no_install_${ca_file}: |
@@ -461,26 +461,26 @@ discard block |
||
461 | 461 | pop $R0 |
462 | 462 | ${If} $tkip_count > 0 |
463 | 463 | ${If} $aes_count > 1 |
464 | - StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profiles are preferred. Always use them if you have a choice."))?>" |
|
464 | + StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profiles are preferred. Always use them if you have a choice."))?>" |
|
465 | 465 | ${Else} |
466 | - StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profile is preferred. Always use it if you have a choice."))?>" |
|
466 | + StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profile is preferred. Always use it if you have a choice."))?>" |
|
467 | 467 | ${EndIf} |
468 | 468 | ${Else} |
469 | 469 | StrCpy $R1 "" |
470 | 470 | ${EndIf} |
471 | 471 | ${If} $profile_count > 0 |
472 | - StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\ |
|
473 | -<?php WindowsCommon::echo_nsi( _("The installer will create the following wireless profiles:"))?>$\r$\n\ |
|
472 | + StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\ |
|
473 | +<?php WindowsCommon::echo_nsi(_("The installer will create the following wireless profiles:"))?>$\r$\n\ |
|
474 | 474 | $R0.\ |
475 | 475 | $R1$\r$\n$\n\ |
476 | -<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\ |
|
476 | +<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\ |
|
477 | 477 | EMAIL: ${SUPPORT}$\r$\n\ |
478 | 478 | WWW: ${URL}" |
479 | 479 | ${Else} |
480 | -StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\ |
|
481 | -<?php WindowsCommon::echo_nsi( _("The installer will create the wireless profile:"))?> $R0.\ |
|
480 | +StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\ |
|
481 | +<?php WindowsCommon::echo_nsi(_("The installer will create the wireless profile:"))?> $R0.\ |
|
482 | 482 | $R1$\r$\n$\n\ |
483 | -<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\ |
|
483 | +<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\ |
|
484 | 484 | EMAIL: ${SUPPORT}$\r$\n\ |
485 | 485 | WWW: ${URL}" |
486 | 486 | ${EndIf} |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0 |
507 | 507 | ;TRANSLATION |
508 | 508 | nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 46u -130u -32u "$welcome_message\ |
509 | -$\r$\n$\r$\n<?php WindowsCommon::echo_nsi( _("Installer created with software from the GEANT project."))?>" |
|
509 | +$\r$\n$\r$\n<?php WindowsCommon::echo_nsi(_("Installer created with software from the GEANT project."))?>" |
|
510 | 510 | Pop $TEXT |
511 | 511 | |
512 | 512 | SetCtlColors $DIALOG "" 0xffffff |
@@ -619,18 +619,18 @@ discard block |
||
619 | 619 | ${If} $wireless_result == 1 |
620 | 620 | !insertmacro debug_cat 1 "wlan_test.exe did not find wireless configuration service" |
621 | 621 | IfSilent +2 |
622 | - MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("Windows wireless configuration service is not enabled. The installer cannot continue."))?>" |
|
622 | + MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("Windows wireless configuration service is not enabled. The installer cannot continue."))?>" |
|
623 | 623 | Call Cleanup |
624 | 624 | ${EndIf} |
625 | 625 | ${If} $wireless_result == 2 |
626 | 626 | IfSilent +2 |
627 | - MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. The installer cannot continue."))?>" |
|
627 | + MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. The installer cannot continue."))?>" |
|
628 | 628 | Call Cleanup |
629 | 629 | ${EndIf} |
630 | 630 | ${Else} |
631 | 631 | ${If} $wireless_result > 0 |
632 | 632 | IfSilent +3 |
633 | - MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes |
|
633 | + MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes |
|
634 | 634 | Call Cleanup |
635 | 635 | wired_yes: |
636 | 636 | Push 1 |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | ${If} $wired == 1 |
647 | 647 | ${If} $force_wired == 0 |
648 | 648 | IfSilent wired |
649 | - MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("Do you want to enable access on wired interfaces?"))?>" IDYES wired |
|
649 | + MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("Do you want to enable access on wired interfaces?"))?>" IDYES wired |
|
650 | 650 | Push 0 |
651 | 651 | Pop $wired |
652 | 652 | ${EndIf} |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | ;================================ |
688 | 688 | |
689 | 689 | Function ShowInstfiles |
690 | - !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Profiles installation"))?>" " " |
|
690 | + !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Profiles installation"))?>" " " |
|
691 | 691 | FunctionEnd |
692 | 692 | ;================================ |
693 | 693 | ; Check if a wireless profile exist and put it on delete list |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | |
707 | 707 | Function FindProfile |
708 | 708 | Pop $R8 |
709 | - DetailPrint "<?php WindowsCommon::echo_nsi( _("Checking for profile \$R8"))?>" |
|
709 | + DetailPrint "<?php WindowsCommon::echo_nsi(_("Checking for profile \$R8"))?>" |
|
710 | 710 | !insertmacro debug_cat 2 "Checking for profile $R8" |
711 | 711 | !insertmacro debug_cat 3 "Exec: $Netsh wlan show profiles $R8" |
712 | 712 | nsExec::Exec '"$Netsh" wlan show profiles "$R8"' |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | !insertmacro debug_cat 4 "netsh returned $0" |
715 | 715 | ${If} $0 == 0 |
716 | 716 | !insertmacro debug_cat 1 "found profile $R8" |
717 | - DetailPrint "<?php WindowsCommon::echo_nsi( _("found profile \$R8"))?>" |
|
717 | + DetailPrint "<?php WindowsCommon::echo_nsi(_("found profile \$R8"))?>" |
|
718 | 718 | Push 0 |
719 | 719 | ${Else} |
720 | 720 | !insertmacro debug_cat 1 "profile $R8 not found" |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | ${If} $Symantec_installed != 0 |
810 | 810 | !insertmacro debug_cat 3 "Symantec problem" |
811 | 811 | IfSilent +2 |
812 | - MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>" |
|
812 | + MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>" |
|
813 | 813 | Exec '"explorer" /select,"$EXEDIR\inst_cat.cmd"' |
814 | 814 | Quit |
815 | 815 | |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | Function PFXCertificateSelect |
1098 | 1098 | !ifndef SILVERBULLET |
1099 | 1099 | ;TRANSLATION |
1100 | -!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>" |
|
1100 | +!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>" |
|
1101 | 1101 | ;TRANSLATION |
1102 | 1102 | IfSilent +2 |
1103 | 1103 | MessageBox MB_OK "<?php WindowsCommon::echo_nsi(_("Preparing to install personal certificate."))?>$\r$\n<?php WindowsCommon::echo_nsi(_("Click OK to continue"))?> " |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | $certPasswordLength = strlen($certPasswordLabel); |
1114 | 1114 | $certUsernameLabel = WindowsCommon::sprint_nsi(_("Username:")); |
1115 | 1115 | $certUsernameLength = strlen($certUsernameLabel); |
1116 | - $labelLength = max($certPasswordLength,$certUsernameLength); |
|
1116 | + $labelLength = max($certPasswordLength, $certUsernameLength); |
|
1117 | 1117 | ?> |
1118 | 1118 | ${NSD_CreateLabel} 0 0 100% 32u "<?php WindowsCommon::echo_nsi(_("Selected file: \$Cert_file"))?>" |
1119 | 1119 | !else |
@@ -1130,11 +1130,11 @@ discard block |
||
1130 | 1130 | !insertmacro debug_cat 3 "Vista level (Vista without Service pack): $VistaNoSP"; |
1131 | 1131 | ${If} $VistaNoSP == 0 |
1132 | 1132 | !ifdef PFX_USERNAME |
1133 | - !define LABEL_LENGTH "<?php echo($labelLength*3.5)?>u" |
|
1134 | - !define TEXT_START "<?php echo($labelLength*3.5 +5)?>u" |
|
1133 | + !define LABEL_LENGTH "<?php echo($labelLength * 3.5)?>u" |
|
1134 | + !define TEXT_START "<?php echo($labelLength * 3.5 + 5)?>u" |
|
1135 | 1135 | !else |
1136 | - !define LABEL_LENGTH "<?php echo($certPasswordLength*3.5)?>u" |
|
1137 | - !define TEXT_START "<?php echo($certPasswordLength*3.5 +5)?>u" |
|
1136 | + !define LABEL_LENGTH "<?php echo($certPasswordLength * 3.5)?>u" |
|
1137 | + !define TEXT_START "<?php echo($certPasswordLength * 3.5 + 5)?>u" |
|
1138 | 1138 | !endif |
1139 | 1139 | ${NSD_CreateLabel} 0 35u ${LABEL_LENGTH} 12u "<?php echo $certPasswordLabel?>" |
1140 | 1140 | ${NSD_CreatePassword} ${TEXT_START} 34.5u 120u 12u "" |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | Section "-start" |
1497 | 1497 | SectionIn RO |
1498 | 1498 | |
1499 | -!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Installation"))?>" "<?php WindowsCommon::echo_nsi( _("Checking for existing wireless profiles"))?>" |
|
1499 | +!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Installation"))?>" "<?php WindowsCommon::echo_nsi(_("Checking for existing wireless profiles"))?>" |
|
1500 | 1500 | !ifndef PWD |
1501 | 1501 | !include "certs.nsh" |
1502 | 1502 | !endif |
@@ -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 | /** |
26 | 26 | * Checks if the profile is a valid SB profile belonging to the federation |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $inputRaw = file_get_contents('php://input'); |
70 | 70 | $inputDecoded = json_decode($inputRaw, TRUE); |
71 | 71 | if (!is_array($inputDecoded)) { |
72 | - $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data." . json_last_error_msg() . $inputRaw); |
|
72 | + $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data.".json_last_error_msg().$inputRaw); |
|
73 | 73 | exit(1); |
74 | 74 | } |
75 | 75 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | throw new Exception("A required parameter is missing, and this wasn't caught earlier?!"); |
159 | 159 | } |
160 | 160 | $newtokens = $mgmt->createTokens(true, [$admin], $idp); |
161 | - $URL = "https://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/action_enrollment.php?token=" . array_keys($newtokens)[0]; |
|
161 | + $URL = "https://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/action_enrollment.php?token=".array_keys($newtokens)[0]; |
|
162 | 162 | $success = ["TOKEN URL" => $URL, "TOKEN" => array_keys($newtokens)[0]]; |
163 | 163 | // done with the essentials - display in response. But if we also have an email address, send it there |
164 | 164 | $email = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_TARGETMAIL); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if ($found) { |
196 | 196 | $adminApi->returnSuccess([]); |
197 | 197 | } |
198 | - $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP " . $idp->identifier); |
|
198 | + $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP ".$idp->identifier); |
|
199 | 199 | break; |
200 | 200 | case web\lib\admin\API::ACTION_STATISTICS_FED: |
201 | 201 | $adminApi->returnSuccess($fed->downloadStats("array")); |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | $outer = ""; |
243 | 243 | $profile->setAnonymousIDSupport(FALSE); |
244 | 244 | } else { |
245 | - $outer = $outer . "@"; |
|
245 | + $outer = $outer."@"; |
|
246 | 246 | $profile->setAnonymousIDSupport(TRUE); |
247 | 247 | } |
248 | - $profile->setRealm($outer . $realm); |
|
248 | + $profile->setRealm($outer.$realm); |
|
249 | 249 | } |
250 | 250 | /* const AUXATTRIB_PROFILE_TESTUSER = 'ATTRIB-PROFILE-TESTUSER'; */ |
251 | 251 | $testuser = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_PROFILE_TESTUSER); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | // extract relevant subset of information from cert objects |
474 | 474 | $certDetails = []; |
475 | 475 | foreach ($certs as $cert) { |
476 | - $certDetails[$cert->ca_type . ":" . $cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation]; |
|
476 | + $certDetails[$cert->ca_type.":".$cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation]; |
|
477 | 477 | } |
478 | 478 | $adminApi->returnSuccess($certDetails); |
479 | 479 | break; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | use \Exception; |
25 | 25 | |
26 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
26 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * This class talks to end users, asking them annoying questions to get to the |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), |
76 | 76 | "FACTOR_YES" => 0.6, // that's good, and somewhat encouraging |
77 | 77 | "FACTOR_NO" => 3, // that is almost a smoking gun |
78 | - "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"),$confAssistantText)], |
|
78 | + "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"), $confAssistantText)], |
|
79 | 79 | 3 => ["AREA" => AbstractTest::INFRA_DEVICE, |
80 | 80 | "TXT" => _("Did you recently change the configuration on your device?"), |
81 | 81 | "FACTOR_YES" => 3, // that is almost a smoking gun |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | "TXT" => _("If you use more than one device: do your other devices still work?"), |
91 | 91 | "FACTOR_YES" => 0.33, // seems that all is okay with the account as such |
92 | 92 | "FACTOR_NO" => 3, // now that is suspicious indeed |
93 | - "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"),], |
|
93 | + "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"), ], |
|
94 | 94 | 6 => ["AREA" => AbstractTest::INFRA_SP_80211, |
95 | 95 | "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), |
96 | 96 | "FACTOR_YES" => 3, |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $questionDetails = $this->qaArray[$questionNumber]; |
125 | 125 | if ($answer === TRUE) { |
126 | 126 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_YES"]; |
127 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n"); |
|
127 | + $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n"); |
|
128 | 128 | $factor = $questionDetails["FACTOR_YES"]; |
129 | 129 | } elseif ($answer === FALSE) { |
130 | 130 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_NO"]; |
131 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n"); |
|
131 | + $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n"); |
|
132 | 132 | $factor = $questionDetails["FACTOR_NO"]; |
133 | 133 | } else { |
134 | 134 | $factor = 1; |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions; |
139 | 139 | $_SESSION["SUSPECTS"] = $this->possibleFailureReasons; |
140 | 140 | $_SESSION["EVIDENCE"] = $this->additionalFindings; |
141 | - $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']); |
|
142 | - $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']); |
|
141 | + $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']); |
|
142 | + $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // if both are identical, take any of the questions in the pool of both |
159 | 159 | foreach ($this->qaArray as $questionNumber => $questionDetails) { |
160 | 160 | // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it |
161 | - if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) { |
|
161 | + if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
162 | 162 | return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]); |
163 | 163 | } |
164 | 164 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @return string JSON encoded array with all the info we have |
172 | 172 | */ |
173 | 173 | public function getCurrentGuessState() { |
174 | - return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]); |
|
174 | + return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | use \Exception; |
36 | 36 | |
37 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
37 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Test suite to verify that an EAP setup is actually working as advertised in |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | - $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true)); |
|
168 | + $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true)); |
|
169 | 169 | $this->loggerInstance->debug(4, print_r($expectedServerNames, true)); |
170 | 170 | $this->loggerInstance->debug(4, print_r($expectedCABundle, true)); |
171 | 171 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME; |
253 | 253 | continue; // otherwise we'd ALSO complain that it's not a real hostname |
254 | 254 | } |
255 | - if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) { |
|
255 | + if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) { |
|
256 | 256 | $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME; |
257 | 257 | } |
258 | 258 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) { |
278 | 278 | $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE; |
279 | 279 | } |
280 | - $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE)); |
|
280 | + $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE)); |
|
281 | 281 | if ($intermediateCa['basicconstraints_set'] == 0) { |
282 | 282 | $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS; |
283 | 283 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function udpReachability($probeindex, $opnameCheck = TRUE, $frag = TRUE) { |
325 | 325 | // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy |
326 | 326 | // the following PEM data is one of the SENSE EAPLab client certs (not secret at all) |
327 | - $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12"); |
|
327 | + $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12"); |
|
328 | 328 | if ($clientcert === FALSE) { |
329 | 329 | throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!"); |
330 | 330 | } |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) { |
334 | 334 | return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert); |
335 | 335 | } |
336 | - return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert); |
|
336 | + return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | return RADIUSTests::CERTPROB_NO_CDP_HTTP; |
354 | 354 | } |
355 | 355 | // first and second sub-match is the full URL... check it |
356 | - $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2])); |
|
356 | + $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2])); |
|
357 | 357 | if ($crlcontent === FALSE) { |
358 | 358 | return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL; |
359 | 359 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | fclose($pipes[1]); |
385 | 385 | fclose($pipes[2]); |
386 | 386 | $retval = proc_close($process); |
387 | - if ($retval != 0 || !preg_match("/BEGIN X509 CRL/",$pem)) { |
|
387 | + if ($retval != 0 || !preg_match("/BEGIN X509 CRL/", $pem)) { |
|
388 | 388 | // this was not a real CRL |
389 | 389 | return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL; |
390 | 390 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $origLength = strlen($hex); |
407 | 407 | for ($i = 1; $i < $origLength; $i++) { |
408 | 408 | if ($i % 2 == 1 && $i != strlen($hex)) { |
409 | - $spaced .= $hex[$i] . " "; |
|
409 | + $spaced .= $hex[$i]." "; |
|
410 | 410 | } else { |
411 | 411 | $spaced .= $hex[$i]; |
412 | 412 | } |
@@ -489,19 +489,19 @@ discard block |
||
489 | 489 | $eapText = \core\common\EAP::eapDisplayName($eaptype); |
490 | 490 | $config = ' |
491 | 491 | network={ |
492 | - ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing" |
|
492 | + ssid="' . CONFIG['APPEARANCE']['productname'].' testing" |
|
493 | 493 | key_mgmt=WPA-EAP |
494 | 494 | proto=WPA2 |
495 | 495 | pairwise=CCMP |
496 | 496 | group=CCMP |
497 | 497 | '; |
498 | 498 | // phase 1 |
499 | - $config .= 'eap=' . $eapText['OUTER'] . "\n"; |
|
499 | + $config .= 'eap='.$eapText['OUTER']."\n"; |
|
500 | 500 | $logConfig = $config; |
501 | 501 | // phase 2 if applicable; all inner methods have passwords |
502 | 502 | if (isset($eapText['INNER']) && $eapText['INNER'] != "") { |
503 | - $config .= ' phase2="auth=' . $eapText['INNER'] . "\"\n"; |
|
504 | - $logConfig .= ' phase2="auth=' . $eapText['INNER'] . "\"\n"; |
|
503 | + $config .= ' phase2="auth='.$eapText['INNER']."\"\n"; |
|
504 | + $logConfig .= ' phase2="auth='.$eapText['INNER']."\"\n"; |
|
505 | 505 | } |
506 | 506 | // all methods set a password, except EAP-TLS |
507 | 507 | if ($eaptype != \core\common\EAP::EAPTYPE_TLS) { |
@@ -517,11 +517,11 @@ discard block |
||
517 | 517 | } |
518 | 518 | |
519 | 519 | // inner identity |
520 | - $config .= ' identity="' . $inner . "\"\n"; |
|
521 | - $logConfig .= ' identity="' . $inner . "\"\n"; |
|
520 | + $config .= ' identity="'.$inner."\"\n"; |
|
521 | + $logConfig .= ' identity="'.$inner."\"\n"; |
|
522 | 522 | // outer identity, may be equal |
523 | - $config .= ' anonymous_identity="' . $outer . "\"\n"; |
|
524 | - $logConfig .= ' anonymous_identity="' . $outer . "\"\n"; |
|
523 | + $config .= ' anonymous_identity="'.$outer."\"\n"; |
|
524 | + $logConfig .= ' anonymous_identity="'.$outer."\"\n"; |
|
525 | 525 | // done |
526 | 526 | $config .= "}"; |
527 | 527 | $logConfig .= "}"; |
@@ -582,13 +582,13 @@ discard block |
||
582 | 582 | * @return string the command-line for eapol_test |
583 | 583 | */ |
584 | 584 | private function eapolTestConfig($probeindex, $opName, $frag) { |
585 | - $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] . |
|
586 | - " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] . |
|
587 | - " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] . |
|
588 | - " -o serverchain.pem" . |
|
589 | - " -c ./udp_login_test.conf" . |
|
590 | - " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " . |
|
591 | - " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " "; |
|
585 | + $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test']. |
|
586 | + " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip']. |
|
587 | + " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret']. |
|
588 | + " -o serverchain.pem". |
|
589 | + " -c ./udp_login_test.conf". |
|
590 | + " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ". |
|
591 | + " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." "; |
|
592 | 592 | if ($opName) { |
593 | 593 | $cmdline .= '-N126:s:"1cat.eduroam.org" '; |
594 | 594 | } |
@@ -617,10 +617,10 @@ discard block |
||
617 | 617 | * @throws Exception |
618 | 618 | */ |
619 | 619 | private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) { |
620 | - if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) { |
|
620 | + if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) { |
|
621 | 621 | throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n"); |
622 | 622 | } |
623 | - if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) { |
|
623 | + if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) { |
|
624 | 624 | throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n"); |
625 | 625 | } |
626 | 626 | // make a copy of the EAP-received chain and add the configured intermediates, if any |
@@ -634,15 +634,15 @@ discard block |
||
634 | 634 | } |
635 | 635 | if ($decoded['ca'] == 1) { |
636 | 636 | if ($decoded['root'] == 1) { // save CAT roots to the root directory |
637 | - file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']); |
|
638 | - file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']); |
|
637 | + file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']); |
|
638 | + file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']); |
|
639 | 639 | $catRoots[] = $decoded['pem']; |
640 | 640 | } else { // save the intermediates to allcerts directory |
641 | - file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']); |
|
641 | + file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']); |
|
642 | 642 | $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded)); |
643 | 643 | if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) { |
644 | 644 | $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain"); |
645 | - file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]); |
|
645 | + file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]); |
|
646 | 646 | } |
647 | 647 | $catIntermediates[] = $decoded['pem']; |
648 | 648 | } |
@@ -651,26 +651,26 @@ discard block |
||
651 | 651 | // save all intermediate certificates and CRLs to separate files in |
652 | 652 | // both root-ca directories |
653 | 653 | foreach ($eapIntermediates as $index => $onePem) { |
654 | - file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem); |
|
655 | - file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem); |
|
654 | + file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem); |
|
655 | + file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem); |
|
656 | 656 | } |
657 | 657 | foreach ($eapIntermediateCRLs as $index => $onePem) { |
658 | - file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem); |
|
659 | - file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem); |
|
658 | + file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem); |
|
659 | + file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem); |
|
660 | 660 | } |
661 | 661 | |
662 | 662 | $checkstring = ""; |
663 | 663 | if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) { |
664 | 664 | $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain"); |
665 | 665 | $checkstring = "-crl_check_all"; |
666 | - file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]); |
|
667 | - file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]); |
|
666 | + file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]); |
|
667 | + file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]); |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | |
671 | 671 | // now c_rehash the root CA directory ... |
672 | - system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null"); |
|
673 | - system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null"); |
|
672 | + system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null"); |
|
673 | + system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null"); |
|
674 | 674 | return $checkstring; |
675 | 675 | } |
676 | 676 | |
@@ -701,12 +701,12 @@ discard block |
||
701 | 701 | // the error log will complain if we run this test against an empty file of certs |
702 | 702 | // so test if there's something PEMy in the file at all |
703 | 703 | if (filesize("$tmpDir/serverchain.pem") > 10) { |
704 | - exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
705 | - $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n"); |
|
706 | - $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n"); |
|
707 | - exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
708 | - $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n"); |
|
709 | - $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n"); |
|
704 | + exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
705 | + $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n"); |
|
706 | + $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n"); |
|
707 | + exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
708 | + $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n"); |
|
709 | + $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n"); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | // we are UNHAPPY if no names match! |
773 | 773 | $happiness = "UNHAPPY"; |
774 | 774 | foreach ($this->expectedServerNames as $expectedName) { |
775 | - $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE)); |
|
775 | + $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE)); |
|
776 | 776 | if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) { |
777 | 777 | $this->loggerInstance->debug(4, "Totally happy!"); |
778 | 778 | $happiness = "TOTALLY"; |
@@ -816,11 +816,11 @@ discard block |
||
816 | 816 | $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password); |
817 | 817 | // the config intentionally does not include CA checking. We do this |
818 | 818 | // ourselves after getting the chain with -o. |
819 | - file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]); |
|
819 | + file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]); |
|
820 | 820 | |
821 | 821 | $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag); |
822 | 822 | $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n"); |
823 | - $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n"); |
|
823 | + $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n"); |
|
824 | 824 | $time_start = microtime(true); |
825 | 825 | $pflow = []; |
826 | 826 | exec($cmdline, $pflow); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) { |
864 | 864 | array_pop($packetflow); |
865 | 865 | } |
866 | - $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE)); |
|
866 | + $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE)); |
|
867 | 867 | $packetcount = array_count_values($packetflow); |
868 | 868 | $testresults['packetcount'] = $packetcount; |
869 | 869 | $testresults['packetflow'] = $packetflow; |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | |
941 | 941 | $x509 = new \core\common\X509(); |
942 | 942 | // $eap_certarray holds all certs received in EAP conversation |
943 | - $incomingData = file_get_contents($tmpDir . "/serverchain.pem"); |
|
943 | + $incomingData = file_get_contents($tmpDir."/serverchain.pem"); |
|
944 | 944 | if ($incomingData !== FALSE && strlen($incomingData) > 0) { |
945 | 945 | $eapCertArray = $x509->splitCertificate($incomingData); |
946 | 946 | } else { |
@@ -970,10 +970,10 @@ discard block |
||
970 | 970 | case RADIUSTests::SERVER_CA_SELFSIGNED: |
971 | 971 | $servercert[] = $cert; |
972 | 972 | if (count($servercert) == 1) { |
973 | - if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) { |
|
973 | + if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) { |
|
974 | 974 | $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n"); |
975 | 975 | } |
976 | - $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true)); |
|
976 | + $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true)); |
|
977 | 977 | } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) { |
978 | 978 | $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS; |
979 | 979 | } |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | chdir($tmpDir); |
1054 | 1054 | $this->loggerInstance->debug(4, "temp dir: $tmpDir\n"); |
1055 | 1055 | if ($clientcertdata !== NULL) { |
1056 | - file_put_contents($tmpDir . "/client.p12", $clientcertdata); |
|
1056 | + file_put_contents($tmpDir."/client.p12", $clientcertdata); |
|
1057 | 1057 | } |
1058 | 1058 | $testresults = []; |
1059 | 1059 | // initialise the sub-array for cleaner parsing |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | 'issuer' => $this->printDN($certdata['issuer']), |
1150 | 1150 | 'validFrom' => $this->printTm($certdata['validFrom_time_t']), |
1151 | 1151 | 'validTo' => $this->printTm($certdata['validTo_time_t']), |
1152 | - 'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']), |
|
1152 | + 'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']), |
|
1153 | 1153 | 'sha1' => $certdata['sha1'], |
1154 | 1154 | 'extensions' => $certdata['extensions'] |
1155 | 1155 | ]; |
@@ -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 | $loggerInstance = new \core\common\Logging(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $instId = $my_inst->identifier; |
35 | 35 | // delete the IdP and send user to enrollment |
36 | 36 | $my_inst->destroy(); |
37 | - $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId); |
|
37 | + $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId); |
|
38 | 38 | header("Location: overview_user.php"); |
39 | 39 | exit; |
40 | 40 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | // flush all IdP attributes and send user to creation wizard |
52 | 52 | $my_inst->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 | } |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | $inst_name = $my_inst->name; |
75 | -echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>"; |
|
75 | +echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>"; |
|
76 | 76 | echo "<table>"; |
77 | 77 | echo $optionParser->processSubmittedFields($my_inst, $_POST, $_FILES); |
78 | 78 | echo "</table>"; |
79 | 79 | |
80 | 80 | // delete cached logo, if present |
81 | -$dir = ROOT . '/web/downloads/logos/'; |
|
82 | -$globResult = glob($dir . $my_inst->identifier . "_*.png"); |
|
81 | +$dir = ROOT.'/web/downloads/logos/'; |
|
82 | +$globResult = glob($dir.$my_inst->identifier."_*.png"); |
|
83 | 83 | if ($globResult === FALSE) { // we should catch the improbable error condition |
84 | 84 | $globResult = []; |
85 | 85 | } |
86 | 86 | array_map('unlink', $globResult); |
87 | 87 | $loggerInstance->debug(4, "UNLINK from $dir\n"); |
88 | 88 | |
89 | -$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $my_inst->identifier . " - attributes changed"); |
|
89 | +$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$my_inst->identifier." - attributes changed"); |
|
90 | 90 | |
91 | 91 | // re-instantiate ourselves... profiles need fresh data |
92 | 92 | |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | |
99 | 99 | if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) { |
100 | 100 | foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) { |
101 | - $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") ); |
|
101 | + $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)")); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | 105 | foreach ($my_inst->getAttributes("media:SSID_with_legacy") as $ssidname) { |
106 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)"); |
|
106 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)"); |
|
107 | 107 | } |
108 | 108 | foreach ($my_inst->getAttributes("media:SSID") as $ssidname) { |
109 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)"); |
|
109 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES)"); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | echo "<table>"; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if (count($ssids) > 0) { |
115 | 115 | $printedlist = ""; |
116 | 116 | foreach ($ssids as $names) { |
117 | - $printedlist = $printedlist . "$names "; |
|
117 | + $printedlist = $printedlist."$names "; |
|
118 | 118 | } |
119 | 119 | echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured")); |
120 | 120 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // did we get an email address? then, show the silverbullet jumpstart button |
143 | 143 | // otherwise, issue a smartass comment |
144 | 144 | if (count($my_inst->getAttributes("support:email")) > 0) { |
145 | - echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>"; |
|
145 | + echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>"; |
|
146 | 146 | } else { |
147 | 147 | echo "<table>"; |
148 | 148 | 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!")); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") { |
153 | - echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>"; |
|
153 | + echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>"; |
|
154 | 154 | } |
155 | 155 | } |
156 | -echo "<br/><form method='post' action='overview_idp.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>"; |
|
156 | +echo "<br/><form method='post' action='overview_idp.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>"; |
|
157 | 157 | |
158 | 158 | echo $deco->footer(); |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | common\Entity::intoThePotatoes(); |
155 | 155 | $mail = \core\common\OutsideComm::mailHandle(); |
156 | 156 | // who to whom? |
157 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Notification System"; |
|
158 | - $mail->addReplyTo(CONFIG['APPEARANCE']['support-contact']['developer-mail'], CONFIG['APPEARANCE']['productname'] . " " . _("Feedback")); |
|
157 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Notification System"; |
|
158 | + $mail->addReplyTo(CONFIG['APPEARANCE']['support-contact']['developer-mail'], CONFIG['APPEARANCE']['productname']." "._("Feedback")); |
|
159 | 159 | $mail->addAddress($mailaddr[0]["value"]); |
160 | 160 | // what do we want to say? |
161 | 161 | $mail->Subject = $subject; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | $lookFor .= "$name"; |
220 | 220 | } |
221 | - $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
221 | + $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
222 | 222 | if ($finding === 0 || $finding === FALSE) { |
223 | 223 | return FALSE; |
224 | 224 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $matchedProviders[] = $idp; |
237 | 237 | $name = $idp; |
238 | 238 | if ($skipCurl == 0) { |
239 | - $url = CONFIG_DIAGNOSTICS['eduGainResolver']['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
239 | + $url = CONFIG_DIAGNOSTICS['eduGainResolver']['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
240 | 240 | $ch = curl_init($url); |
241 | 241 | if ($ch === FALSE) { |
242 | 242 | $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } |
253 | 253 | curl_close($ch); |
254 | 254 | } |
255 | - $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name; |
|
255 | + $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name; |
|
256 | 256 | } |
257 | 257 | break; |
258 | 258 | case $providerStrings[1]: |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX."); |
118 | 118 | return OutsideComm::MAILDOMAIN_NO_MX; |
119 | 119 | } |
120 | - $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE)); |
|
120 | + $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE)); |
|
121 | 121 | // create a pool of A and AAAA records for all the MXes |
122 | 122 | $ipAddrs = []; |
123 | 123 | foreach ($mx as $onemx) { |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | $ipAddrs[] = $oneipv4['ip']; |
128 | 128 | } |
129 | 129 | foreach ($v6list as $oneipv6) { |
130 | - $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]"; |
|
130 | + $ipAddrs[] = "[".$oneipv6['ipv6']."]"; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | if (count($ipAddrs) == 0) { |
134 | 134 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts."); |
135 | 135 | return OutsideComm::MAILDOMAIN_NO_HOST; |
136 | 136 | } |
137 | - $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE)); |
|
137 | + $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE)); |
|
138 | 138 | // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. |
139 | 139 | // If at least one does not support STARTTLS or one of the hosts doesn't connect |
140 | 140 | // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | switch (CONFIG_CONFASSISTANT['SMSSETTINGS']['provider']) { |
187 | 187 | case 'Nexmo': |
188 | 188 | // taken from https://docs.nexmo.com/messaging/sms-api |
189 | - $url = 'https://rest.nexmo.com/sms/json?' . http_build_query( |
|
189 | + $url = 'https://rest.nexmo.com/sms/json?'.http_build_query( |
|
190 | 190 | [ |
191 | 191 | 'api_key' => CONFIG_CONFASSISTANT['SMSSETTINGS']['username'], |
192 | 192 | 'api_secret' => CONFIG_CONFASSISTANT['SMSSETTINGS']['password'], |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!'); |
212 | 212 | return OutsideComm::SMS_NOTSENT; |
213 | 213 | } |
214 | - $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.'); |
|
214 | + $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.'); |
|
215 | 215 | |
216 | 216 | $totalFailures = 0; |
217 | 217 | foreach ($decoded_response['messages'] as $message) { |
218 | 218 | if ($message['status'] == 0) { |
219 | - $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
219 | + $loggerInstance->debug(2, $message['message-id'].": Success"); |
|
220 | 220 | } else { |
221 | - $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
221 | + $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")"); |
|
222 | 222 | $totalFailures++; |
223 | 223 | } |
224 | 224 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $proto = "https://"; |
271 | 271 | } |
272 | 272 | // then, send out the mail |
273 | - $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n"; |
|
273 | + $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n"; |
|
274 | 274 | // default means we don't have a Reply-To. |
275 | 275 | $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")); |
276 | 276 | |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | // see if we are supposed to add a custom message |
279 | 279 | $customtext = $federation->getAttributes('fed:custominvite'); |
280 | 280 | if (count($customtext) > 0) { |
281 | - $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" . |
|
282 | - wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n"; |
|
281 | + $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------". |
|
282 | + wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n"; |
|
283 | 283 | } |
284 | 284 | // and add Reply-To already now |
285 | 285 | foreach ($federation->listFederationAdmins() as $fedadmin_id) { |
@@ -294,19 +294,19 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | - $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72) . "\n\n" . |
|
298 | - $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" . |
|
299 | - wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" . |
|
300 | - $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/\n\n" . |
|
301 | - _("and enter the invitation token") . "\n\n" . |
|
302 | - $newtoken . "\n\n$replyToMessage\n\n" . |
|
303 | - wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72) . "\n\n" . |
|
304 | - wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" . |
|
297 | + $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72)."\n\n". |
|
298 | + $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n". |
|
299 | + wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72)."\n\n". |
|
300 | + $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/\n\n". |
|
301 | + _("and enter the invitation token")."\n\n". |
|
302 | + $newtoken."\n\n$replyToMessage\n\n". |
|
303 | + wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72)."\n\n". |
|
304 | + wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72)."\n\n". |
|
305 | 305 | sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
306 | 306 | |
307 | 307 | |
308 | 308 | // who to whom? |
309 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
309 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
310 | 310 | |
311 | 311 | if (isset(CONFIG['APPEARANCE']['invitation-bcc-mail']) && CONFIG['APPEARANCE']['invitation-bcc-mail'] !== NULL) { |
312 | 312 | $mail->addBCC(CONFIG['APPEARANCE']['invitation-bcc-mail']); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $loggerInstance = new Logging(); |
357 | 357 | $ch = \curl_init($url); |
358 | 358 | if ($ch === FALSE) { |
359 | - $loggerInstance->debug(2,"Unable to POST JSON request: CURL init failed!"); |
|
359 | + $loggerInstance->debug(2, "Unable to POST JSON request: CURL init failed!"); |
|
360 | 360 | return json_decode(json_encode(FALSE), TRUE); |
361 | 361 | } |
362 | 362 | \curl_setopt_array($ch, array( |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $find = array_keys($displayNames, $input, TRUE); |
129 | 129 | |
130 | 130 | if (count($find) == 0) { // this is an error! throw an Exception |
131 | - throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input)); |
|
131 | + throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input)); |
|
132 | 132 | } |
133 | 133 | \core\common\Entity::outOfThePotatoes(); |
134 | 134 | return $find[0]; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | foreach ($optionlist as $option) { |
151 | 151 | $type = $optioninfo->optionType($option['name']); |
152 | - if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") { |
|
152 | + if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") { |
|
153 | 153 | // all non-multilang attribs get this assignment ... |
154 | 154 | $language = ""; |
155 | 155 | $content = $option['value']; |
@@ -167,19 +167,19 @@ discard block |
||
167 | 167 | $locationMarkers[] = $coords; |
168 | 168 | break; |
169 | 169 | case "file": |
170 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>"; |
|
170 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>"; |
|
171 | 171 | switch ($option['name']) { |
172 | 172 | case "general:logo_file": |
173 | 173 | case "fed:logo_file": |
174 | - $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
174 | + $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
175 | 175 | break; |
176 | 176 | case "eap:ca_file": |
177 | 177 | // fall-through intended: display both the same way |
178 | 178 | case "fed:minted_ca_file": |
179 | - $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
179 | + $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
180 | 180 | break; |
181 | 181 | case "support:info_file": |
182 | - $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
182 | + $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
183 | 183 | break; |
184 | 184 | default: |
185 | 185 | } |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen |
190 | 190 | break; |
191 | 191 | } |
192 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
192 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>"; |
|
193 | 193 | break; |
194 | 194 | default: |
195 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
195 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | $locationCount = 0; |
202 | 202 | foreach ($locationMarkers as $g) { |
203 | 203 | $locationCount++; |
204 | - $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />'; |
|
204 | + $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />'; |
|
205 | 205 | } |
206 | 206 | $marker .= '<\/markers>'; // some validator says this should be escaped |
207 | 207 | $jMarker = json_encode($locationMarkers); |
208 | - $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>'; |
|
208 | + $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>'; |
|
209 | 209 | } |
210 | 210 | \core\common\Entity::outOfThePotatoes(); |
211 | 211 | return $retval; |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | \core\common\Entity::intoThePotatoes(); |
222 | 222 | $idpoptions = $myInst->getAttributes(); |
223 | 223 | $retval = "<div class='infobox'> |
224 | - <h2>" . sprintf(_("General %s details"), $this->nomenclatureInst) . "</h2> |
|
224 | + <h2>" . sprintf(_("General %s details"), $this->nomenclatureInst)."</h2> |
|
225 | 225 | <table> |
226 | 226 | <tr> |
227 | 227 | <td> |
228 | - " . _("Country:") . " |
|
228 | + " . _("Country:")." |
|
229 | 229 | </td> |
230 | 230 | <td> |
231 | 231 | </td> |
@@ -235,16 +235,16 @@ discard block |
||
235 | 235 | $retval .= $myFed->name; |
236 | 236 | $retval .= "</strong> |
237 | 237 | </td> |
238 | - </tr>" . $this->infoblock($idpoptions, "general", "IdP") . " |
|
238 | + </tr>" . $this->infoblock($idpoptions, "general", "IdP")." |
|
239 | 239 | </table> |
240 | 240 | </div>"; |
241 | 241 | |
242 | 242 | $blocks = [["support", _("Global Helpdesk Details")], ["media", _("Media Properties")]]; |
243 | 243 | foreach ($blocks as $block) { |
244 | 244 | $retval .= "<div class='infobox'> |
245 | - <h2>" . $block[1] . "</h2> |
|
245 | + <h2>" . $block[1]."</h2> |
|
246 | 246 | <table>" . |
247 | - $this->infoblock($idpoptions, $block[0], "IdP") . |
|
247 | + $this->infoblock($idpoptions, $block[0], "IdP"). |
|
248 | 248 | "</table> |
249 | 249 | </div>"; |
250 | 250 | } |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | */ |
260 | 260 | private function displaySize(int $number) { |
261 | 261 | if ($number > 1024 * 1024) { |
262 | - return round($number / 1024 / 1024, 2) . " MiB"; |
|
262 | + return round($number / 1024 / 1024, 2)." MiB"; |
|
263 | 263 | } |
264 | 264 | if ($number > 1024) { |
265 | - return round($number / 1024, 2) . " KiB"; |
|
265 | + return round($number / 1024, 2)." KiB"; |
|
266 | 266 | } |
267 | - return $number . " B"; |
|
267 | + return $number." B"; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $this->checkROWIDpresence($cAReference); |
337 | 337 | $rawResult = UIElements::getBlobFromDB($cAReference, FALSE); |
338 | 338 | if (is_bool($rawResult)) { // we didn't actually get a CA! |
339 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>"; |
|
339 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>"; |
|
340 | 340 | \core\common\Entity::outOfThePotatoes(); |
341 | 341 | return $retval; |
342 | 342 | } |
@@ -352,13 +352,13 @@ discard block |
||
352 | 352 | |
353 | 353 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
354 | 354 | $details['name'] = preg_replace('/\//', "", $details['name']); |
355 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
355 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
356 | 356 | if ($details['ca'] == 0 && $details['root'] != 1) { |
357 | - $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
|
357 | + $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>"._("This is a <strong>SERVER</strong> certificate!")."<br/>".$details['name']."</div>"; |
|
358 | 358 | \core\common\Entity::outOfThePotatoes(); |
359 | 359 | return $retval; |
360 | 360 | } |
361 | - $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $details['name'] . "</div>"; |
|
361 | + $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$details['name']."</div>"; |
|
362 | 362 | \core\common\Entity::outOfThePotatoes(); |
363 | 363 | return $retval; |
364 | 364 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | public function previewImageinHTML($imageReference) { |
373 | 373 | \core\common\Entity::intoThePotatoes(); |
374 | 374 | $this->checkROWIDpresence($imageReference); |
375 | - $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>"; |
|
375 | + $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>"; |
|
376 | 376 | \core\common\Entity::outOfThePotatoes(); |
377 | 377 | return $retval; |
378 | 378 | } |
@@ -388,13 +388,13 @@ discard block |
||
388 | 388 | $this->checkROWIDpresence($fileReference); |
389 | 389 | $fileBlob = UIElements::getBlobFromDB($fileReference, FALSE); |
390 | 390 | if (is_bool($fileBlob)) { // we didn't actually get a file! |
391 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>"; |
|
391 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>"; |
|
392 | 392 | \core\common\Entity::outOfThePotatoes(); |
393 | 393 | return $retval; |
394 | 394 | } |
395 | 395 | $decodedFileBlob = base64_decode($fileBlob); |
396 | 396 | $fileinfo = new \finfo(); |
397 | - $retval = "<div class='ca-summary'>" . _("File exists") . " (" . $fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE) . ", " . $this->displaySize(strlen($decodedFileBlob)) . ")<br/><a href='inc/filepreview.php?id=$fileReference'>" . _("Preview") . "</a></div>"; |
|
397 | + $retval = "<div class='ca-summary'>"._("File exists")." (".$fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE).", ".$this->displaySize(strlen($decodedFileBlob)).")<br/><a href='inc/filepreview.php?id=$fileReference'>"._("Preview")."</a></div>"; |
|
398 | 398 | \core\common\Entity::outOfThePotatoes(); |
399 | 399 | return $retval; |
400 | 400 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $retval .= "<tr><td>"; |
423 | 423 | } |
424 | 424 | $finalCaption = ($caption !== NULL ? $caption : $uiMessages[$level]['text']); |
425 | - $retval .= "<img class='icon' src='" . $uiMessages[$level]['icon'] . "' alt='" . $finalCaption . "' title='" . $finalCaption . "'/>"; |
|
425 | + $retval .= "<img class='icon' src='".$uiMessages[$level]['icon']."' alt='".$finalCaption."' title='".$finalCaption."'/>"; |
|
426 | 426 | if (!$omittabletags) { |
427 | 427 | $retval .= "</td><td>"; |
428 | 428 | } |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | return ""; |
503 | 503 | } |
504 | 504 | |
505 | - $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
506 | - $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
505 | + $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png"); |
|
506 | + $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png"); |
|
507 | 507 | if ($logogd === FALSE) { // consortium logo is bogus; don't do anything |
508 | 508 | return ""; |
509 | 509 | } |
@@ -518,8 +518,8 @@ discard block |
||
518 | 518 | $scale = sqrt($maxoccupy / $totallogopixels); |
519 | 519 | $loggerInstance->debug(4, "Scaling info: $scale, $maxoccupy, $totallogopixels\n"); |
520 | 520 | // determine final pixel size - round to multitude of $symbolsize to match exact symbol boundary |
521 | - $targetwidth = (int)($symbolsize * round($sizelogo[0] * $scale / $symbolsize)); |
|
522 | - $targetheight = (int)($symbolsize * round($sizelogo[1] * $scale / $symbolsize)); |
|
521 | + $targetwidth = (int) ($symbolsize * round($sizelogo[0] * $scale / $symbolsize)); |
|
522 | + $targetheight = (int) ($symbolsize * round($sizelogo[1] * $scale / $symbolsize)); |
|
523 | 523 | // paint white below the logo, in case it has transparencies (looks bad) |
524 | 524 | // have one symbol in each direction extra white space |
525 | 525 | $whiteimage = imagecreate($targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
@@ -528,8 +528,8 @@ discard block |
||
528 | 528 | } |
529 | 529 | imagecolorallocate($whiteimage, 255, 255, 255); |
530 | 530 | // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected |
531 | - $targetplacementx = (int)($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize) / 2) / $symbolsize)); |
|
532 | - $targetplacementy = (int)($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize) / 2) / $symbolsize)); |
|
531 | + $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize) / 2) / $symbolsize)); |
|
532 | + $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize) / 2) / $symbolsize)); |
|
533 | 533 | imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
534 | 534 | imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]); |
535 | 535 | ob_start(); |
@@ -19,10 +19,10 @@ |
||
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 | $realm = filter_input(INPUT_GET, 'realm', FILTER_SANITIZE_STRING); |
24 | -$visited = filter_input(INPUT_GET,'visited', FILTER_SANITIZE_STRING); |
|
25 | -$nro = filter_input(INPUT_GET,'nro', FILTER_SANITIZE_STRING); |
|
24 | +$visited = filter_input(INPUT_GET, 'visited', FILTER_SANITIZE_STRING); |
|
25 | +$nro = filter_input(INPUT_GET, 'nro', FILTER_SANITIZE_STRING); |
|
26 | 26 | CAT_session_start(); |
27 | 27 | $languageObject = new core\common\Language(); |
28 | 28 | $languageObject->setTextDomain("diagonstics"); |