@@ -132,20 +132,20 @@ discard block |
||
| 132 | 132 | if ($device == "TOTAL") { |
| 133 | 133 | continue; |
| 134 | 134 | } |
| 135 | - $retstring .= "<tr><td>$device</td><td>" . $numbers['ADMIN'] . "</td><td>" . $numbers['SILVERBULLET'] . "</td><td>" . $numbers['USER'] . "</td></tr>"; |
|
| 135 | + $retstring .= "<tr><td>$device</td><td>".$numbers['ADMIN']."</td><td>".$numbers['SILVERBULLET']."</td><td>".$numbers['USER']."</td></tr>"; |
|
| 136 | 136 | } |
| 137 | - $retstring .= "<tr><td><strong>TOTAL</strong></td><td><strong>" . $data['TOTAL']['ADMIN'] . "</strong></td><td><strong>" . $data['TOTAL']['SILVERBULLET'] . "</strong></td><td><strong>" . $data['TOTAL']['USER'] . "</strong></td></tr>"; |
|
| 137 | + $retstring .= "<tr><td><strong>TOTAL</strong></td><td><strong>".$data['TOTAL']['ADMIN']."</strong></td><td><strong>".$data['TOTAL']['SILVERBULLET']."</strong></td><td><strong>".$data['TOTAL']['USER']."</strong></td></tr>"; |
|
| 138 | 138 | break; |
| 139 | 139 | case "XML": |
| 140 | 140 | // the calls to date() operate on current date, so there is no chance for a FALSE to be returned. Silencing scrutinizer. |
| 141 | - $retstring .= "<federation id='$this->tld' ts='" . /** @scrutinizer ignore-type */ date("Y-m-d") . "T" . /** @scrutinizer ignore-type */ date("H:i:s") . "'>\n"; |
|
| 141 | + $retstring .= "<federation id='$this->tld' ts='"./** @scrutinizer ignore-type */ date("Y-m-d")."T"./** @scrutinizer ignore-type */ date("H:i:s")."'>\n"; |
|
| 142 | 142 | foreach ($data as $device => $numbers) { |
| 143 | 143 | if ($device == "TOTAL") { |
| 144 | 144 | continue; |
| 145 | 145 | } |
| 146 | - $retstring .= " <device name='" . $device . "'>\n <downloads group='admin'>" . $numbers['ADMIN'] . "</downloads>\n <downloads group='managed_idp'>" . $numbers['SILVERBULLET'] . "</downloads>\n <downloads group='user'>" . $numbers['USER'] . "</downloads>\n </device>"; |
|
| 146 | + $retstring .= " <device name='".$device."'>\n <downloads group='admin'>".$numbers['ADMIN']."</downloads>\n <downloads group='managed_idp'>".$numbers['SILVERBULLET']."</downloads>\n <downloads group='user'>".$numbers['USER']."</downloads>\n </device>"; |
|
| 147 | 147 | } |
| 148 | - $retstring .= "<total>\n <downloads group='admin'>" . $data['TOTAL']['ADMIN'] . "</downloads>\n <downloads group='managed_idp'>" . $data['TOTAL']['SILVERBULLET'] . "</downloads>\n <downloads group='user'>" . $data['TOTAL']['USER'] . "</downloads>\n</total>\n"; |
|
| 148 | + $retstring .= "<total>\n <downloads group='admin'>".$data['TOTAL']['ADMIN']."</downloads>\n <downloads group='managed_idp'>".$data['TOTAL']['SILVERBULLET']."</downloads>\n <downloads group='user'>".$data['TOTAL']['USER']."</downloads>\n</total>\n"; |
|
| 149 | 149 | $retstring .= "</federation>"; |
| 150 | 150 | break; |
| 151 | 151 | case "array": |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $identifier = $this->databaseHandle->lastID(); |
| 238 | 238 | |
| 239 | 239 | if ($identifier == 0 || !$this->loggerInstance->writeAudit($ownerId, "NEW", "Organisation $identifier")) { |
| 240 | - $text = "<p>Could not create a new " . \config\ConfAssistant::CONSORTIUM['nomenclature_inst'] . "!</p>"; |
|
| 240 | + $text = "<p>Could not create a new ".\config\ConfAssistant::CONSORTIUM['nomenclature_inst']."!</p>"; |
|
| 241 | 241 | echo $text; |
| 242 | 242 | throw new Exception($text); |
| 243 | 243 | } |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | return; // no update to fetch |
| 380 | 380 | } |
| 381 | 381 | $certDetails = openssl_x509_parse($entryInQuestion['CERT']); |
| 382 | - $expiry = "20" . $certDetails['validTo'][0] . $certDetails['validTo'][1] . "-" . $certDetails['validTo'][2] . $certDetails['validTo'][3] . "-" . $certDetails['validTo'][4] . $certDetails['validTo'][5]; |
|
| 382 | + $expiry = "20".$certDetails['validTo'][0].$certDetails['validTo'][1]."-".$certDetails['validTo'][2].$certDetails['validTo'][3]."-".$certDetails['validTo'][4].$certDetails['validTo'][5]; |
|
| 383 | 383 | openssl_x509_export($entryInQuestion['CERT'], $pem); |
| 384 | 384 | $updateQuery = "UPDATE federation_servercerts SET status = 'ISSUED', certificate = ?, expiry = ? WHERE ca_name = 'eduPKI' AND request_serial = ?"; |
| 385 | 385 | $this->databaseHandle->exec($updateQuery, "ssi", $pem, $expiry, $reqSerial); |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | $loggerInstance = new \core\common\Logging(); |
| 76 | 76 | $olddomain = textdomain(NULL); |
| 77 | 77 | $loggerInstance->debug(4, "set_locale($domain)\n"); |
| 78 | - $loggerInstance->debug(4, ROOT . "\n"); |
|
| 78 | + $loggerInstance->debug(4, ROOT."\n"); |
|
| 79 | 79 | textdomain($domain); |
| 80 | - bindtextdomain($domain, ROOT . "/translation/"); |
|
| 80 | + bindtextdomain($domain, ROOT."/translation/"); |
|
| 81 | 81 | return $olddomain; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | // check if this language is supported by the CAT config |
| 130 | 130 | foreach (\config\Master::LANGUAGES as $language => $value) { |
| 131 | - if (preg_match("/^" . $language . ".*/", $tryLang)) { |
|
| 131 | + if (preg_match("/^".$language.".*/", $tryLang)) { |
|
| 132 | 132 | $localeTmp = $value['locale']; |
| 133 | 133 | $langIndex = $language; // ??? |
| 134 | 134 | break; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | - putenv("LC_ALL=" . $theLocale); |
|
| 146 | + putenv("LC_ALL=".$theLocale); |
|
| 147 | 147 | $_SESSION['language'] = $langIndex; |
| 148 | 148 | $loggerInstance = new \core\common\Logging(); |
| 149 | 149 | $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n"); |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | public function der2pem($derData) |
| 89 | 89 | { |
| 90 | 90 | $pem = chunk_split(base64_encode($derData), 64, "\n"); |
| 91 | - $pem = "-----BEGIN CERTIFICATE-----\n" . $pem . "-----END CERTIFICATE-----\n"; |
|
| 91 | + $pem = "-----BEGIN CERTIFICATE-----\n".$pem."-----END CERTIFICATE-----\n"; |
|
| 92 | 92 | return $pem; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | private function writeToFile($filename, $message) |
| 51 | 51 | { |
| 52 | - file_put_contents(\config\Master::PATHS['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND); |
|
| 52 | + file_put_contents(\config\Master::PATHS['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } else { |
| 82 | 82 | $output .= var_export($stuff, TRUE); |
| 83 | 83 | } |
| 84 | - $output = $prefix . $output . $suffix; |
|
| 84 | + $output = $prefix.$output.$suffix; |
|
| 85 | 85 | $this->writeToFile("debug.log", $output); |
| 86 | 86 | |
| 87 | 87 | return; |
@@ -129,6 +129,6 @@ discard block |
||
| 129 | 129 | $logTextStep1 = preg_replace("/[\n\r]/", "", $query); |
| 130 | 130 | $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1); |
| 131 | 131 | $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2); |
| 132 | - $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n"); |
|
| 132 | + $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n"); |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | \ No newline at end of file |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $returnArray = []; |
| 70 | 70 | $returnArray['status'] = $status; |
| 71 | 71 | $returnArray['data'] = $data; |
| 72 | - $returnArray['tou'] = "Please consult Terms of Use at: //" . $host . \core\CAT::getRootUrlPath() . "/tou.php"; |
|
| 72 | + $returnArray['tou'] = "Please consult Terms of Use at: //".$host.\core\CAT::getRootUrlPath()."/tou.php"; |
|
| 73 | 73 | if (!empty($otherData)) { |
| 74 | 74 | $returnArray['otherdata'] = $otherData; |
| 75 | 75 | } |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | public function sendLogo($identifier, $type, $width, $height) |
| 312 | 312 | { |
| 313 | 313 | $logo = $this->getLogo($identifier, $type, $width, $height); |
| 314 | - $blob = $logo === NULL ? file_get_contents(ROOT . '/web/resources/images/empty.png') : $logo['blob']; |
|
| 315 | - header("Content-type: " . $logo['filetype']); |
|
| 314 | + $blob = $logo === NULL ? file_get_contents(ROOT.'/web/resources/images/empty.png') : $logo['blob']; |
|
| 315 | + header("Content-type: ".$logo['filetype']); |
|
| 316 | 316 | header("Cache-Control:max-age=36000, must-revalidate"); |
| 317 | 317 | header($logo['expires']); |
| 318 | 318 | echo $blob; |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | parent::__construct(); |
| 66 | 66 | $Dev = \devices\Devices::listDevices(); |
| 67 | 67 | if (isset($Dev[$blueprint])) { |
| 68 | - $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n"); |
|
| 69 | - $class_name = "\devices\\" . $Dev[$blueprint]['directory'] . "\Device" . $Dev[$blueprint]['module']; |
|
| 68 | + $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n"); |
|
| 69 | + $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device".$Dev[$blueprint]['module']; |
|
| 70 | 70 | $this->device = new $class_name(); |
| 71 | 71 | if (!$this->device) { |
| 72 | 72 | $this->loggerInstance->debug(2, "module loading failed"); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } else { |
| 76 | 76 | echo("unknown devicename:$blueprint\n"); |
| 77 | 77 | } |
| 78 | - $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory']; |
|
| 78 | + $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory']; |
|
| 79 | 79 | $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0; |
| 80 | 80 | $this->device->device_id = $blueprint; |
| 81 | 81 | $options = \devices\Devices::$Options; |
@@ -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(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_YES"] . "\n"); |
|
| 147 | + $this->loggerInstance->debug(3, "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(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_NO"] . "\n"); |
|
| 151 | + $this->loggerInstance->debug(3, "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; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if ($this->idPFederation === NULL && preg_match("/\.(..)$/", $realm, $matches)) { |
| 114 | 114 | $this->idPFederation = strtoupper($matches[1]); |
| 115 | 115 | } |
| 116 | - $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is " . $this->idPFederation . "\n"); |
|
| 116 | + $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is ".$this->idPFederation."\n"); |
|
| 117 | 117 | } |
| 118 | 118 | /* The eduroam OT monitoring has the following return codes: |
| 119 | 119 | * |
@@ -443,12 +443,12 @@ discard block |
||
| 443 | 443 | break; |
| 444 | 444 | case \core\AbstractProfile::READINESS_LEVEL_NOTREADY: |
| 445 | 445 | $this->additionalFindings[AbstractTest::INFRA_IDP_RADIUS][] = ["Profile" => "UNCONCLUSIVE"]; |
| 446 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
| 446 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
| 447 | 447 | break; |
| 448 | 448 | default: |
| 449 | 449 | } |
| 450 | 450 | } else { |
| 451 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
| 451 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | |
@@ -148,27 +148,27 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | // it could match CN or sAN:DNS, we don't care which |
| 150 | 150 | if (isset($this->TLS_CA_checks_result[$host]['certdata']['subject'])) { |
| 151 | - $this->loggerInstance->debug(4, "Checking expected server name " . $this->expectedName . " against Subject: "); |
|
| 151 | + $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName." against Subject: "); |
|
| 152 | 152 | $this->loggerInstance->debug(4, $this->TLS_CA_checks_result[$host]['certdata']['subject']); |
| 153 | 153 | // we are checking against accidental misconfig, not attacks, so loosely checking against end of string is appropriate |
| 154 | - if (preg_match("/CN=" . $this->expectedName . "/", $this->TLS_CA_checks_result[$host]['certdata']['subject']) === 1) { |
|
| 154 | + if (preg_match("/CN=".$this->expectedName."/", $this->TLS_CA_checks_result[$host]['certdata']['subject']) === 1) { |
|
| 155 | 155 | return TRUE; |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | if (isset($this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname'])) { |
| 159 | - $this->loggerInstance->debug(4, "Checking expected server name " . $this->expectedName . " against sANs: "); |
|
| 159 | + $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName." against sANs: "); |
|
| 160 | 160 | $this->loggerInstance->debug(4, $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname']); |
| 161 | 161 | $testNames = $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname']; |
| 162 | 162 | if (!is_array($testNames)) { |
| 163 | 163 | $testNames = [$testNames]; |
| 164 | 164 | } |
| 165 | 165 | foreach ($testNames as $oneName) { |
| 166 | - if (preg_match("/" . $this->expectedName . "/", $oneName) === 1) { |
|
| 166 | + if (preg_match("/".$this->expectedName."/", $oneName) === 1) { |
|
| 167 | 167 | return TRUE; |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | - $this->loggerInstance->debug(3, "Tried to check expected server name " . $this->expectedName . " but neither CN nor sANs matched."); |
|
| 171 | + $this->loggerInstance->debug(3, "Tried to check expected server name ".$this->expectedName." but neither CN nor sANs matched."); |
|
| 172 | 172 | |
| 173 | 173 | $this->TLS_CA_checks_result[$host]['cert_oddity'] = RADIUSTests::CERTPROB_DYN_SERVER_NAME_MISMATCH; |
| 174 | 174 | return FALSE; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status']; |
| 199 | 199 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']]; |
| 200 | 200 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected']; |
| 201 | - $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private']; |
|
| 201 | + $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private']; |
|
| 202 | 202 | if (!isset($this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k])) { |
| 203 | 203 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k] = []; |
| 204 | 204 | } |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | // but code analysers want this more explicit, so here is this extra |
| 244 | 244 | // call to escapeshellarg() |
| 245 | 245 | $escapedHost = escapeshellarg($host); |
| 246 | - $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1\n"); |
|
| 246 | + $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1\n"); |
|
| 247 | 247 | $time_start = microtime(true); |
| 248 | 248 | $opensslbabble = []; |
| 249 | 249 | $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures |
| 250 | - exec(\config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -no_ssl3 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1", $opensslbabble, $result); |
|
| 250 | + exec(\config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -no_ssl3 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1", $opensslbabble, $result); |
|
| 251 | 251 | $time_stop = microtime(true); |
| 252 | 252 | $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000); |
| 253 | 253 | $testresults['returncode'] = $result; |