@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * <base_url>/copyright.php after deploying the software |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -require_once __DIR__ . "/../core/Psr4Autoloader.php"; |
|
| 22 | +require_once __DIR__."/../core/Psr4Autoloader.php"; |
|
| 23 | 23 | use core\autoloader\Psr4Autoloader; |
| 24 | 24 | |
| 25 | 25 | // instantiate the loader |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // register the base directories for the namespace prefix |
| 32 | 32 | // include CAT/core library |
| 33 | -$loader->addNamespace('core', __DIR__ . "/../core"); |
|
| 33 | +$loader->addNamespace('core', __DIR__."/../core"); |
|
| 34 | 34 | // include CAT/devices library |
| 35 | -$loader->addNamespace('devices', __DIR__ . "/../devices"); |
|
| 35 | +$loader->addNamespace('devices', __DIR__."/../devices"); |
|
| 36 | 36 | // include CAT/web library |
| 37 | -$loader->addNamespace('web', __DIR__ . "/../web"); |
|
| 37 | +$loader->addNamespace('web', __DIR__."/../web"); |
|
| 38 | 38 | |
| 39 | 39 | // include PHPMailer library |
| 40 | -$loader->addNamespace('PHPMailer\PHPMailer', __DIR__ . "/../core/PHPMailer/src"); |
|
| 40 | +$loader->addNamespace('PHPMailer\PHPMailer', __DIR__."/../core/PHPMailer/src"); |
|
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | require_once "autoloader.php"; |
| 23 | -require_once __DIR__ . "/../packageRoot.php"; |
|
| 23 | +require_once __DIR__."/../packageRoot.php"; |
|
| 24 | 24 | |
| 25 | 25 | /* This code block compares the template config against the actual one to find |
| 26 | 26 | * out which of the values are MISSING, which are still at DEFAULT and which |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | // this is the actual config |
| 90 | 90 | |
| 91 | -if (!file_exists(ROOT . "/config/config-master.php")) { |
|
| 91 | +if (!file_exists(ROOT."/config/config-master.php")) { |
|
| 92 | 92 | echo "Master configuration file not found. You need to configure the product! At least config-master.php is required!"; |
| 93 | 93 | throw new Exception("Master config file not found!"); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | -require ROOT . "/config/config-master.php"; |
|
| 96 | +require ROOT."/config/config-master.php"; |
|
| 97 | 97 | |
| 98 | 98 | /* as a test for the config comparison, run this, display in browser and exit |
| 99 | 99 | |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | /* load sub-configs if we are dealing with those in this installation */ |
| 110 | 110 | |
| 111 | 111 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == 'LOCAL' || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == 'LOCAL') { |
| 112 | - include ROOT . "/config/config-confassistant.php"; |
|
| 112 | + include ROOT."/config/config-confassistant.php"; |
|
| 113 | 113 | } else { // we want to define the constant itself anyway, to avoid some ugly warnings on the console |
| 114 | 114 | // this is done with an inline include |
| 115 | 115 | define("CONFIG_CONFASSISTANT", []); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] == 'LOCAL') { |
| 119 | - include ROOT . "/config/config-diagnostics.php"; |
|
| 119 | + include ROOT."/config/config-diagnostics.php"; |
|
| 120 | 120 | } else { // same here |
| 121 | 121 | define("CONFIG_DIAGNOSTICS", []); |
| 122 | 122 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | function CAT_session_start() { |
| 130 | 130 | if (session_status() != PHP_SESSION_ACTIVE) { |
| 131 | 131 | session_name("CAT"); |
| 132 | - session_set_cookie_params(0, "/", $_SERVER['SERVER_NAME'], (isset($_SERVER['HTTPS']) ? TRUE : FALSE )); |
|
| 132 | + session_set_cookie_params(0, "/", $_SERVER['SERVER_NAME'], (isset($_SERVER['HTTPS']) ? TRUE : FALSE)); |
|
| 133 | 133 | session_start(); |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $attributesLowLevel = array_merge($this->deviceLevelAttributes, $this->eapLevelAttributes); |
| 114 | 114 | |
| 115 | - $this->loggerInstance->debug(5, "Device-Level Attributes: " . print_r($this->deviceLevelAttributes, true)); |
|
| 116 | - $this->loggerInstance->debug(5, "EAP-Level Attributes: " . print_r($this->eapLevelAttributes, true)); |
|
| 117 | - $this->loggerInstance->debug(5, "All low-Level Attributes: " . print_r($attributesLowLevel, true)); |
|
| 115 | + $this->loggerInstance->debug(5, "Device-Level Attributes: ".print_r($this->deviceLevelAttributes, true)); |
|
| 116 | + $this->loggerInstance->debug(5, "EAP-Level Attributes: ".print_r($this->eapLevelAttributes, true)); |
|
| 117 | + $this->loggerInstance->debug(5, "All low-Level Attributes: ".print_r($attributesLowLevel, true)); |
|
| 118 | 118 | |
| 119 | 119 | // now fetch and merge profile-level attributes if not already set on deeper level |
| 120 | 120 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $this->loggerInstance->debug(5, "Merged Attributes: " . print_r($attributesLowLevel, true)); |
|
| 136 | + $this->loggerInstance->debug(5, "Merged Attributes: ".print_r($attributesLowLevel, true)); |
|
| 137 | 137 | |
| 138 | 138 | // now, fetch and merge IdP-wide attributes |
| 139 | 139 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | "row" => $attributeQuery->row, |
| 189 | 189 | "flag" => $optinfo['flag'], |
| 190 | 190 | "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL), |
| 191 | - "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )]; |
|
| 191 | + "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())]; |
|
| 192 | 192 | } |
| 193 | 193 | return $temparray; |
| 194 | 194 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * @return void |
| 290 | 290 | */ |
| 291 | 291 | public function setAnonymousIDSupport($shallwe) { |
| 292 | - $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = " . ($shallwe === true ? "1" : "0") . " WHERE profile_id = $this->identifier"); |
|
| 292 | + $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier"); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** Toggle special username for realm checks |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | * @return void |
| 300 | 300 | */ |
| 301 | 301 | public function setRealmCheckUser($shallwe, $localpart = NULL) { |
| 302 | - $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") . |
|
| 303 | - ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") . |
|
| 302 | + $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = ".($shallwe === true ? "1" : "0"). |
|
| 303 | + ($localpart !== NULL ? ", checkuser_value = '$localpart' " : ""). |
|
| 304 | 304 | " WHERE profile_id = $this->identifier"); |
| 305 | 305 | } |
| 306 | 306 | |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | * @return void |
| 313 | 313 | */ |
| 314 | 314 | public function setInputVerificationPreference($verify, $hint) { |
| 315 | - $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = " . ($verify === true ? "1" : "0") . |
|
| 316 | - ", hint_userinput_suffix = " . ($hint === true ? "1" : "0") . |
|
| 315 | + $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = ".($verify === true ? "1" : "0"). |
|
| 316 | + ", hint_userinput_suffix = ".($hint === true ? "1" : "0"). |
|
| 317 | 317 | " WHERE profile_id = $this->identifier"); |
| 318 | 318 | } |
| 319 | 319 | |
@@ -370,9 +370,9 @@ |
||
| 370 | 370 | // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php |
| 371 | 371 | $proc = CONFIG['PATHS']['openssl']." crl -inform der"; |
| 372 | 372 | $descriptorspec = [ |
| 373 | - 0 => ["pipe", "r"], |
|
| 374 | - 1 => ["pipe", "w"], |
|
| 375 | - 2 => ["pipe", "w"], |
|
| 373 | + 0 => ["pipe", "r"], |
|
| 374 | + 1 => ["pipe", "w"], |
|
| 375 | + 2 => ["pipe", "w"], |
|
| 376 | 376 | ]; |
| 377 | 377 | $process = proc_open($proc, $descriptorspec, $pipes); |
| 378 | 378 | if (!is_resource($process)) { |
@@ -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 | ]; |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | $this->possibleFailureReasons = $_SESSION["SUSPECTS"] ?? []; // if we know nothing, don't talk to anyone |
| 105 | 105 | $this->additionalFindings = $_SESSION["EVIDENCE"] ?? []; |
| 106 | 106 | |
| 107 | - $this->subjectPrefix = _("[eduroam Diagnostics]") . " "; |
|
| 107 | + $this->subjectPrefix = _("[eduroam Diagnostics]")." "; |
|
| 108 | 108 | $this->finalGreeting = "\n" |
| 109 | 109 | . _("(This service is in an early stage. We apologise if this is a false alert. If this is the case, please send an email report to [email protected], forwarding the entire message (including the 'SUSPECTS' and 'EVIDENCE' data at the end), and explain why this is a false positive.)") |
| 110 | 110 | . "\n" |
| 111 | - . _("Yours sincerely,") . "\n" |
|
| 111 | + . _("Yours sincerely,")."\n" |
|
| 112 | 112 | . "\n" |
| 113 | 113 | . _("Ed U. Roam, the eduroam diagnostics algorithm"); |
| 114 | 114 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | "bcc" => [], |
| 120 | 120 | "reply-to" => [Logopath::EDUROAM_OT], |
| 121 | 121 | "subject" => _("[POLICYVIOLATION NATIONAL] IdP with no entry in eduroam database"), |
| 122 | - "body" => _("Dear NRO administrator,") . "\n" |
|
| 122 | + "body" => _("Dear NRO administrator,")."\n" |
|
| 123 | 123 | . "\n" |
| 124 | - . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) . "\n" |
|
| 124 | + . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar"))."\n" |
|
| 125 | 125 | . "\n" |
| 126 | - . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.") . "\n" |
|
| 126 | + . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.")."\n" |
|
| 127 | 127 | . "\n" |
| 128 | - . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.") . "\n" |
|
| 128 | + . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.")."\n" |
|
| 129 | 129 | . "\n" |
| 130 | 130 | . "Please stop the policy violation ASAP by listing the IdP which is associated to this realm.", |
| 131 | 131 | ], |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | $handle = \core\common\OutsideComm::mailHandle(); |
| 281 | 281 | // let's identify outselves |
| 282 | - $handle->FromName = CONFIG['APPEARANCE']['productname'] . " Real-Time Diagnostics System"; |
|
| 282 | + $handle->FromName = CONFIG['APPEARANCE']['productname']." Real-Time Diagnostics System"; |
|
| 283 | 283 | // add recipients |
| 284 | 284 | foreach (Logopath::CATEGORYBINDING as $arrayName => $functionName) { |
| 285 | 285 | foreach ($theMail[$arrayName] as $onePrincipal) { |
@@ -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 | * The overall coordination class that runs all kinds of tests to find out where |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if ($this->idPFederation === NULL && preg_match("/\.(..)$/", $realm, $matches)) { |
| 76 | 76 | $this->idPFederation = strtoupper($matches[1]); |
| 77 | 77 | } |
| 78 | - $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is " . $this->idPFederation . "\n"); |
|
| 78 | + $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is ".$this->idPFederation."\n"); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /* The eduroam OT monitoring has the following return codes: |
@@ -397,12 +397,12 @@ discard block |
||
| 397 | 397 | break; |
| 398 | 398 | case \core\AbstractProfile::READINESS_LEVEL_NOTREADY: |
| 399 | 399 | $this->additionalFindings[AbstractTest::INFRA_IDP_RADIUS][] = ["Profile" => "UNCONCLUSIVE"]; |
| 400 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
| 400 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
| 401 | 401 | break; |
| 402 | 402 | default: |
| 403 | 403 | } |
| 404 | 404 | } else { |
| 405 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
| 405 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -142,17 +142,17 @@ discard block |
||
| 142 | 142 | foreach (array_keys($this->typeDb) as $name) { |
| 143 | 143 | if ($className === 0) { |
| 144 | 144 | $tempArray[] = $name; |
| 145 | - } elseif (preg_match('/^' . $className . ':/', $name) > 0) { |
|
| 145 | + } elseif (preg_match('/^'.$className.':/', $name) > 0) { |
|
| 146 | 146 | $tempArray[] = $name; |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | $returnArray = $tempArray; |
| 150 | 150 | // remove silverbullet-specific options if this deployment is not SB |
| 151 | 151 | foreach ($tempArray as $key => $val) { |
| 152 | - if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) { |
|
| 152 | + if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) { |
|
| 153 | 153 | unset($returnArray[$key]); |
| 154 | 154 | } |
| 155 | - if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) { |
|
| 155 | + if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) { |
|
| 156 | 156 | unset($returnArray[$key]); |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (isset($this->typeDb[$optionname])) { |
| 172 | 172 | return $this->typeDb[$optionname]; |
| 173 | 173 | } |
| 174 | - throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: " . htmlentities($optionname)); |
|
| 174 | + throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: ".htmlentities($optionname)); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | parent::__construct(); |
| 59 | 59 | $Dev = \devices\Devices::listDevices(); |
| 60 | 60 | if (isset($Dev[$blueprint])) { |
| 61 | - $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n"); |
|
| 62 | - $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_" . $Dev[$blueprint]['module']; |
|
| 61 | + $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n"); |
|
| 62 | + $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_".$Dev[$blueprint]['module']; |
|
| 63 | 63 | $this->device = new $class_name(); |
| 64 | 64 | if (!$this->device) { |
| 65 | 65 | $this->loggerInstance->debug(2, "module loading failed"); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } else { |
| 69 | 69 | print("unknown devicename:$blueprint\n"); |
| 70 | 70 | } |
| 71 | - $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory']; |
|
| 71 | + $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory']; |
|
| 72 | 72 | $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0; |
| 73 | 73 | $this->device->device_id = $blueprint; |
| 74 | 74 | $options = \devices\Devices::$Options; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->installerPath = $cache['path']; |
| 83 | 83 | if ($this->installerPath !== NULL && $token === NULL && $password === NULL) { |
| 84 | 84 | $this->loggerInstance->debug(4, "Using cached installer for: $device\n"); |
| 85 | - $installerProperties['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
| 85 | + $installerProperties['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
| 86 | 86 | $installerProperties['mime'] = $cache['mime']; |
| 87 | 87 | } else { |
| 88 | 88 | $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $token, $password); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done"); |
| 165 | 165 | $installer = $dev->writeInstaller(); |
| 166 | 166 | $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete"); |
| 167 | - $iPath = $dev->FPATH . '/tmp/' . $installer; |
|
| 167 | + $iPath = $dev->FPATH.'/tmp/'.$installer; |
|
| 168 | 168 | if ($iPath && is_file($iPath)) { |
| 169 | 169 | if (isset($dev->options['mime'])) { |
| 170 | 170 | $out['mime'] = $dev->options['mime']; |
@@ -172,17 +172,17 @@ discard block |
||
| 172 | 172 | $info = new \finfo(); |
| 173 | 173 | $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE); |
| 174 | 174 | } |
| 175 | - $this->installerPath = $dev->FPATH . '/' . $installer; |
|
| 175 | + $this->installerPath = $dev->FPATH.'/'.$installer; |
|
| 176 | 176 | rename($iPath, $this->installerPath); |
| 177 | 177 | $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep(); |
| 178 | 178 | $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap); |
| 179 | 179 | if (CONFIG['DEBUG_LEVEL'] < 4) { |
| 180 | - \core\common\Entity::rrmdir($dev->FPATH . '/tmp'); |
|
| 180 | + \core\common\Entity::rrmdir($dev->FPATH.'/tmp'); |
|
| 181 | 181 | } |
| 182 | - $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . "\n"); |
|
| 183 | - $out['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor"; |
|
| 182 | + $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap."\n"); |
|
| 183 | + $out['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor"; |
|
| 184 | 184 | } else { |
| 185 | - $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "\n"); |
|
| 185 | + $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."\n"); |
|
| 186 | 186 | $out['link'] = 0; |
| 187 | 187 | } |
| 188 | 188 | } |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | $file = $this->installerPath; |
| 295 | 295 | $filetype = $output['mime']; |
| 296 | 296 | $this->loggerInstance->debug(4, "installer MIME type:$filetype\n"); |
| 297 | - header("Content-type: " . $filetype); |
|
| 298 | - header('Content-Disposition: inline; filename="' . basename($file) . '"'); |
|
| 299 | - header('Content-Length: ' . filesize($file)); |
|
| 297 | + header("Content-type: ".$filetype); |
|
| 298 | + header('Content-Disposition: inline; filename="'.basename($file).'"'); |
|
| 299 | + header('Content-Length: '.filesize($file)); |
|
| 300 | 300 | ob_clean(); |
| 301 | 301 | flush(); |
| 302 | 302 | readfile($file); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
| 318 | 318 | $offset = 60 * 60 * 24 * 30; |
| 319 | 319 | // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it |
| 320 | - $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
|
| 320 | + $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; |
|
| 321 | 321 | $blob = $inputImage; |
| 322 | 322 | |
| 323 | 323 | if ($resize === TRUE) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $filetype = 'image/png'; // default, only one code path where it can become different |
| 372 | 372 | list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn); |
| 373 | 373 | if ($resize) { |
| 374 | - $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png'; |
|
| 374 | + $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png'; |
|
| 375 | 375 | } |
| 376 | 376 | if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE |
| 377 | 377 | $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n"); |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (count($logoAttribute) == 0) { |
| 382 | 382 | return NULL; |
| 383 | 383 | } |
| 384 | - $this->loggerInstance->debug(4,"RESIZE:$width:$height\n"); |
|
| 384 | + $this->loggerInstance->debug(4, "RESIZE:$width:$height\n"); |
|
| 385 | 385 | $meta = $this->processImage($logoAttribute[0]['value'], $logoFile, $width, $height, $resize); |
| 386 | 386 | $filetype = $meta['filetype']; |
| 387 | 387 | $expiresString = $meta['expires']; |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | if (!isset($device['match'])) { |
| 462 | 462 | continue; |
| 463 | 463 | } |
| 464 | - if (preg_match('/' . $device['match'] . '/', $browser)) { |
|
| 464 | + if (preg_match('/'.$device['match'].'/', $browser)) { |
|
| 465 | 465 | return $this->returnDevice($devId, $device); |
| 466 | 466 | } |
| 467 | 467 | } |