@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if ($trailerPosition !== FALSE) { |
| 143 | 143 | $base = substr($scriptself, 0, $trailerPosition); |
| 144 | 144 | if ($base !== FALSE) { |
| 145 | - $url = "//$servername" . $base . "/logout_check.php"; |
|
| 145 | + $url = "//$servername".$base."/logout_check.php"; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | if (!$handle instanceof \core\DBConnection) { |
| 159 | 159 | $frontendHandle = $handle; |
| 160 | 160 | } |
| 161 | - $truncatedUser = substr($user,0,999); |
|
| 161 | + $truncatedUser = substr($user, 0, 999); |
|
| 162 | 162 | $handle->exec("INSERT INTO admin_logins (user_id, last_login) VALUES ('$truncatedUser', NOW()) ON DUPLICATE KEY UPDATE last_login=NOW()"); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -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]; |