@@ -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; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | case "core\User": |
140 | 140 | return $this->userName; |
141 | 141 | default: |
142 | - throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - " . get_class($this) . "!"); |
|
142 | + throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - ".get_class($this)."!"); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function beginFlushAttributes($extracondition = "") |
179 | 179 | { |
180 | - $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : ""); |
|
180 | + $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : ""); |
|
181 | 181 | $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND option_name NOT LIKE '%_file' $extracondition"); |
182 | 182 | $this->updateFreshness(); |
183 | 183 | $execFlush = $this->databaseHandle->exec("SELECT row FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier $extracondition"); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function commitFlushAttributes(array $tobedeleted) |
199 | 199 | { |
200 | - $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : ""); |
|
200 | + $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : ""); |
|
201 | 201 | foreach (array_keys($tobedeleted) as $row) { |
202 | 202 | $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND row = $row"); |
203 | 203 | $this->updateFreshness(); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | { |
227 | 227 | $relevantId = $this->getRelevantIdentifier(); |
228 | 228 | $identifierType = (is_int($relevantId) ? "i" : "s"); |
229 | - $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType . "sss", $relevantId, $attrName, $attrLang, $attrValue); |
|
229 | + $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType."sss", $relevantId, $attrName, $attrLang, $attrValue); |
|
230 | 230 | $this->updateFreshness(); |
231 | 231 | } |
232 | 232 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | private function inputValidationError($customtext) |
41 | 41 | { |
42 | 42 | \core\common\Entity::intoThePotatoes(); |
43 | - $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>"; |
|
43 | + $retval = "<p>"._("Input validation error: ").$customtext."</p>"; |
|
44 | 44 | \core\common\Entity::outOfThePotatoes(); |
45 | 45 | return $retval; |
46 | 46 | } |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | try { |
542 | 542 | $image->readImageBlob($binary); |
543 | 543 | } catch (\ImagickException $exception) { |
544 | - echo "Error" . $exception->getMessage(); |
|
544 | + echo "Error".$exception->getMessage(); |
|
545 | 545 | return FALSE; |
546 | 546 | } |
547 | 547 | // image survived the sanity check |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | const ACTIONS = [ |
250 | 250 | // Inst-level actions. |
251 | 251 | API::ACTION_NEWINST_BY_REF => [ |
252 | - "REQ" => [API::AUXATTRIB_EXTERNALID,], |
|
252 | + "REQ" => [API::AUXATTRIB_EXTERNALID, ], |
|
253 | 253 | "OPT" => [ |
254 | 254 | 'general:geo_coordinates', |
255 | 255 | 'general:logo_file', |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ], |
267 | 267 | ], |
268 | 268 | API::ACTION_NEWINST => [ |
269 | - "REQ" => [API::AUXATTRIB_INSTTYPE,], // "IdP", "SP" or "IdPSP" |
|
269 | + "REQ" => [API::AUXATTRIB_INSTTYPE, ], // "IdP", "SP" or "IdPSP" |
|
270 | 270 | "OPT" => [ |
271 | 271 | 'general:instname', |
272 | 272 | 'general:geo_coordinates', |
@@ -562,8 +562,8 @@ discard block |
||
562 | 562 | |
563 | 563 | case \core\Options::TYPECODE_COORDINATES: |
564 | 564 | $extension = \core\Options::TYPECODE_TEXT; |
565 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
566 | - $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE']; |
|
565 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
566 | + $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE']; |
|
567 | 567 | break; |
568 | 568 | case \core\Options::TYPECODE_TEXT: |
569 | 569 | // Fall-through: they all get the same treatment. |
@@ -573,18 +573,18 @@ discard block |
||
573 | 573 | // Fall-through: they all get the same treatment. |
574 | 574 | case \core\Options::TYPECODE_INTEGER: |
575 | 575 | $extension = $optionInfo['type']; |
576 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
577 | - $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE']; |
|
576 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
577 | + $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE']; |
|
578 | 578 | if ($optionInfo['flag'] == "ML") { |
579 | - $coercedInline["value"][$basename . "-lang"] = $oneAttrib['LANG']; |
|
579 | + $coercedInline["value"][$basename."-lang"] = $oneAttrib['LANG']; |
|
580 | 580 | } |
581 | 581 | break; |
582 | 582 | case \core\Options::TYPECODE_FILE: |
583 | 583 | // Binary data is expected in base64 encoding. This is true also for PEM files! |
584 | 584 | $extension = $optionInfo['type']; |
585 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
586 | - file_put_contents($dir['dir'] . "/" . $basename . "-" . $extension, base64_decode($oneAttrib['VALUE'])); |
|
587 | - $coercedFile["value"]['tmp_name'][$basename . "-" . $extension] = $dir['dir'] . "/" . $basename . "-" . $extension; |
|
585 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
586 | + file_put_contents($dir['dir']."/".$basename."-".$extension, base64_decode($oneAttrib['VALUE'])); |
|
587 | + $coercedFile["value"]['tmp_name'][$basename."-".$extension] = $dir['dir']."/".$basename."-".$extension; |
|
588 | 588 | break; |
589 | 589 | default: |
590 | 590 | throw new Exception("We don't seem to know this type code!"); |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | public function returnSuccess($details) { |
614 | 614 | $output = json_encode(["result" => "SUCCESS", "details" => $details], JSON_PRETTY_PRINT); |
615 | 615 | if ($output === FALSE) { |
616 | - $this->returnError(API::ERROR_INTERNAL_ERROR, "Unable to JSON encode return data: ". json_last_error(). " - ". json_last_error_msg()); |
|
616 | + $this->returnError(API::ERROR_INTERNAL_ERROR, "Unable to JSON encode return data: ".json_last_error()." - ".json_last_error_msg()); |
|
617 | 617 | } |
618 | 618 | else { |
619 | 619 | echo $output; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // also send user back to the overview page |
73 | 73 | if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
74 | 74 | // basic sanity checks before we hand this over to openssl |
75 | - $sanitisedCsr = $validator->string($_POST['CSR'] ?? "" , TRUE); |
|
75 | + $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE); |
|
76 | 76 | if (openssl_csr_get_public_key($sanitisedCsr) === FALSE) { |
77 | 77 | throw new Exception("Sorry: Unable to parse the submitted public key - no public key inside?"); |
78 | 78 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $fed = $validator->existingFederation($_POST['NRO-list']); |
87 | 87 | $country = strtoupper($fed->tld); |
88 | 88 | $DN[] = "C=$country"; |
89 | - $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)]; |
|
89 | + $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)]; |
|
90 | 90 | $DN[] = "CN=comes.from.eduroam.db"; |
91 | 91 | $policies[] = "eduroam IdP"; |
92 | 92 | $policies[] = "eduroam SP"; |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | default: |
105 | 105 | throw new Exception("Sorry: Unknown level of issuance requested."); |
106 | 106 | } |
107 | - echo "<p>" . _("Requesting a certificate with the following properties"); |
|
107 | + echo "<p>"._("Requesting a certificate with the following properties"); |
|
108 | 108 | echo "<ul>"; |
109 | - echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
|
110 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>"; |
|
111 | - echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, <[email protected]>').") . "</li>"; |
|
109 | + echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; |
|
110 | + echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>"; |
|
111 | + echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, <[email protected]>').")."</li>"; |
|
112 | 112 | echo "</ul></p>"; |
113 | 113 | /* $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes); |
114 | 114 | if (is_resource($ossl)) { |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | throw new Exception("Calling openssl in a fancy way did not work."); |
122 | 122 | } |
123 | 123 | echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */ |
124 | - $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country]; |
|
124 | + $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country]; |
|
125 | 125 | // our certs can be good for max 5 years |
126 | 126 | $fed->requestCertificate($newCsrWithMeta, 1825); |
127 | 127 | echo "<p>"._("The certificate was requested.")."</p>"; |
128 | 128 | ?> |
129 | 129 | <form action="overview_certificates.php" method="GET"> |
130 | - <button type="submit"><?php echo _("Back to Certificate Overview");?></button> |
|
130 | + <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> |
|
131 | 131 | </form> |
132 | 132 | <?php |
133 | 133 | echo $deco->footer(); |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | |
137 | 137 | // if we did not get a SAVE button, display UI for a fresh request instead |
138 | 138 | ?> |
139 | - <h2><?php echo _("1. Certificate Holder Details");?></h2> |
|
139 | + <h2><?php echo _("1. Certificate Holder Details"); ?></h2> |
|
140 | 140 | <form action="action_req_certificate.php" method="POST"> |
141 | 141 | <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input> |
142 | 142 | <?php |
143 | 143 | if (count($feds) == 1) { |
144 | 144 | $fedObject = new \core\Federation($feds[0]['value']); |
145 | - echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>"; |
|
146 | - echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>'; |
|
145 | + echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>"; |
|
146 | + echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>'; |
|
147 | 147 | } else { |
148 | 148 | ?> |
149 | 149 | <select name="NRO-list" id="NRO-list"> |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | <?php |
152 | 152 | foreach ($feds as $oneFed) { |
153 | 153 | $fedObject = new \core\Federation($oneFed['value']); |
154 | - echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>"; |
|
154 | + echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>"; |
|
155 | 155 | } |
156 | 156 | ?> |
157 | 157 | </select> |
@@ -171,15 +171,15 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | foreach ($allIdPs as $id => $name) { |
174 | - echo '<option value="' . $id . '">' . $name . "</option>"; |
|
174 | + echo '<option value="'.$id.'">'.$name."</option>"; |
|
175 | 175 | } |
176 | 176 | ?> |
177 | 177 | </select> |
178 | 178 | <br/> |
179 | - <h2><?php echo _("2. CSR generation");?></h2> |
|
180 | - <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p> |
|
179 | + <h2><?php echo _("2. CSR generation"); ?></h2> |
|
180 | + <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> |
|
181 | 181 | <p>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /DC=test/DC=test/DC=eduroam/C=XY/O=WillBeReplaced/CN=will.be.replaced</p> |
182 | - <h2><?php echo _("3. Submission");?></h2> |
|
182 | + <h2><?php echo _("3. Submission"); ?></h2> |
|
183 | 183 | <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |
184 | 184 | <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button> |
185 | 185 | </form> |