@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) |
135 | 135 | { |
136 | 136 | if (\config\Master::PATHS['logdir']) { |
137 | - $file = fopen(\config\Master::PATHS['logdir'] . "/download_details.log", "a"); |
|
137 | + $file = fopen(\config\Master::PATHS['logdir']."/download_details.log", "a"); |
|
138 | 138 | if ($file === FALSE) { |
139 | 139 | throw new Exception("Unable to open file for append: $file"); |
140 | 140 | } |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | } |
170 | 170 | // check if a CA with identical DN was added - alert NRO if so |
171 | 171 | if (array_search($ca['subject'], $baselineCA) !== FALSE) { |
172 | - $retval[AbstractProfile::CA_CLASH_ADDED] .= "#SHA1 for CA with DN '" . print_r($ca['subject'], TRUE) . "' has SHA1 fingerprints (pre-existing) " . /** @scrutinizer ignore-type */ array_search($ca['subject'], $baselineCA) . " and (added) " . $ca['sha1']; |
|
172 | + $retval[AbstractProfile::CA_CLASH_ADDED] .= "#SHA1 for CA with DN '".print_r($ca['subject'], TRUE)."' has SHA1 fingerprints (pre-existing) "./** @scrutinizer ignore-type */ array_search($ca['subject'], $baselineCA)." and (added) ".$ca['sha1']; |
|
173 | 173 | } else { |
174 | - $retval[AbstractProfile::CA_ADDED] .= "#CA with DN '" . print_r($ca['subject'], TRUE) . "' and SHA1 fingerprint " . $ca['sha1'] . " was added as trust anchor"; |
|
174 | + $retval[AbstractProfile::CA_ADDED] .= "#CA with DN '".print_r($ca['subject'], TRUE)."' and SHA1 fingerprint ".$ca['sha1']." was added as trust anchor"; |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | // check if a servername was added |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | foreach ($new->getAttributes("eap:server_name") as $newName) { |
183 | 183 | if (!in_array($newName['value'], $baselineNames)) { |
184 | - $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '" . $newName['value'] . "' added"; |
|
184 | + $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '".$newName['value']."' added"; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | return $retval; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $eaptype = new common\EAP($eapQuery->eap_method_id); |
206 | 206 | $eapTypeArray[] = $eaptype; |
207 | 207 | } |
208 | - $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . print_r($eapTypeArray, true)); |
|
208 | + $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n".print_r($eapTypeArray, true)); |
|
209 | 209 | return $eapTypeArray; |
210 | 210 | } |
211 | 211 | |
@@ -287,16 +287,16 @@ discard block |
||
287 | 287 | if (count($this->getAttributes("internal:checkuser_outer")) > 0) { |
288 | 288 | // we are supposed to use a specific outer username for checks, |
289 | 289 | // which is different from the outer username we put into installers |
290 | - return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm; |
|
290 | + return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
|
291 | 291 | } |
292 | 292 | if (count($this->getAttributes("internal:use_anon_outer")) > 0) { |
293 | 293 | // no special check username, but there is an anon outer ID for |
294 | 294 | // installers - so let's use that one |
295 | - return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm; |
|
295 | + return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
|
296 | 296 | } |
297 | 297 | // okay, no guidance on outer IDs at all - but we need *something* to |
298 | 298 | // test with for the RealmChecks. So: |
299 | - return "@" . $realm; |
|
299 | + return "@".$realm; |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | public function prepShowtime() |
745 | 745 | { |
746 | 746 | $properConfig = $this->readyForShowtime(); |
747 | - $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier); |
|
747 | + $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier); |
|
748 | 748 | |
749 | 749 | $attribs = $this->getCollapsedAttributes(); |
750 | 750 | // if not enough info to go live, set FALSE |
@@ -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; |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | class CertificationAuthorityEduPkiServer extends EntityWithDBProperties implements CertificationAuthorityInterface |
18 | 18 | { |
19 | 19 | |
20 | - private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | - private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | - private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
20 | + private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | + private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | + private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
23 | 23 | private const EDUPKI_RA_ID = 700; |
24 | 24 | private const EDUPKI_CERT_PROFILE = "Radius Server SOAP"; |
25 | 25 | private const EDUPKI_RA_PKEY_PASSPHRASE = "..."; |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | parent::__construct(); |
36 | 36 | |
37 | 37 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) { |
38 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
38 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
39 | 39 | } |
40 | 40 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) { |
41 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
41 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
42 | 42 | } |
43 | 43 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) { |
44 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
44 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -96,19 +96,19 @@ discard block |
||
96 | 96 | // initialise connection to eduPKI CA / eduroam RA and send the request to them |
97 | 97 | try { |
98 | 98 | $altArray = [# Array mit den Subject Alternative Names |
99 | - "email:" . $csr["USERMAIL"] |
|
99 | + "email:".$csr["USERMAIL"] |
|
100 | 100 | ]; |
101 | 101 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
102 | 102 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
103 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n"); |
|
104 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n"); |
|
103 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n"); |
|
104 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n"); |
|
105 | 105 | $this->loggerInstance->debug(5, "PARAM_3: "); |
106 | 106 | $this->loggerInstance->debug(5, $altArray); |
107 | - $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n"); |
|
108 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
109 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
110 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n"); |
|
111 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
107 | + $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n"); |
|
108 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
109 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
110 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n"); |
|
111 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
112 | 112 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
113 | 113 | $soapNewRequest = $soapPub->newRequest( |
114 | 114 | CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | } catch (Exception $e) { |
131 | 131 | // PHP 7.1 can do this much better |
132 | 132 | if (is_soap_fault($e)) { |
133 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
133 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
134 | 134 | $e->faultstring |
135 | 135 | }\n"); |
136 | 136 | } |
137 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
137 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
138 | 138 | } |
139 | 139 | try { |
140 | 140 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
169 | 169 | // rather than just using the string. Grr. |
170 | 170 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
171 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
171 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
172 | 172 | // retrieve our RA cert from filesystem |
173 | 173 | // the RA certificates are not needed right now because we |
174 | 174 | // have resorted to S/MIME signatures with openssl command-line |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
181 | 181 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
182 | 182 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
183 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
183 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
184 | 184 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
185 | 185 | $output = []; |
186 | 186 | $return = 999; |
@@ -189,21 +189,21 @@ discard block |
||
189 | 189 | throw new Exception("Non-zero return value from openssl smime!"); |
190 | 190 | } |
191 | 191 | // and get the signature blob back from the filesystem |
192 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
192 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
193 | 193 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
194 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
195 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
196 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
194 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
195 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
196 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
197 | 197 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
198 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
199 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
198 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
199 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
200 | 200 | if ($soapIssueCert === FALSE) { |
201 | 201 | throw new Exception("The locally approved request was NOT processed by the CA."); |
202 | 202 | } |
203 | 203 | } catch (SoapFault $e) { |
204 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
204 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
205 | 205 | } catch (Exception $e) { |
206 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
206 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
207 | 207 | } |
208 | 208 | return $soapReqnum; |
209 | 209 | } |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | throw new Exception("CAInfo has no root certificate for us!"); |
256 | 256 | } |
257 | 257 | } catch (SoapFault $e) { |
258 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
258 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
259 | 259 | } catch (Exception $e) { |
260 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
260 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
261 | 261 | } |
262 | 262 | return [ |
263 | 263 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
291 | 291 | // rather than just using the string. Grr. |
292 | 292 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
293 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
293 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
294 | 294 | // retrieve our RA cert from filesystem |
295 | 295 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
296 | 296 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
297 | 297 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
298 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
298 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
299 | 299 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
300 | 300 | $output = []; |
301 | 301 | $return = 999; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | throw new Exception("Non-zero return value from openssl smime!"); |
305 | 305 | } |
306 | 306 | // and get the signature blob back from the filesystem |
307 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
307 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
308 | 308 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
309 | 309 | if ($soapIssueRev === FALSE) { |
310 | 310 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | } catch (Exception $e) { |
313 | 313 | // PHP 7.1 can do this much better |
314 | 314 | if (is_soap_fault($e)) { |
315 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
315 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
316 | 316 | } |
317 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
317 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | */ |
415 | 415 | public function soapToXmlInteger($x) |
416 | 416 | { |
417 | - return '<' . $x[0] . '>' |
|
417 | + return '<'.$x[0].'>' |
|
418 | 418 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
419 | - . '</' . $x[0] . '>'; |
|
419 | + . '</'.$x[0].'>'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | /** |
@@ -435,9 +435,9 @@ discard block |
||
435 | 435 | // dump private key into directory |
436 | 436 | $outstring = ""; |
437 | 437 | openssl_pkey_export($privateKey, $outstring); |
438 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
438 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
439 | 439 | // PHP can only do one DC in the Subject. But we need three. |
440 | - $execCmd = \config\Master::PATHS['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username"; |
|
440 | + $execCmd = \config\Master::PATHS['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username"; |
|
441 | 441 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
442 | 442 | $output = []; |
443 | 443 | $return = 999; |
@@ -170,12 +170,12 @@ |
||
170 | 170 | 'db' => 'radacct', |
171 | 171 | 'user' => 'someuser', |
172 | 172 | 'pass' => 'somepass', |
173 | - 'readonly' => TRUE,], |
|
173 | + 'readonly' => TRUE, ], |
|
174 | 174 | 'RADIUS_2' => [ |
175 | 175 | 'host' => 'auth-2.hosted.eduroam.org', |
176 | 176 | 'db' => 'radacct', |
177 | 177 | 'user' => 'someuser', |
178 | 178 | 'pass' => 'somepass', |
179 | - 'readonly' => TRUE,], |
|
179 | + 'readonly' => TRUE, ], |
|
180 | 180 | ]; |
181 | 181 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
255 | 255 | } |
256 | 256 | if ($clients > $maxSupportedClients * 0.9) { |
257 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
257 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | return $this->findGoodServerLocation($adminLocation, "DEFAULT", $blacklistedServers); |
264 | 264 | } |
265 | 265 | if (count($serverCandidates) == 0) { |
266 | - throw new Exception("No available server found for new SP! $federation " . print_r($serverCandidates, true)); |
|
266 | + throw new Exception("No available server found for new SP! $federation ".print_r($serverCandidates, true)); |
|
267 | 267 | } |
268 | 268 | // put the nearest server on top of the list |
269 | 269 | ksort($serverCandidates); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $foundFreePort1 = 0; |
292 | 292 | while ($foundFreePort1 == 0) { |
293 | 293 | $portCandidate = random_int(1200, 65535); |
294 | - $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '" . $ourserver . "' AND port_instance_1 = $portCandidate"); |
|
294 | + $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '".$ourserver."' AND port_instance_1 = $portCandidate"); |
|
295 | 295 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) { |
296 | 296 | $foundFreePort1 = $portCandidate; |
297 | 297 | } |
@@ -300,14 +300,14 @@ discard block |
||
300 | 300 | $foundFreePort2 = 0; |
301 | 301 | while ($foundFreePort2 == 0) { |
302 | 302 | $portCandidate = random_int(1200, 65535); |
303 | - $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '" . $ourSecondServer . "' AND port_instance_2 = $portCandidate"); |
|
303 | + $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '".$ourSecondServer."' AND port_instance_2 = $portCandidate"); |
|
304 | 304 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) { |
305 | 305 | $foundFreePort2 = $portCandidate; |
306 | 306 | } |
307 | 307 | } |
308 | 308 | // and make up a shared secret that is halfways readable |
309 | 309 | $futureSecret = $this->randomString(16, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); |
310 | - $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '" . $ourserver . "', radius_instance_2 = '" . $ourSecondServer . "', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier"); |
|
310 | + $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '".$ourserver."', radius_instance_2 = '".$ourSecondServer."', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier"); |
|
311 | 311 | return ["port_instance_1" => $foundFreePort1, "port_instance_2" => $foundFreePort2, "secret" => $futureSecret, "radius_instance_1" => $ourserver, "radius_instance_2" => $ourserver]; |
312 | 312 | } |
313 | 313 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function deactivate() |
356 | 356 | { |
357 | - $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::INACTIVE . " WHERE deployment_id = $this->identifier"); |
|
357 | + $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::INACTIVE." WHERE deployment_id = $this->identifier"); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function activate() |
367 | 367 | { |
368 | - $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::ACTIVE . " WHERE deployment_id = $this->identifier"); |
|
368 | + $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::ACTIVE." WHERE deployment_id = $this->identifier"); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
379 | 379 | if (count($customAttrib) == 0) { |
380 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
380 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
381 | 381 | } |
382 | 382 | return $customAttrib[0]["value"]; |
383 | 383 | } |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | { |
394 | 394 | |
395 | 395 | $hostname = "radius_hostname_$idx"; |
396 | - $ch = curl_init("http://" . $this->$hostname); |
|
396 | + $ch = curl_init("http://".$this->$hostname); |
|
397 | 397 | if ($ch === FALSE) { |
398 | 398 | $res = 'FAILURE'; |
399 | 399 | } else { |
400 | 400 | curl_setopt($ch, CURLOPT_POST, 1); |
401 | 401 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
402 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ": $post\n"); |
|
402 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.": $post\n"); |
|
403 | 403 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
404 | 404 | curl_setopt($ch, CURLOPT_HEADER, 0); |
405 | 405 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -408,13 +408,13 @@ discard block |
||
408 | 408 | $this->loggerInstance->debug(1, "curl_exec failure"); |
409 | 409 | $res = 'FAILURE'; |
410 | 410 | } else { |
411 | - $res = (string)$exec; // it is always a string due to RETURNTRANSFER but let's make Scrutinizer which thinks this could be TRUE as well |
|
411 | + $res = (string) $exec; // it is always a string due to RETURNTRANSFER but let's make Scrutinizer which thinks this could be TRUE as well |
|
412 | 412 | } |
413 | 413 | $this->loggerInstance->debug(1, "Response from FR configurator: $res\n"); |
414 | 414 | $this->loggerInstance->debug(1, $this); |
415 | 415 | } |
416 | 416 | $this->loggerInstance->debug(1, "Database update"); |
417 | - $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = " . ($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE) . " WHERE deployment_id = $this->identifier"); |
|
417 | + $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = ".($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE)." WHERE deployment_id = $this->identifier"); |
|
418 | 418 | return $res; |
419 | 419 | } |
420 | 420 | |
@@ -435,19 +435,19 @@ discard block |
||
435 | 435 | } else { |
436 | 436 | $txt = $remove ? _('Profile dectivation failed') : _('Profile activation/modification failed'); |
437 | 437 | } |
438 | - $txt = $txt . ' '; |
|
438 | + $txt = $txt.' '; |
|
439 | 439 | if (array_count_values($response)[$status] == 2) { |
440 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
440 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
441 | 441 | } else { |
442 | 442 | if ($response['res[1]'] == $status) { |
443 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
443 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
444 | 444 | } else { |
445 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
445 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
446 | 446 | } |
447 | 447 | } |
448 | 448 | $mail = \core\common\OutsideComm::mailHandle(); |
449 | 449 | $email = $this->getAttributes("support:email")[0]['value']; |
450 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
450 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
451 | 451 | $mail->addAddress($email); |
452 | 452 | if ($status == 'OK') { |
453 | 453 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | return NULL; |
482 | 482 | } |
483 | 483 | $timeout = 10; |
484 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
484 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
485 | 485 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
486 | 486 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
487 | 487 | curl_exec($ch); |
@@ -572,32 +572,32 @@ discard block |
||
572 | 572 | { |
573 | 573 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
574 | 574 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
575 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&'; |
|
575 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.'&secret='.$this->secret.'&country='.$this->getAttributes("internal:country")[0]['value'].'&'; |
|
576 | 576 | if ($remove) { |
577 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
577 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
578 | 578 | } else { |
579 | 579 | if ($this->getAttributes("managedsp:operatorname")[0]['value'] ?? NULL) { |
580 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getAttributes("managedsp:operatorname")[0]['value'] . '&'; |
|
580 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getAttributes("managedsp:operatorname")[0]['value'].'&'; |
|
581 | 581 | } |
582 | 582 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
583 | 583 | $allRealms = $this->getAllRealms(); |
584 | 584 | if (!empty($allRealms)) { |
585 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
586 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
585 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
586 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
587 | 587 | } |
588 | 588 | } |
589 | 589 | } |
590 | 590 | foreach (array_keys($toPost) as $key) { |
591 | - $elem = 'port' . $key; |
|
592 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
591 | + $elem = 'port'.$key; |
|
592 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
593 | 593 | } |
594 | 594 | $response = array(); |
595 | 595 | foreach ($toPost as $key => $value) { |
596 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
597 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
596 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
597 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
598 | 598 | } |
599 | 599 | if ($onlyone) { |
600 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
600 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
601 | 601 | } |
602 | 602 | foreach (array('OK', 'FAILURE') as $status) { |
603 | 603 | if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && in_array($status, $response)) { |
@@ -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> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
108 | 108 | ob_start(); |
109 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
109 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
110 | 110 | $source = $this->findSourceFile($source_name); |
111 | 111 | |
112 | 112 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | $output = ob_get_clean(); |
116 | 116 | if ($encoding != "NONE") { |
117 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
117 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
118 | 118 | if ($outputClean) { |
119 | 119 | $output = $outputClean; |
120 | 120 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $encoding = "NONE"; |
159 | 159 | } |
160 | 160 | if ($encoding != "NONE") { |
161 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
161 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
162 | 162 | } else { |
163 | 163 | $output_c = $source_string; |
164 | 164 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | if (isset(WindowsCommon::LANGS[$this->languageInstance->getLang()])) { |
236 | 236 | $language = WindowsCommon::LANGS[$this->languageInstance->getLang()]; |
237 | 237 | $this->lang = $language['nsis']; |
238 | - $this->codePage = 'cp' . $language['cp']; |
|
238 | + $this->codePage = 'cp'.$language['cp']; |
|
239 | 239 | } else { |
240 | 240 | $this->lang = 'English'; |
241 | 241 | $this->codePage = 'cp1252'; |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']); |
258 | 258 | $out .= "<p>"; |
259 | 259 | if ($ssidCount > $configCount) { |
260 | - $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " "; |
|
261 | - $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
260 | + $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." "; |
|
261 | + $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
262 | 262 | $out .= "<p>"; |
263 | 263 | } |
264 | 264 | // TODO - change this below |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range."); |
275 | 275 | if ($ssidCount > 1) { |
276 | 276 | $out .= "<p>"; |
277 | - $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
278 | - $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
277 | + $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
278 | + $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | return $out; |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | */ |
381 | 381 | protected function signInstaller() |
382 | 382 | { |
383 | - $fileName = $this->installerBasename . '.exe'; |
|
383 | + $fileName = $this->installerBasename.'.exe'; |
|
384 | 384 | if (!$this->sign) { |
385 | 385 | rename("installer.exe", $fileName); |
386 | 386 | return $fileName; |
387 | 387 | } |
388 | 388 | // are actually signing |
389 | - $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
389 | + $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
390 | 390 | if ($outputFromSigning === FALSE) { |
391 | 391 | $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
392 | 392 | } |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | */ |
401 | 401 | protected function compileNSIS() { |
402 | 402 | if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
403 | - $makensis = \config\ConfAssistant::PATHS['makensis'] . " -INPUTCHARSET UTF8"; |
|
403 | + $makensis = \config\ConfAssistant::PATHS['makensis']." -INPUTCHARSET UTF8"; |
|
404 | 404 | } else { |
405 | 405 | $makensis = \config\ConfAssistant::PATHS['makensis']; |
406 | 406 | } |
407 | 407 | $lcAll = getenv("LC_ALL"); |
408 | 408 | putenv("LC_ALL=en_US.UTF-8"); |
409 | - $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1'; |
|
409 | + $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1'; |
|
410 | 410 | system($command); |
411 | - putenv("LC_ALL=" . $lcAll); |
|
411 | + putenv("LC_ALL=".$lcAll); |
|
412 | 412 | $this->loggerInstance->debug(4, "compileNSIS:$command\n"); |
413 | 413 | } |
414 | 414 | |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | 'email' => 'SUPPORT', |
426 | 426 | 'url' => 'URL', |
427 | 427 | ]; |
428 | - $s = "support_" . $type . "_substitute"; |
|
428 | + $s = "support_".$type."_substitute"; |
|
429 | 429 | $substitute = $this->translateString($this->$s, $this->codePage); |
430 | - $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute; |
|
431 | - return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n"; |
|
430 | + $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute; |
|
431 | + return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n"; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | * @return string |
439 | 439 | */ |
440 | 440 | protected function writeNsisDefines($attr) { |
441 | - $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION; |
|
441 | + $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION; |
|
442 | 442 | if ($attr['internal:profile_count'][0] > 1) { |
443 | - $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
443 | + $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
444 | 444 | '; |
445 | 445 | } |
446 | - $fcontents .= ' |
|
447 | -Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
448 | -!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449 | -!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
446 | + $fcontents .= ' |
|
447 | +Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
448 | +!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
449 | +!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
450 | 450 | !define INSTALLER_NAME "installer.exe" |
451 | -!define LANG "' . $this->lang . '" |
|
452 | -!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']) . '" |
|
451 | +!define LANG "' . $this->lang.'" |
|
452 | +!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']).'" |
|
453 | 453 | ;-------------------------------- |
454 | -!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
454 | +!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
455 | 455 | '; |
456 | 456 | $fcontents .= $this->getSupport($attr, 'email'); |
457 | 457 | $fcontents .= $this->getSupport($attr, 'url'); |
@@ -459,18 +459,18 @@ discard block |
||
459 | 459 | $fcontents .= '!define WIRED |
460 | 460 | '; |
461 | 461 | } |
462 | - $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
462 | + $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
463 | 463 | '; |
464 | 464 | if (!empty($attr['internal:realm'][0])) { |
465 | - $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
465 | + $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
466 | 466 | '; |
467 | 467 | } |
468 | 468 | if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
469 | - $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
469 | + $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
470 | 470 | '; |
471 | 471 | } |
472 | 472 | if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
473 | - $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
473 | + $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
474 | 474 | '; |
475 | 475 | } |
476 | 476 | $fcontents .= $this->msInfoFile($attr); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $out .= '!define EXTERNAL_INFO "'; |
492 | 492 | // $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
493 | 493 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
494 | - $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
494 | + $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
495 | 495 | } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
496 | 496 | $infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
497 | 497 | if ($infoFile === FALSE) { |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
501 | 501 | $infoFileConverted = $infoFile; |
502 | 502 | } else { |
503 | - $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
503 | + $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
504 | 504 | } |
505 | 505 | if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
506 | 506 | file_put_contents('info_f.txt', $infoFileConverted); |
507 | 507 | $out = '!define LICENSE_FILE " info_f.txt'; |
508 | 508 | } |
509 | 509 | } else { |
510 | - $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
510 | + $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $out .= "\"\n"; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | 'db' => 'cat', |
216 | 216 | 'user' => 'kitty', |
217 | 217 | 'pass' => 'somepass', |
218 | - 'readonly' => FALSE,], |
|
218 | + 'readonly' => FALSE, ], |
|
219 | 219 | // this DB stores diagnostics data. The connection details can be |
220 | 220 | // identical to INST as there is no table overlap |
221 | 221 | 'DIAGNOSTICS' => [ |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 'db' => 'cat', |
224 | 224 | 'user' => 'kitty', |
225 | 225 | 'pass' => 'somepass', |
226 | - 'readonly' => FALSE,], |
|
226 | + 'readonly' => FALSE, ], |
|
227 | 227 | // this slice of DB user is about the downloads table. The corresponding |
228 | 228 | // DB user should have write access to update statistics and the cache |
229 | 229 | // locations of installers. |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | 'db' => 'cat', |
234 | 234 | 'user' => 'kitty', |
235 | 235 | 'pass' => 'somepass', |
236 | - 'readonly' => FALSE,], |
|
236 | + 'readonly' => FALSE, ], |
|
237 | 237 | // this slice of DB use is about user management in the user_options |
238 | 238 | // table. Giving the corresponding user only read-only access means that |
239 | 239 | // all user properties have to "magically" occur in the table by OOB |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'db' => 'cat', |
245 | 245 | 'user' => 'kitty', |
246 | 246 | 'pass' => 'somepass', |
247 | - 'readonly' => FALSE,], |
|
247 | + 'readonly' => FALSE, ], |
|
248 | 248 | /* If you use this tool in conjunction with an external customer management database, you can configure that every |
249 | 249 | * institution entry in CAT MUST correspond to a customer entry in an external database. If you want this, set this |
250 | 250 | * config variable to TRUE. |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'db' => 'customer_db', |
265 | 265 | 'user' => 'customerservice', |
266 | 266 | 'pass' => '2lame4u', |
267 | - 'readonly' => TRUE,], |
|
267 | + 'readonly' => TRUE, ], |
|
268 | 268 | 'enforce-external-sync' => TRUE, |
269 | 269 | ]; |
270 | 270 | /** |