@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $cryptoJson = openssl_encrypt($clearJson, 'AES-256-CBC', $encryptionKey, OPENSSL_RAW_DATA, $initVector); |
| 83 | 83 | $hmac = hash_hmac("sha1", $cryptoJson, $encryptionKey, TRUE); |
| 84 | 84 | |
| 85 | - $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = " . $password . "\nb(IV) = " . base64_encode($initVector) . "\nb(Cipher) = " . base64_encode($cryptoJson) . "\nb(HMAC) = " . base64_encode($hmac)); |
|
| 85 | + $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = ".$password."\nb(IV) = ".base64_encode($initVector)."\nb(Cipher) = ".base64_encode($cryptoJson)."\nb(HMAC) = ".base64_encode($hmac)); |
|
| 86 | 86 | |
| 87 | 87 | // now, generate the container that holds all the crypto data |
| 88 | 88 | $finalArray = [ |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | private function wiredBlock($eapdetails) |
| 157 | 157 | { |
| 158 | 158 | return [ |
| 159 | - "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet") . "}", |
|
| 159 | + "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet")."}", |
|
| 160 | 160 | "Name" => "eduroam configuration (wired network)", |
| 161 | 161 | "Remove" => false, |
| 162 | 162 | "Type" => "Ethernet", |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | // if silverbullet, we deliver the client cert inline |
| 198 | 198 | |
| 199 | 199 | if ($selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
| 200 | - $eaparray['ClientCertRef'] = "[" . $this->clientCert['GUID'] . "]"; |
|
| 200 | + $eaparray['ClientCertRef'] = "[".$this->clientCert['GUID']."]"; |
|
| 201 | 201 | $eaparray['ClientCertType'] = "Ref"; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $jsonArray = ["Type" => "UnencryptedConfiguration"]; |
| 237 | 237 | |
| 238 | 238 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
| 239 | - $caRefs[] = "{" . $ca['uuid'] . "}"; |
|
| 239 | + $caRefs[] = "{".$ca['uuid']."}"; |
|
| 240 | 240 | } |
| 241 | 241 | // define CA certificates |
| 242 | 242 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
@@ -246,15 +246,15 @@ discard block |
||
| 246 | 246 | if ($caSanitized1 === FALSE) { |
| 247 | 247 | throw new Exception("Error cropping PEM data at its BEGIN marker."); |
| 248 | 248 | } |
| 249 | - $this->loggerInstance->debug(4, $caSanitized1 . "\n"); |
|
| 249 | + $this->loggerInstance->debug(4, $caSanitized1."\n"); |
|
| 250 | 250 | // remove \n |
| 251 | 251 | $caSanitized = str_replace("\n", "", $caSanitized1); |
| 252 | - $jsonArray["Certificates"][] = ["GUID" => "{" . $ca['uuid'] . "}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
| 253 | - $this->loggerInstance->debug(4, $caSanitized . "\n"); |
|
| 252 | + $jsonArray["Certificates"][] = ["GUID" => "{".$ca['uuid']."}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
| 253 | + $this->loggerInstance->debug(4, $caSanitized."\n"); |
|
| 254 | 254 | } |
| 255 | 255 | // if we are doing silverbullet, include the unencrypted(!) P12 as a client certificate |
| 256 | 256 | if ($this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
| 257 | - $jsonArray["Certificates"][] = ["GUID" => "[" . $this->clientCert['GUID'] . "]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
| 257 | + $jsonArray["Certificates"][] = ["GUID" => "[".$this->clientCert['GUID']."]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
| 258 | 258 | } |
| 259 | 259 | $eaparray = $this->eapBlock($caRefs); |
| 260 | 260 | // define Wi-Fi networks |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | file_put_contents('installer_profile', $finalJson); |
| 279 | 279 | |
| 280 | - $fileName = $this->installerBasename . '.onc'; |
|
| 280 | + $fileName = $this->installerBasename.'.onc'; |
|
| 281 | 281 | |
| 282 | 282 | if (!$this->sign) { |
| 283 | 283 | rename("installer_profile", $fileName); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | // have the notion of signing |
| 289 | 289 | // but if they ever change their mind, we are prepared |
| 290 | 290 | |
| 291 | - $outputFromSigning = system($this->sign . " installer_profile '$fileName' > /dev/null"); |
|
| 291 | + $outputFromSigning = system($this->sign." installer_profile '$fileName' > /dev/null"); |
|
| 292 | 292 | if ($outputFromSigning === FALSE) { |
| 293 | 293 | $this->loggerInstance->debug(2, "Signing the ONC installer $fileName FAILED!\n"); |
| 294 | 294 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | "TXT" => _("If you use more than one device: do your other devices still work?"), |
| 109 | 109 | "FACTOR_YES" => 0.33, // seems that all is okay with the account as such |
| 110 | 110 | "FACTOR_NO" => 3, // now that is suspicious indeed |
| 111 | - "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]"),], |
|
| 111 | + "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]"), ], |
|
| 112 | 112 | 6 => ["AREA" => AbstractTest::INFRA_SP_80211, |
| 113 | 113 | "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), |
| 114 | 114 | "FACTOR_YES" => 3, |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | $questionDetails = $this->qaArray[$questionNumber]; |
| 145 | 145 | if ($answer === TRUE) { |
| 146 | 146 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_YES"]; |
| 147 | - $this->loggerInstance->debug(4, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_YES"] . "\n"); |
|
| 147 | + $this->loggerInstance->debug(4, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n"); |
|
| 148 | 148 | $factor = $questionDetails["FACTOR_YES"]; |
| 149 | 149 | } elseif ($answer === FALSE) { |
| 150 | 150 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_NO"]; |
| 151 | - $this->loggerInstance->debug(4, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_NO"] . "\n"); |
|
| 151 | + $this->loggerInstance->debug(4, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n"); |
|
| 152 | 152 | $factor = $questionDetails["FACTOR_NO"]; |
| 153 | 153 | } else { |
| 154 | 154 | $factor = 1; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | // if both are identical, take any of the questions in the pool of both |
| 184 | 184 | foreach ($this->qaArray as $questionNumber => $questionDetails) { |
| 185 | 185 | // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it |
| 186 | - if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
| 186 | + if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
| 187 | 187 | return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]); |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $text = $this->genericVerdictTexts[$area]; |
| 212 | 212 | foreach ($this->previousQuestions as $number => $factor) { |
| 213 | 213 | if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) { |
| 214 | - $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"]; |
|
| 214 | + $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"]; |
|
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | return $text; |
@@ -493,17 +493,17 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | echo "<td class='inst_td'> |
| 495 | 495 | <input type='hidden' name='inst' value='" |
| 496 | - . $index."'>" |
|
| 497 | - . "<span style='display:none' class='inst_name'>".$my_idp."</span>" |
|
| 498 | - . "<span>".$idp_instance->name."</span>" |
|
| 499 | - . " (<a href='overview_org.php?inst_id=" |
|
| 500 | - . $idp_instance->identifier."'>" |
|
| 501 | - . (in_array($index, $userIdps) ? _("manage") : _("view")) |
|
| 502 | - . "</a>)" |
|
| 503 | - . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>") |
|
| 504 | - . implode("</li><li>", $listOfSilverbulletRealms) |
|
| 505 | - . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>") |
|
| 506 | - . "</td>"; |
|
| 496 | + . $index."'>" |
|
| 497 | + . "<span style='display:none' class='inst_name'>".$my_idp."</span>" |
|
| 498 | + . "<span>".$idp_instance->name."</span>" |
|
| 499 | + . " (<a href='overview_org.php?inst_id=" |
|
| 500 | + . $idp_instance->identifier."'>" |
|
| 501 | + . (in_array($index, $userIdps) ? _("manage") : _("view")) |
|
| 502 | + . "</a>)" |
|
| 503 | + . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>") |
|
| 504 | + . implode("</li><li>", $listOfSilverbulletRealms) |
|
| 505 | + . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>") |
|
| 506 | + . "</td>"; |
|
| 507 | 507 | // deployment status; need to dive into profiles for this |
| 508 | 508 | // show happy eyeballs if at least one profile is configured/showtime |
| 509 | 509 | if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { |
@@ -560,8 +560,8 @@ discard block |
||
| 560 | 560 | echo "<form method='post' action='overview_federation.php' accept-charset='UTF-8'> |
| 561 | 561 | <input type='hidden' name='invitation_id' value='".$oneinvite['token']."'/> |
| 562 | 562 | <button class='delete' type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_DELETE."'>"._("Revoke Invitation")."</button> " |
| 563 | - . sprintf(_("(expires %s)"), $oneinvite['expiry']) |
|
| 564 | - . "</form>"; |
|
| 563 | + . sprintf(_("(expires %s)"), $oneinvite['expiry']) |
|
| 564 | + . "</form>"; |
|
| 565 | 565 | } |
| 566 | 566 | echo " </td>"; |
| 567 | 567 | echo " </tr>"; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $dom = new \DOMDocument('1.0', 'utf-8'); |
| 145 | 145 | $root = $dom->createElement($rootname); |
| 146 | 146 | $dom->appendChild($root); |
| 147 | - $ns = $dom->createAttributeNS( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation' ); |
|
| 147 | + $ns = $dom->createAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation'); |
|
| 148 | 148 | $ns->value = "eap-metadata.xsd"; |
| 149 | 149 | $root->appendChild($ns); |
| 150 | 150 | $this->openRoamingToU = sprintf(_("I have read and agree to OpenRoaming Terms of Use at %s."), "https://wballiance.com/openroaming/toc-2020/"); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | if ($netDefinition['condition'] === 'internal:openroaming' && |
| 182 | 182 | $this->attributes['internal:openroaming']) { |
| 183 | 183 | $this->setORtou(); |
| 184 | - if (preg_match("/^ask/",$this->attributes['media:openroaming'][0])) { |
|
| 184 | + if (preg_match("/^ask/", $this->attributes['media:openroaming'][0])) { |
|
| 185 | 185 | $orNetwork = $netDefinition; |
| 186 | 186 | continue; |
| 187 | 187 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | private function setORtou() { |
| 241 | - if (preg_match("/preagreed/",$this->attributes['media:openroaming'][0])) { |
|
| 241 | + if (preg_match("/preagreed/", $this->attributes['media:openroaming'][0])) { |
|
| 242 | 242 | $this->addORtou = false; |
| 243 | 243 | } else { |
| 244 | 244 | $this->addORtou = true; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $authMethods = new \core\DeviceXMLmain(); |
| 263 | 263 | $authMethods->setChild('AuthenticationMethod', $this->authMethodsList); |
| 264 | 264 | $eapIdp->setChild('AuthenticationMethods', $authMethods); |
| 265 | - $eapIdp->setChild('CredentialApplicability', $this->getCredentialApplicability($ssids,$oids)); |
|
| 265 | + $eapIdp->setChild('CredentialApplicability', $this->getCredentialApplicability($ssids, $oids)); |
|
| 266 | 266 | // TODO $eap_idp->setChild('ValidUntil',$this->getValidUntil()); |
| 267 | 267 | $eapIdp->setChild('ProviderInfo', $this->providerInfo); |
| 268 | 268 | // TODO $eap_idp->setChild('VendorSpecific',$this->getVendorSpecific()); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $attr = $this->attributes; |
| 377 | 377 | if (isset($attr['general:logo_file'][0])) { |
| 378 | 378 | $rawLogoBlob = $attr['general:logo_file'][0]; |
| 379 | - $logoMime= $attr['internal:logo_file'][0]['mime']; |
|
| 379 | + $logoMime = $attr['internal:logo_file'][0]['mime']; |
|
| 380 | 380 | [$scaledBlob, $scaledMime] = $this->scaleLogo($rawLogoBlob, $logoMime); |
| 381 | 381 | if ($scaledMime == 'none') { |
| 382 | 382 | return NULL; |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | private function scaleLogo($blob, $mime) |
| 406 | 406 | { |
| 407 | - $maxByte = 1024*50; |
|
| 408 | - $maxPixelSize = [400,300,200,100]; |
|
| 407 | + $maxByte = 1024 * 50; |
|
| 408 | + $maxPixelSize = [400, 300, 200, 100]; |
|
| 409 | 409 | // start with the actual file size |
| 410 | 410 | $logoSize = strlen($blob); |
| 411 | 411 | \core\common\Logging::debug_s(4, $logoSize, "Logo file size: ", "\n"); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | return ['', 'none']; |
| 428 | 428 | } |
| 429 | 429 | $imageSize = $imageObject->getImageGeometry(); |
| 430 | - \core\common\Logging::debug_s(4, $imageSize, "Input logo pixel size: ","\n"); |
|
| 430 | + \core\common\Logging::debug_s(4, $imageSize, "Input logo pixel size: ", "\n"); |
|
| 431 | 431 | foreach ($maxPixelSize as $size) { |
| 432 | 432 | $tmpImage = $imageObject; |
| 433 | 433 | $tmpImage->setImageFormat('PNG'); |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $lng = $lngAttr['lang'] === 'any' ? \config\Master::APPEARANCE['defaultlocale'] : $lngAttr['lang']; |
| 478 | 478 | $tou .= "\n".$this->openRoamingToUArray[$lng]; |
| 479 | 479 | $touObj->setValue($tou); |
| 480 | - $out[] = $touObj; |
|
| 480 | + $out[] = $touObj; |
|
| 481 | 481 | } |
| 482 | 482 | } else { |
| 483 | 483 | $tou = $standardTou[0]; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | 'display' => sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP), |
| 150 | 150 | 'help' => _("Set of default CAs to add to new IdPs on signup")], |
| 151 | 151 | "fed:openroaming" => [ |
| 152 | - 'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant), |
|
| 152 | + 'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant), |
|
| 153 | 153 | 'help' => _("Allow IdP to set OpenRoaming support for its users.")], |
| 154 | 154 | "fed:openroaming_customtarget" => ['display' => _("OpenRoaming: Custom NAPTR Target"), 'help' => "If you want your IdPs to use your own OpenRoaming → eduroam proxy then you can configure the hostname here; the realm check feature for IdPs will then warn them if the OpenRoaming destination server is not yours. This attribute does not need to be set, and the realm checks default to checking for the OpenRoaming → eduroam proxy operated by eduroam OT."], |
| 155 | 155 | "fed:autoregister-synced" => [ |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | foreach ($optionlist as $option) { |
| 211 | 211 | $type = $optioninfo->optionType($option['name']); |
| 212 | - if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") { |
|
| 212 | + if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") { |
|
| 213 | 213 | // all non-multilang attribs get this assignment ... |
| 214 | 214 | $language = ""; |
| 215 | 215 | $content = $option['value']; |
@@ -227,19 +227,19 @@ discard block |
||
| 227 | 227 | $locationMarkers[] = $coords; |
| 228 | 228 | break; |
| 229 | 229 | case "file": |
| 230 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>"; |
|
| 230 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>"; |
|
| 231 | 231 | switch ($option['name']) { |
| 232 | 232 | case "general:logo_file": |
| 233 | 233 | case "fed:logo_file": |
| 234 | - $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
| 234 | + $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
| 235 | 235 | break; |
| 236 | 236 | case "eap:ca_file": |
| 237 | 237 | // fall-through intended: display both the same way |
| 238 | 238 | case "fed:minted_ca_file": |
| 239 | - $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
| 239 | + $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
| 240 | 240 | break; |
| 241 | 241 | case "support:info_file": |
| 242 | - $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
| 242 | + $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
| 243 | 243 | break; |
| 244 | 244 | default: |
| 245 | 245 | } |
@@ -249,10 +249,10 @@ discard block |
||
| 249 | 249 | // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen |
| 250 | 250 | break; |
| 251 | 251 | } |
| 252 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
| 252 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>"; |
|
| 253 | 253 | break; |
| 254 | 254 | default: |
| 255 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
| 255 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | $locationCount = 0; |
| 262 | 262 | foreach ($locationMarkers as $g) { |
| 263 | 263 | $locationCount++; |
| 264 | - $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />'; |
|
| 264 | + $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />'; |
|
| 265 | 265 | } |
| 266 | 266 | $marker .= '<\/markers>'; // some validator says this should be escaped |
| 267 | 267 | $jMarker = json_encode($locationMarkers); |
| 268 | - $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>'; |
|
| 268 | + $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>'; |
|
| 269 | 269 | } |
| 270 | 270 | \core\common\Entity::outOfThePotatoes(); |
| 271 | 271 | return $retval; |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | \core\common\Entity::intoThePotatoes(); |
| 282 | 282 | $idpoptions = $myInst->getAttributes(); |
| 283 | 283 | $retval = "<div class='infobox'> |
| 284 | - <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2> |
|
| 284 | + <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2> |
|
| 285 | 285 | <table> |
| 286 | 286 | <tr> |
| 287 | 287 | <td> |
| 288 | - " . _("Country:") . " |
|
| 288 | + " . _("Country:")." |
|
| 289 | 289 | </td> |
| 290 | 290 | <td> |
| 291 | 291 | </td> |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | $retval .= $myFed->name; |
| 296 | 296 | $retval .= "</strong> |
| 297 | 297 | </td> |
| 298 | - </tr>" . $this->infoblock($idpoptions, "general", "IdP") . " |
|
| 298 | + </tr>" . $this->infoblock($idpoptions, "general", "IdP")." |
|
| 299 | 299 | </table> |
| 300 | 300 | </div>"; |
| 301 | 301 | $blocks = [["support", _("Global Helpdesk Details")]]; |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | foreach ($blocks as $block) { |
| 306 | 306 | $retval .= "<div class='infobox'> |
| 307 | - <h2>" . $block[1] . "</h2> |
|
| 307 | + <h2>" . $block[1]."</h2> |
|
| 308 | 308 | <table>" . |
| 309 | - $this->infoblock($idpoptions, $block[0], "IdP") . |
|
| 309 | + $this->infoblock($idpoptions, $block[0], "IdP"). |
|
| 310 | 310 | "</table> |
| 311 | 311 | </div>"; |
| 312 | 312 | } |
@@ -321,12 +321,12 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | private function displaySize(int $number) { |
| 323 | 323 | if ($number > 1024 * 1024) { |
| 324 | - return round($number / 1024 / 1024, 2) . " MiB"; |
|
| 324 | + return round($number / 1024 / 1024, 2)." MiB"; |
|
| 325 | 325 | } |
| 326 | 326 | if ($number > 1024) { |
| 327 | - return round($number / 1024, 2) . " KiB"; |
|
| 327 | + return round($number / 1024, 2)." KiB"; |
|
| 328 | 328 | } |
| 329 | - return $number . " B"; |
|
| 329 | + return $number." B"; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning']; |
| 382 | 382 | $rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
| 383 | 383 | if (is_bool($rawResult)) { // we didn't actually get a CA! |
| 384 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>"; |
|
| 384 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>"; |
|
| 385 | 385 | \core\common\Entity::outOfThePotatoes(); |
| 386 | 386 | return $retval; |
| 387 | 387 | } |
@@ -397,8 +397,8 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
| 399 | 399 | $details['name'] = preg_replace('/\//', "", $details['name']); |
| 400 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
| 401 | - $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
| 400 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
| 401 | + $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
| 402 | 402 | $innerbgColor = "#0000ff"; |
| 403 | 403 | $leftBorderColor = "#00ff00"; |
| 404 | 404 | $message = ""; |
@@ -406,35 +406,35 @@ discard block |
||
| 406 | 406 | $leftBorderColor = "red"; |
| 407 | 407 | $message = _("This is a <strong>SERVER</strong> certificate!"); |
| 408 | 408 | if (\config\ConfAssistant::CERT_GUIDELINES !== '') { |
| 409 | - $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>"; |
|
| 409 | + $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>"; |
|
| 410 | 410 | } |
| 411 | 411 | $message .= "<br/>"; |
| 412 | - $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . $message . $details['name'] . "</div>"; |
|
| 412 | + $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>".$message.$details['name']."</div>"; |
|
| 413 | 413 | \core\common\Entity::outOfThePotatoes(); |
| 414 | 414 | return $retval; |
| 415 | 415 | } |
| 416 | 416 | $now = time(); |
| 417 | 417 | if ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_critical'] > $details['full_details']['validTo_time_t']) { |
| 418 | 418 | $leftBorderColor = "red"; |
| 419 | - $message = _("Certificate expired!") . "<br>"; |
|
| 420 | - } elseif($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) { |
|
| 419 | + $message = _("Certificate expired!")."<br>"; |
|
| 420 | + } elseif ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) { |
|
| 421 | 421 | if ($leftBorderColor == "#00ff00") { |
| 422 | 422 | $leftBorderColor = "yellow"; |
| 423 | 423 | } |
| 424 | - $message = _("Certificate close to expiry!") . "<br/>"; |
|
| 424 | + $message = _("Certificate close to expiry!")."<br/>"; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | if ($details['root'] == 1 && $details['basicconstraints_set'] == 0) { |
| 428 | 428 | if ($leftBorderColor == "#00ff00") { |
| 429 | 429 | $leftBorderColor = "yellow"; |
| 430 | 430 | } |
| 431 | - $message .= "<div style='max-width: 25em'><strong>" . _("Improper root certificate, required critical CA extension missing, will not reliably install!") . "</strong>"; |
|
| 431 | + $message .= "<div style='max-width: 25em'><strong>"._("Improper root certificate, required critical CA extension missing, will not reliably install!")."</strong>"; |
|
| 432 | 432 | if (\config\ConfAssistant::CERT_GUIDELINES !== '') { |
| 433 | - $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>"; |
|
| 433 | + $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>"; |
|
| 434 | 434 | } |
| 435 | 435 | $message .= "</div><br/>"; |
| 436 | 436 | } |
| 437 | - $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $message . $details['name'] . "<br>" . $this->displayName('eap:ca_vailduntil') . " " . gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t']) . " UTC</div>"; |
|
| 437 | + $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$message.$details['name']."<br>".$this->displayName('eap:ca_vailduntil')." ".gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t'])." UTC</div>"; |
|
| 438 | 438 | \core\common\Entity::outOfThePotatoes(); |
| 439 | 439 | return $retval; |
| 440 | 440 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | */ |
| 448 | 448 | public function previewImageinHTML($imageReference) { |
| 449 | 449 | \core\common\Entity::intoThePotatoes(); |
| 450 | - $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>"; |
|
| 450 | + $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>"; |
|
| 451 | 451 | \core\common\Entity::outOfThePotatoes(); |
| 452 | 452 | return $retval; |
| 453 | 453 | } |
@@ -464,13 +464,13 @@ discard block |
||
| 464 | 464 | $ref = $validator->databaseReference($fileReference); |
| 465 | 465 | $fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
| 466 | 466 | if (is_bool($fileBlob)) { // we didn't actually get a file! |
| 467 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>"; |
|
| 467 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>"; |
|
| 468 | 468 | \core\common\Entity::outOfThePotatoes(); |
| 469 | 469 | return $retval; |
| 470 | 470 | } |
| 471 | 471 | $decodedFileBlob = base64_decode($fileBlob); |
| 472 | 472 | $fileinfo = new \finfo(); |
| 473 | - $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>"; |
|
| 473 | + $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>"; |
|
| 474 | 474 | \core\common\Entity::outOfThePotatoes(); |
| 475 | 475 | return $retval; |
| 476 | 476 | } |
@@ -627,8 +627,8 @@ discard block |
||
| 627 | 627 | return ""; |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | - $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
| 631 | - $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
| 630 | + $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png"); |
|
| 631 | + $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png"); |
|
| 632 | 632 | if ($logogd === FALSE) { // consortium logo is bogus; don't do anything |
| 633 | 633 | return ""; |
| 634 | 634 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | imagecolorallocate($whiteimage, 255, 255, 255); |
| 655 | 655 | // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected |
| 656 | 656 | $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize)); |
| 657 | - $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize)); |
|
| 657 | + $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize)); |
|
| 658 | 658 | imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
| 659 | 659 | imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]); |
| 660 | 660 | ob_start(); |
@@ -704,9 +704,9 @@ discard block |
||
| 704 | 704 | $message = "Your configuration appears to be fine."; |
| 705 | 705 | break; |
| 706 | 706 | default: |
| 707 | - throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!"); |
|
| 707 | + throw new Exception("The result code level ".$test->test_result['global']." is not defined!"); |
|
| 708 | 708 | } |
| 709 | - $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>"); |
|
| 709 | + $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>"); |
|
| 710 | 710 | foreach ($test->out as $testValue) { |
| 711 | 711 | foreach ($testValue as $o) { |
| 712 | 712 | $out .= $this->boxFlexible($o['level'], $o['message']); |