Passed
Push — release_2_0 ( f2471a...804114 )
by Stefan
07:43
created
core/common/Entity.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function __construct() {
96 96
         $this->loggerInstance = new Logging();
97
-        $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n");
97
+        $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n");
98 98
         $this->languageInstance = new Language();
99 99
         Entity::intoThePotatoes("core");
100 100
         // some config elements are displayable. We need some dummies to 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $dummy_inst2 = _("organisation");
107 107
         $dummy_inst3 = _("Identity Provider");
108 108
         // and do something useless with the strings so that there's no "unused" complaint
109
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) {
109
+        if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3) < 0) {
110 110
             throw new \Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
111 111
         }
112 112
         Entity::$nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * Logs the end of lifetime of the entity to the debug log on level 5.
122 122
      */
123 123
     public function __destruct() {
124
-        (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n");
124
+        (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n");
125 125
     }
126 126
 
127 127
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) {
153 153
         $loggerInstance = new Logging();
154
-        $name = md5(time() . rand());
154
+        $name = md5(time().rand());
155 155
         $path = ROOT;
156 156
         switch ($purpose) {
157 157
             case 'silverbullet':
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             default:
170 170
                 throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n");
171 171
         }
172
-        $tmpDir = $path . '/' . $name;
172
+        $tmpDir = $path.'/'.$name;
173 173
         $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n");
174 174
         if (!mkdir($tmpDir, 0700, true)) {
175 175
             if ($failIsFatal) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * @return void
190 190
      */
191 191
     public static function rrmdir($dir) {
192
-        foreach (glob($dir . '/*') as $file) {
192
+        foreach (glob($dir.'/*') as $file) {
193 193
             if (is_dir($file)) {
194 194
                 Entity::rrmdir($file);
195 195
             } else {
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
         }
215 215
         // these substr() are guaranteed to yield actual string data, as the
216 216
         // base string is an MD5 hash - has sufficient length
217
-        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-';
218
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-';
219
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-';
220
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-';
217
+        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-';
218
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-';
219
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-';
220
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-';
221 221
         $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12);
222
-        return $prefix . $uuid;
222
+        return $prefix.$uuid;
223 223
     }
224 224
 
225 225
     /**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         for ($i = count($trace); $i--; $i > 0) {
259 259
             if (isset($trace[$i - 1]['class']) && preg_match('/Entity/', $trace[$i - 1]['class'])) {
260 260
                 if ($showTrace) {
261
-                    echo "FOUND caller: ".print_r($trace[$i],true). " - class is ".$trace[$i]['class'];
261
+                    echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class'];
262 262
                 }
263 263
                 $caller = $trace[$i];
264 264
                 break;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT));
270 270
         if ($showTrace === TRUE) {   
271 271
             echo "<pre>".print_r($trace, true)."</pre>";
272
-            echo "CLASS = " . $myName ."<br/>";
272
+            echo "CLASS = ".$myName."<br/>";
273 273
         }
274 274
         if (preg_match("/diag/", $myName) == 1) {
275 275
             $ret = "diagnostics";
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
         if ($catalogue === NULL) {
303 303
             $theCatalogue = Entity::determineOwnCatalogue($trace);
304 304
             textdomain($theCatalogue);
305
-            bindtextdomain($theCatalogue, ROOT . "/translation/");
305
+            bindtextdomain($theCatalogue, ROOT."/translation/");
306 306
         } else {
307 307
             textdomain($catalogue);
308
-            bindtextdomain($catalogue, ROOT . "/translation/");
308
+            bindtextdomain($catalogue, ROOT."/translation/");
309 309
         }
310 310
     }
311 311
 
Please login to merge, or discard this patch.
core/CertificationAuthorityEduPkiServer.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
92 92
         try {
93 93
             $altArray = [# Array mit den Subject Alternative Names
94
-                "email:" . $csr["USERMAIL"]
94
+                "email:".$csr["USERMAIL"]
95 95
             ];
96 96
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
97 97
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
98
-            $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n");
99
-            $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n");
98
+            $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n");
99
+            $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n");
100 100
             $this->loggerInstance->debug(5, "PARAM_3: ");
101 101
             $this->loggerInstance->debug(5, $altArray);
102
-            $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n");
103
-            $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n");
104
-            $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n");
105
-            $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n");
106
-            $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n");
102
+            $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n");
103
+            $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n");
104
+            $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n");
105
+            $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n");
106
+            $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n");
107 107
             $this->loggerInstance->debug(5, "PARAM_9: false\n");
108 108
             $soapNewRequest = $soapPub->newRequest(
109 109
                     CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
         } catch (Exception $e) {
126 126
             // PHP 7.1 can do this much better
127 127
             if (is_soap_fault($e)) {
128
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}:  {
128
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}:  {
129 129
                     $e->faultstring
130 130
                 }\n");
131 131
             }
132
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
132
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
133 133
         }
134 134
         try {
135 135
             $soap = $this->initEduPKISoapSession("RA");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
164 164
             // rather than just using the string. Grr.
165 165
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
166
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext);
166
+            file_put_contents($tempdir['dir']."/content.txt", $soapCleartext);
167 167
             // retrieve our RA cert from filesystem                    
168 168
             // the RA certificates are not needed right now because we
169 169
             // have resorted to S/MIME signatures with openssl command-line
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
176 176
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
177 177
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n  $soapCleartext\n");
178
-            $execCmd = CONFIG['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";
178
+            $execCmd = CONFIG['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";
179 179
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline:   $execCmd\n");
180 180
             $output = [];
181 181
             $return = 999;
@@ -184,21 +184,21 @@  discard block
 block discarded – undo
184 184
                 throw new Exception("Non-zero return value from openssl smime!");
185 185
             }
186 186
             // and get the signature blob back from the filesystem
187
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
187
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
188 188
             $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n");
189
-            $this->loggerInstance->debug(5, $soapReqnum . "\n");
190
-            $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending!
191
-            $this->loggerInstance->debug(5, $detachedSig . "\n");
189
+            $this->loggerInstance->debug(5, $soapReqnum."\n");
190
+            $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending!
191
+            $this->loggerInstance->debug(5, $detachedSig."\n");
192 192
             $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig);
193
-            $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest());
194
-            $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse());
193
+            $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest());
194
+            $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse());
195 195
             if ($soapIssueCert === FALSE) {
196 196
                 throw new Exception("The locally approved request was NOT processed by the CA.");
197 197
             }
198 198
         } catch (SoapFault $e) {
199
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
199
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
200 200
         } catch (Exception $e) {
201
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
201
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
202 202
         }
203 203
         return $soapReqnum;
204 204
     }
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
                 throw new Exception("CAInfo has no root certificate for us!");
249 249
             }
250 250
         } catch (SoapFault $e) {
251
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
251
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
252 252
         } catch (Exception $e) {
253
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
253
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
254 254
         }
255 255
         return [
256 256
             "CERT" => openssl_x509_read($parsedCert['pem']),
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
284 284
             // rather than just using the string. Grr.
285 285
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
286
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest);
286
+            file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest);
287 287
             // retrieve our RA cert from filesystem
288 288
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
289 289
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
290 290
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n");
291
-            $execCmd = CONFIG['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;
291
+            $execCmd = CONFIG['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;
292 292
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n");
293 293
             $output = [];
294 294
             $return = 999;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                 throw new Exception("Non-zero return value from openssl smime!");
298 298
             }
299 299
             // and get the signature blob back from the filesystem
300
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
300
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
301 301
             $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig);
302 302
             if ($soapIssueRev === FALSE) {
303 303
                 throw new Exception("The locally approved revocation request was NOT processed by the CA.");
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
         } catch (Exception $e) {
306 306
             // PHP 7.1 can do this much better
307 307
             if (is_soap_fault($e)) {
308
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n");
308
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n");
309 309
             }
310
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
310
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
311 311
         }
312 312
     }
313 313
 
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
      */
408 408
     public function soapToXmlInteger($x)
409 409
     {
410
-        return '<' . $x[0] . '>'
410
+        return '<'.$x[0].'>'
411 411
                 . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1)
412
-                . '</' . $x[0] . '>';
412
+                . '</'.$x[0].'>';
413 413
     }
414 414
 
415 415
     /**
@@ -428,9 +428,9 @@  discard block
 block discarded – undo
428 428
         // dump private key into directory
429 429
         $outstring = "";
430 430
         openssl_pkey_export($privateKey, $outstring);
431
-        file_put_contents($tempdir . "/pkey.pem", $outstring);
431
+        file_put_contents($tempdir."/pkey.pem", $outstring);
432 432
         // PHP can only do one DC in the Subject. But we need three.
433
-        $execCmd = CONFIG['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";
433
+        $execCmd = CONFIG['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";
434 434
         $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n");
435 435
         $output = [];
436 436
         $return = 999;
Please login to merge, or discard this patch.
web/admin/overview_certificates.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert
82 82
             $status = $oneCert['STATUS'];
83 83
             if ($status == "ISSUED") {
84
-                $status = "<span onclick='alert(\"".str_replace("\n","\\n",$oneCert['CERT'])."\");'>$status</span>";
84
+                $status = "<span onclick='alert(\"".str_replace("\n", "\\n", $oneCert['CERT'])."\");'>$status</span>";
85 85
             }
86 86
             echo "<tr><td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td></tr>";
87 87
         }
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
86 86
                 $fed = $validator->Federation($_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
 block discarded – undo
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, &lt;[email protected]&gt;').") . "</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, &lt;[email protected]&gt;').")."</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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function listProfiles(bool $activeOnly = FALSE)
116 116
     {
117
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
117
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
118 118
         $allProfiles = $this->databaseHandle->exec($query);
119 119
         $returnarray = [];
120 120
         // SELECT -> resource, not boolean
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $returnarray[] = $oneProfile;
125 125
         }
126 126
 
127
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
127
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
128 128
         return $returnarray;
129 129
     }
130 130
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
230 230
                     $theProfile = new ProfileSilverbullet($identifier, $this);
231 231
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
232
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
232
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
233 233
                     return $theProfile;
234 234
                 default:
235 235
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     public function getExternalDBId()
351 351
     {
352 352
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
353
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
353
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
354 354
             // SELECT -> it's a resource, not a boolean
355 355
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
356 356
                 return FALSE;
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $profile = $validator->Profile($_GET['profile_id'], $my_inst->identifier);
57 57
         } else {
58 58
             $profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
59
-            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $my_inst->identifier . " - Profile created");
59
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$my_inst->identifier." - Profile created");
60 60
         }
61 61
 
62 62
         if (!$profile instanceof \core\ProfileRADIUS) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $uiElements = new web\lib\admin\UIElements();
119 119
             // set realm info, if submitted
120 120
             if ($realm !== FALSE) {
121
-                $profile->setRealm($anonLocal . "@" . $realm);
121
+                $profile->setRealm($anonLocal."@".$realm);
122 122
                 echo $uiElements->boxOkay(sprintf(_("Realm: <strong>%s</strong>"), $realm));
123 123
             } else {
124 124
                 $profile->setRealm("");
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!"));
142 142
                 } else {
143 143
                     $profile->setRealmcheckUser(true, $checkuser_name);
144
-                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm));
144
+                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm));
145 145
                 }
146 146
             } else {
147 147
                 $profile->setRealmCheckUser(false);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 } else {
155 155
                     $profile->setInputVerificationPreference($verify, $hint);
156 156
                     if ($hint !== FALSE) {
157
-                        $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
157
+                        $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
158 158
                     } else {
159 159
                         $extratext = ".";
160 160
                     }
@@ -191,29 +191,29 @@  discard block
 block discarded – undo
191 191
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
192 192
             }
193 193
 
194
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
194
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
195 195
 
196 196
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
197 197
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
198 198
                     continue;
199 199
                 }
200
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
201
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
200
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
201
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
202 202
                     // add EAP type to profile as requested, but ...
203 203
                     $profile->addSupportedEapMethod($a, $priority);
204
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
204
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
205 205
                     // see if we can enable the EAP type, or if info is missing
206 206
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
207 207
                     if ($eapcompleteness === true) {
208
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
208
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
209 209
                     } else {
210 210
                         $warntext = "";
211 211
                         if (is_array($eapcompleteness)) {
212 212
                             foreach ($eapcompleteness as $item) {
213
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
213
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
214 214
                             }
215 215
                         }
216
-                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
216
+                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext)."<br/>"._("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
217 217
                     }
218 218
                 }
219 219
             }
@@ -223,23 +223,23 @@  discard block
 block discarded – undo
223 223
             if (count($significantChanges) > 0) {
224 224
                 $myInstOriginal = new \core\IdP($profile->institution);
225 225
                 // send a notification/alert mail to someone we know is in charge
226
-                $text = _("To whom it may concern,") . "\n\n";
226
+                $text = _("To whom it may concern,")."\n\n";
227 227
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
228
-                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
228
+                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
229 229
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
230
-                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:") . "\n\n";
231
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
230
+                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:")."\n\n";
231
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
232 232
                 }
233 233
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
234 234
                     $text .= _("A new trusted root CA was added. The details are below:\n\n");
235
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
235
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
236 236
                 }
237 237
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
238
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
239
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
238
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
239
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
240 240
                 }
241
-                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n";
242
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
241
+                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n";
242
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
243 243
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
244 244
                 $fed = new core\Federation($myInstOriginal->federation);
245 245
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         <?php
259 259
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
260 260
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
261
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
261
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
262 262
     </form>";
263 263
         }
264 264
         echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/edit_idp_result.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $loggerInstance = new \core\common\Logging();
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 $myInstOriginal = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
39 39
 $instId = $myInstOriginal->identifier;
40 40
 
41
-$hello = _("To whom it may concern,") . "\n\n";
42
-$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n" .
43
-        _("Greetings, ") . "\n\n" .
41
+$hello = _("To whom it may concern,")."\n\n";
42
+$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n".
43
+        _("Greetings, ")."\n\n".
44 44
         CONFIG['APPEARANCE']['productname_long'];
45 45
 
46 46
 switch ($_POST['submitbutton']) {
47 47
     case web\lib\common\FormElements::BUTTON_DELETE:
48 48
         $myInstOriginal->destroy();
49
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
49
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
50 50
         header("Location: overview_user.php");
51 51
         exit;
52 52
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         }
57 57
         // flush all IdP attributes and send user to creation wizard
58 58
         $myInstOriginal->flushAttributes();
59
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
60
-        $text = $hello .
61
-                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n" .
59
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
60
+        $text = $hello.
61
+                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n".
62 62
                 $bye;
63 63
         $fed = new core\Federation($myInstOriginal->federation);
64 64
         foreach ($fed->listFederationAdmins() as $id) {
@@ -77,19 +77,19 @@  discard block
 block discarded – undo
77 77
             exit(0);
78 78
         }
79 79
         $inst_name = $myInstOriginal->name;
80
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
80
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
81 81
         echo "<table>";
82 82
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
83 83
         echo "</table>";
84 84
 // delete cached logo, if present
85
-        $dir = ROOT . '/web/downloads/logos/';
86
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
85
+        $dir = ROOT.'/web/downloads/logos/';
86
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
87 87
         if ($globResult === FALSE) { // we should catch the improbable error condition
88 88
             $globResult = [];
89 89
         }
90 90
         array_map('unlink', $globResult);
91 91
         $loggerInstance->debug(4, "UNLINK from $dir\n");
92
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
92
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
93 93
 
94 94
 // re-instantiate ourselves... profiles need fresh data
95 95
         $myInstReinstantiated = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
         if (count($significantChanges) > 0) {
99 99
             // send a notification/alert mail to someone we know is in charge
100 100
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
101
-            $text = $hello . sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
101
+            $text = $hello.sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
102 102
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
103
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst) . "\n\n";
104
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
103
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst)."\n\n";
104
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
105 105
             }
106 106
             $text .= $bye;
107 107
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 
118 118
         if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
119 119
             foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) {
120
-                $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
120
+                $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
121 121
             }
122 122
         }
123 123
 
124 124
         foreach ($myInstReinstantiated->getAttributes("media:SSID_with_legacy") as $ssidname) {
125
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)");
125
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)");
126 126
         }
127 127
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
128
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
128
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
129 129
         }
130 130
 
131 131
         echo "<table>";
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         if (count($ssids) > 0) {
134 134
             $printedlist = "";
135 135
             foreach ($ssids as $names) {
136
-                $printedlist = $printedlist . "$names ";
136
+                $printedlist = $printedlist."$names ";
137 137
             }
138 138
             echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
139 139
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 // did we get an email address? then, show the silverbullet jumpstart button
162 162
                 // otherwise, issue a smartass comment
163 163
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
164
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
164
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
165 165
                 } else {
166 166
                     echo "<table>";
167 167
                     echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!"));
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
                 }
170 170
             }
171 171
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
172
-                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
172
+                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
173 173
             }
174 174
         }
175
-        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
175
+        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
176 176
         echo $deco->footer();
177 177
         break;
178 178
     default:
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 use \Exception;
37 37
 
38
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
38
+require_once dirname(dirname(__DIR__))."/config/_config.php";
39 39
 
40 40
 /**
41 41
  * Test suite to verify that an EAP setup is actually working as advertised in
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             }
169 169
         }
170 170
 
171
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
171
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
172 172
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
173 173
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
174 174
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
259 259
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
260 260
             }
261
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
261
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
262 262
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
263 263
             }
264 264
         }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) {
285 285
             $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
286 286
         }
287
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
287
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
288 288
         if ($intermediateCa['basicconstraints_set'] == 0) {
289 289
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
290 290
         }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     {
334 334
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
335 335
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
336
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
336
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
337 337
         if ($clientcert === FALSE) {
338 338
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
339 339
         }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
343 343
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
344 344
         }
345
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
345
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
346 346
     }
347 347
 
348 348
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
364 364
         }
365 365
         // first and second sub-match is the full URL... check it
366
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
366
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
367 367
         if ($crlcontent === FALSE) {
368 368
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
369 369
         }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
         // $pem = chunk_split(base64_encode($crlcontent), 64, "\n");
379 379
         // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php
380
-        $proc = CONFIG['PATHS']['openssl'] . " crl -inform der";
380
+        $proc = CONFIG['PATHS']['openssl']." crl -inform der";
381 381
         $descriptorspec = [
382 382
             0 => ["pipe", "r"],
383 383
             1 => ["pipe", "w"],
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         $origLength = strlen($hex);
417 417
         for ($i = 1; $i < $origLength; $i++) {
418 418
             if ($i % 2 == 1 && $i != strlen($hex)) {
419
-                $spaced .= $hex[$i] . " ";
419
+                $spaced .= $hex[$i]." ";
420 420
             } else {
421 421
                 $spaced .= $hex[$i];
422 422
             }
@@ -543,19 +543,19 @@  discard block
 block discarded – undo
543 543
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
544 544
         $config = '
545 545
 network={
546
-  ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing"
546
+  ssid="' . CONFIG['APPEARANCE']['productname'].' testing"
547 547
   key_mgmt=WPA-EAP
548 548
   proto=WPA2
549 549
   pairwise=CCMP
550 550
   group=CCMP
551 551
   ';
552 552
 // phase 1
553
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
553
+        $config .= 'eap='.$eapText['OUTER']."\n";
554 554
         $logConfig = $config;
555 555
 // phase 2 if applicable; all inner methods have passwords
556 556
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
557
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
558
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
557
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
558
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
559 559
         }
560 560
 // all methods set a password, except EAP-TLS
561 561
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -571,11 +571,11 @@  discard block
 block discarded – undo
571 571
         }
572 572
 
573 573
 // inner identity
574
-        $config .= '  identity="' . $inner . "\"\n";
575
-        $logConfig .= '  identity="' . $inner . "\"\n";
574
+        $config .= '  identity="'.$inner."\"\n";
575
+        $logConfig .= '  identity="'.$inner."\"\n";
576 576
 // outer identity, may be equal
577
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
578
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
577
+        $config .= '  anonymous_identity="'.$outer."\"\n";
578
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
579 579
 // done
580 580
         $config .= "}";
581 581
         $logConfig .= "}";
@@ -638,13 +638,13 @@  discard block
 block discarded – undo
638 638
      */
639 639
     private function eapolTestConfig($probeindex, $opName, $frag)
640 640
     {
641
-        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] .
642
-                " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] .
643
-                " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] .
644
-                " -o serverchain.pem" .
645
-                " -c ./udp_login_test.conf" .
646
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
647
-                " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " ";
641
+        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'].
642
+                " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'].
643
+                " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'].
644
+                " -o serverchain.pem".
645
+                " -c ./udp_login_test.conf".
646
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
647
+                " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." ";
648 648
         if ($opName) {
649 649
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
650 650
         }
@@ -674,10 +674,10 @@  discard block
 block discarded – undo
674 674
      */
675 675
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs)
676 676
     {
677
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
677
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
678 678
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
679 679
         }
680
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
680
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
681 681
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
682 682
         }
683 683
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -691,15 +691,15 @@  discard block
 block discarded – undo
691 691
             }
692 692
             if ($decoded['ca'] == 1) {
693 693
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
694
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
695
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
694
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
695
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
696 696
                     $catRoots[] = $decoded['pem'];
697 697
                 } else { // save the intermediates to allcerts directory
698
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
698
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
699 699
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
700 700
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
701 701
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
702
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
702
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
703 703
                     }
704 704
                     $catIntermediates[] = $decoded['pem'];
705 705
                 }
@@ -708,26 +708,26 @@  discard block
 block discarded – undo
708 708
         // save all intermediate certificates and CRLs to separate files in 
709 709
         // both root-ca directories
710 710
         foreach ($eapIntermediates as $index => $onePem) {
711
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
712
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
711
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
712
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
713 713
         }
714 714
         foreach ($eapIntermediateCRLs as $index => $onePem) {
715
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
716
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
715
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
716
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
717 717
         }
718 718
 
719 719
         $checkstring = "";
720 720
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
721 721
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
722 722
             $checkstring = "-crl_check_all";
723
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
724
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
723
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
724
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
725 725
         }
726 726
 
727 727
 
728 728
 // now c_rehash the root CA directory ...
729
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
730
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
729
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
730
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
731 731
         return $checkstring;
732 732
     }
733 733
 
@@ -759,12 +759,12 @@  discard block
 block discarded – undo
759 759
 // the error log will complain if we run this test against an empty file of certs
760 760
 // so test if there's something PEMy in the file at all
761 761
         if (filesize("$tmpDir/serverchain.pem") > 10) {
762
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
763
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
764
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
765
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
766
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
767
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
762
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
763
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
764
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
765
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
766
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
767
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
768 768
         }
769 769
 
770 770
 
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
         // we are UNHAPPY if no names match!
832 832
         $happiness = "UNHAPPY";
833 833
         foreach ($this->expectedServerNames as $expectedName) {
834
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
834
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
835 835
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
836 836
                 $this->loggerInstance->debug(4, "Totally happy!");
837 837
                 $happiness = "TOTALLY";
@@ -876,11 +876,11 @@  discard block
 block discarded – undo
876 876
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
877 877
         // the config intentionally does not include CA checking. We do this
878 878
         // ourselves after getting the chain with -o.
879
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
879
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
880 880
 
881 881
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
882 882
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
883
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
883
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
884 884
         $time_start = microtime(true);
885 885
         $pflow = [];
886 886
         exec($cmdline, $pflow);
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
925 925
             array_pop($packetflow);
926 926
         }
927
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
927
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
928 928
         $packetcount = array_count_values($packetflow);
929 929
         $testresults['packetcount'] = $packetcount;
930 930
         $testresults['packetflow'] = $packetflow;
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
     private function wasModernTlsNegotiated(&$testresults, $packetflow_orig)
963 963
     {
964 964
         $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION);
965
-        $this->loggerInstance->debug(4,"TLS version found is: $negotiatedTlsVersion"."\n");
965
+        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n");
966 966
         if ($negotiatedTlsVersion === FALSE) {
967 967
             $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION;
968 968
         } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) {
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
         $x509 = new \core\common\X509();
1024 1024
 // $eap_certarray holds all certs received in EAP conversation
1025
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
1025
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
1026 1026
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
1027 1027
             $eapCertArray = $x509->splitCertificate($incomingData);
1028 1028
         } else {
@@ -1052,10 +1052,10 @@  discard block
 block discarded – undo
1052 1052
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
1053 1053
                     $servercert[] = $cert;
1054 1054
                     if (count($servercert) == 1) {
1055
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
1055
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
1056 1056
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
1057 1057
                         }
1058
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
1058
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
1059 1059
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
1060 1060
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
1061 1061
                     }
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
         chdir($tmpDir);
1137 1137
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1138 1138
         if ($clientcertdata !== NULL) {
1139
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1139
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1140 1140
         }
1141 1141
         $testresults = [];
1142 1142
         // initialise the sub-array for cleaner parsing
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
                     'issuer' => $this->printDN($certdata['issuer']),
1238 1238
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1239 1239
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1240
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1240
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1241 1241
                     'sha1' => $certdata['sha1'],
1242 1242
                     'extensions' => $certdata['extensions']
1243 1243
                 ];
Please login to merge, or discard this patch.