Passed
Branch release_2_0 (0e04e8)
by Stefan
07:12
created
core/ProfileRADIUS.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 
113 113
         $attributesLowLevel = array_merge($this->deviceLevelAttributes, $this->eapLevelAttributes);
114 114
 
115
-        $this->loggerInstance->debug(5, "Device-Level Attributes: " . print_r($this->deviceLevelAttributes, true));
116
-        $this->loggerInstance->debug(5, "EAP-Level Attributes: " . print_r($this->eapLevelAttributes, true));
117
-        $this->loggerInstance->debug(5, "All low-Level Attributes: " . print_r($attributesLowLevel, true));
115
+        $this->loggerInstance->debug(5, "Device-Level Attributes: ".print_r($this->deviceLevelAttributes, true));
116
+        $this->loggerInstance->debug(5, "EAP-Level Attributes: ".print_r($this->eapLevelAttributes, true));
117
+        $this->loggerInstance->debug(5, "All low-Level Attributes: ".print_r($attributesLowLevel, true));
118 118
 
119 119
         // now fetch and merge profile-level attributes if not already set on deeper level
120 120
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             }
134 134
         }
135 135
 
136
-        $this->loggerInstance->debug(5, "Merged Attributes: " . print_r($attributesLowLevel, true));
136
+        $this->loggerInstance->debug(5, "Merged Attributes: ".print_r($attributesLowLevel, true));
137 137
 
138 138
         // now, fetch and merge IdP-wide attributes
139 139
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 "row" => $attributeQuery->row,
189 189
                 "flag" => $optinfo['flag'],
190 190
                 "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL),
191
-                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )];
191
+                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())];
192 192
         }
193 193
         return $temparray;
194 194
     }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @return void
290 290
      */
291 291
     public function setAnonymousIDSupport($shallwe) {
292
-        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = " . ($shallwe === true ? "1" : "0") . " WHERE profile_id = $this->identifier");
292
+        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier");
293 293
     }
294 294
 
295 295
     /** Toggle special username for realm checks
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
      * @return void
300 300
      */
301 301
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
302
-        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") .
303
-                ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
302
+        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = ".($shallwe === true ? "1" : "0").
303
+                ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "").
304 304
                 " WHERE profile_id = $this->identifier");
305 305
     }
306 306
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
      * @return void
313 313
      */
314 314
     public function setInputVerificationPreference($verify, $hint) {
315
-        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = " . ($verify === true ? "1" : "0") .
316
-                ", hint_userinput_suffix = " . ($hint === true ? "1" : "0") .
315
+        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = ".($verify === true ? "1" : "0").
316
+                ", hint_userinput_suffix = ".($hint === true ? "1" : "0").
317 317
                 " WHERE profile_id = $this->identifier");
318 318
     }
319 319
 
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 use \Exception;
36 36
 
37
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
37
+require_once dirname(dirname(__DIR__))."/config/_config.php";
38 38
 
39 39
 /**
40 40
  * Test suite to verify that an EAP setup is actually working as advertised in
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             }
166 166
         }
167 167
 
168
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
168
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
169 169
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
170 170
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
171 171
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
253 253
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
254 254
             }
255
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
255
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
256 256
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
257 257
             }
258 258
         }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) {
278 278
             $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
279 279
         }
280
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
280
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
281 281
         if ($intermediateCa['basicconstraints_set'] == 0) {
282 282
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
283 283
         }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     public function udpReachability($probeindex, $opnameCheck = TRUE, $frag = TRUE) {
325 325
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
326 326
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
327
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
327
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
328 328
         if ($clientcert === FALSE) {
329 329
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
330 330
         }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
334 334
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
335 335
         }
336
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
336
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
337 337
     }
338 338
 
339 339
     /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
354 354
         }
355 355
         // first and second sub-match is the full URL... check it
356
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
356
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
357 357
         if ($crlcontent === FALSE) {
358 358
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
359 359
         }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         fclose($pipes[1]);
385 385
         fclose($pipes[2]);
386 386
         $retval = proc_close($process);
387
-        if ($retval != 0 || !preg_match("/BEGIN X509 CRL/",$pem)) {
387
+        if ($retval != 0 || !preg_match("/BEGIN X509 CRL/", $pem)) {
388 388
             // this was not a real CRL
389 389
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
390 390
         }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         $origLength = strlen($hex);
407 407
         for ($i = 1; $i < $origLength; $i++) {
408 408
             if ($i % 2 == 1 && $i != strlen($hex)) {
409
-                $spaced .= $hex[$i] . " ";
409
+                $spaced .= $hex[$i]." ";
410 410
             } else {
411 411
                 $spaced .= $hex[$i];
412 412
             }
@@ -489,19 +489,19 @@  discard block
 block discarded – undo
489 489
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
490 490
         $config = '
491 491
 network={
492
-  ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing"
492
+  ssid="' . CONFIG['APPEARANCE']['productname'].' testing"
493 493
   key_mgmt=WPA-EAP
494 494
   proto=WPA2
495 495
   pairwise=CCMP
496 496
   group=CCMP
497 497
   ';
498 498
 // phase 1
499
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
499
+        $config .= 'eap='.$eapText['OUTER']."\n";
500 500
         $logConfig = $config;
501 501
 // phase 2 if applicable; all inner methods have passwords
502 502
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
503
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
504
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
503
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
504
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
505 505
         }
506 506
 // all methods set a password, except EAP-TLS
507 507
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
         }
518 518
 
519 519
 // inner identity
520
-        $config .= '  identity="' . $inner . "\"\n";
521
-        $logConfig .= '  identity="' . $inner . "\"\n";
520
+        $config .= '  identity="'.$inner."\"\n";
521
+        $logConfig .= '  identity="'.$inner."\"\n";
522 522
 // outer identity, may be equal
523
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
524
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
523
+        $config .= '  anonymous_identity="'.$outer."\"\n";
524
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
525 525
 // done
526 526
         $config .= "}";
527 527
         $logConfig .= "}";
@@ -582,13 +582,13 @@  discard block
 block discarded – undo
582 582
      * @return string the command-line for eapol_test
583 583
      */
584 584
     private function eapolTestConfig($probeindex, $opName, $frag) {
585
-        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] .
586
-                " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] .
587
-                " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] .
588
-                " -o serverchain.pem" .
589
-                " -c ./udp_login_test.conf" .
590
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
591
-                " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " ";
585
+        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'].
586
+                " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'].
587
+                " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'].
588
+                " -o serverchain.pem".
589
+                " -c ./udp_login_test.conf".
590
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
591
+                " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." ";
592 592
         if ($opName) {
593 593
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
594 594
         }
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
      * @throws Exception
618 618
      */
619 619
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
620
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
620
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
621 621
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
622 622
         }
623
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
623
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
624 624
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
625 625
         }
626 626
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -634,15 +634,15 @@  discard block
 block discarded – undo
634 634
             }
635 635
             if ($decoded['ca'] == 1) {
636 636
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
637
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
638
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
637
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
638
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
639 639
                     $catRoots[] = $decoded['pem'];
640 640
                 } else { // save the intermediates to allcerts directory
641
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
641
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
642 642
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
643 643
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
644 644
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
645
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
645
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
646 646
                     }
647 647
                     $catIntermediates[] = $decoded['pem'];
648 648
                 }
@@ -651,26 +651,26 @@  discard block
 block discarded – undo
651 651
         // save all intermediate certificates and CRLs to separate files in 
652 652
         // both root-ca directories
653 653
         foreach ($eapIntermediates as $index => $onePem) {
654
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
655
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
654
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
655
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
656 656
         }
657 657
         foreach ($eapIntermediateCRLs as $index => $onePem) {
658
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
659
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
658
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
659
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
660 660
         }
661 661
 
662 662
         $checkstring = "";
663 663
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
664 664
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
665 665
             $checkstring = "-crl_check_all";
666
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
667
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
666
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
667
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
668 668
         }
669 669
 
670 670
 
671 671
 // now c_rehash the root CA directory ...
672
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
673
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
672
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
673
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
674 674
         return $checkstring;
675 675
     }
676 676
 
@@ -701,12 +701,12 @@  discard block
 block discarded – undo
701 701
 // the error log will complain if we run this test against an empty file of certs
702 702
 // so test if there's something PEMy in the file at all
703 703
         if (filesize("$tmpDir/serverchain.pem") > 10) {
704
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
705
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
706
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
707
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
708
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
709
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
704
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
705
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
706
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
707
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
708
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
709
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
710 710
         }
711 711
 
712 712
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
         // we are UNHAPPY if no names match!
773 773
         $happiness = "UNHAPPY";
774 774
         foreach ($this->expectedServerNames as $expectedName) {
775
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
775
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
776 776
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
777 777
                 $this->loggerInstance->debug(4, "Totally happy!");
778 778
                 $happiness = "TOTALLY";
@@ -816,11 +816,11 @@  discard block
 block discarded – undo
816 816
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
817 817
         // the config intentionally does not include CA checking. We do this
818 818
         // ourselves after getting the chain with -o.
819
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
819
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
820 820
 
821 821
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
822 822
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
823
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
823
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
824 824
         $time_start = microtime(true);
825 825
         $pflow = [];
826 826
         exec($cmdline, $pflow);
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
864 864
             array_pop($packetflow);
865 865
         }
866
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
866
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
867 867
         $packetcount = array_count_values($packetflow);
868 868
         $testresults['packetcount'] = $packetcount;
869 869
         $testresults['packetflow'] = $packetflow;
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
         $x509 = new \core\common\X509();
942 942
         $eapCertArray = [];
943 943
 // $eap_certarray holds all certs received in EAP conversation
944
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
944
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
945 945
         if ($incomingData !== FALSE) {
946 946
             $eapCertArray = $x509->splitCertificate($incomingData);
947 947
         }
@@ -968,10 +968,10 @@  discard block
 block discarded – undo
968 968
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
969 969
                     $servercert[] = $cert;
970 970
                     if (count($servercert) == 1) {
971
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
971
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
972 972
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
973 973
                         }
974
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
974
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
975 975
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
976 976
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
977 977
                     }
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
         chdir($tmpDir);
1052 1052
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1053 1053
         if ($clientcertdata !== NULL) {
1054
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1054
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1055 1055
         }
1056 1056
         $testresults = [];
1057 1057
         // initialise the sub-array for cleaner parsing
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
                     'issuer' => $this->printDN($certdata['issuer']),
1148 1148
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1149 1149
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1150
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1150
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1151 1151
                     'sha1' => $certdata['sha1'],
1152 1152
                     'extensions' => $certdata['extensions']
1153 1153
                 ];
Please login to merge, or discard this patch.
core/diag/Logopath.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
         $this->possibleFailureReasons = $_SESSION["SUSPECTS"] ?? []; // if we know nothing, don't talk to anyone
105 105
         $this->additionalFindings = $_SESSION["EVIDENCE"] ?? [];
106 106
 
107
-        $this->subjectPrefix = _("[eduroam Diagnostics]") . " ";
107
+        $this->subjectPrefix = _("[eduroam Diagnostics]")." ";
108 108
         $this->finalGreeting = "\n"
109 109
                 . _("(This service is in an early stage. We apologise if this is a false alert. If this is the case, please send an email report to [email protected], forwarding the entire message (including the 'SUSPECTS' and 'EVIDENCE' data at the end), and explain why this is a false positive.)")
110 110
                 . "\n"
111
-                . _("Yours sincerely,") . "\n"
111
+                . _("Yours sincerely,")."\n"
112 112
                 . "\n"
113 113
                 . _("Ed U. Roam, the eduroam diagnostics algorithm");
114 114
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
                 "bcc" => [],
120 120
                 "reply-to" => [Logopath::EDUROAM_OT],
121 121
                 "subject" => _("[POLICYVIOLATION NATIONAL] IdP with no entry in eduroam database"),
122
-                "body" => _("Dear NRO administrator,") . "\n"
122
+                "body" => _("Dear NRO administrator,")."\n"
123 123
                 . "\n"
124
-                . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) . "\n"
124
+                . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar"))."\n"
125 125
                 . "\n"
126
-                . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.") . "\n"
126
+                . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.")."\n"
127 127
                 . "\n"
128
-                . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.") . "\n"
128
+                . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.")."\n"
129 129
                 . "\n"
130 130
                 . "Please stop the policy violation ASAP by listing the IdP which is associated to this realm.",
131 131
             ],
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
             $handle = \core\common\OutsideComm::mailHandle();
281 281
             // let's identify outselves
282
-            $handle->FromName = CONFIG['APPEARANCE']['productname'] . " Real-Time Diagnostics System";
282
+            $handle->FromName = CONFIG['APPEARANCE']['productname']." Real-Time Diagnostics System";
283 283
             // add recipients
284 284
             foreach (Logopath::CATEGORYBINDING as $arrayName => $functionName) {
285 285
                 foreach ($theMail[$arrayName] as $onePrincipal) {
Please login to merge, or discard this patch.
core/diag/Sociopath.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * This class talks to end users, asking them annoying questions to get to the
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             2 => ["AREA" => AbstractTest::INFRA_DEVICE, 
74 74
                   "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
75 75
                   "FACTOR" => 0.33,
76
-                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"),$confAssistantText)],
76
+                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"), $confAssistantText)],
77 77
             3 => ["AREA" => AbstractTest::INFRA_DEVICE, 
78 78
                   "TXT" => _("Did you recently change the configuration on your device?"), 
79 79
                   "FACTOR" => 3,
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
         $questionDetails = $this->qaArray[$questionNumber];
114 114
         if ($answer === TRUE) {
115 115
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"];
116
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n");
116
+            $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n");
117 117
             $factor = $questionDetails["FACTOR"];
118 118
         } elseif ($answer === FALSE) {
119 119
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"];
120
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n");
121
-            $factor = 1/$questionDetails["FACTOR"];
120
+            $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n");
121
+            $factor = 1 / $questionDetails["FACTOR"];
122 122
         } else {
123 123
             $factor = 1;
124 124
         }
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
         $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions;
128 128
         $_SESSION["SUSPECTS"] = $this->possibleFailureReasons;
129 129
         $_SESSION["EVIDENCE"] = $this->additionalFindings;
130
-        $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']);
131
-        $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']);
130
+        $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']);
131
+        $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']);
132 132
     }
133 133
     
134 134
     /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         // if both are identical, take any of the questions in the pool of both
148 148
         foreach ($this->qaArray as $questionNumber => $questionDetails) {
149 149
             // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it
150
-            if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) {
150
+            if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) {
151 151
                 return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]);
152 152
             }
153 153
         }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @return string JSON encoded array with all the info we have
161 161
      */
162 162
     public function getCurrentGuessState() {
163
-        return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]);
163
+        return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]);
164 164
     }
165 165
     
166 166
     /**
Please login to merge, or discard this patch.
core/diag/Telepath.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * The overall coordination class that runs all kinds of tests to find out where
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if ($this->idPFederation === NULL && preg_match("/\.(..)$/", $realm, $matches)) {
76 76
             $this->idPFederation = strtoupper($matches[1]);
77 77
         }
78
-        $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is " . $this->idPFederation . "\n");
78
+        $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is ".$this->idPFederation."\n");
79 79
     }
80 80
 
81 81
     /* The eduroam OT monitoring has the following return codes:
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
                     break;
398 398
                 case \core\AbstractProfile::READINESS_LEVEL_NOTREADY:
399 399
                     $this->additionalFindings[AbstractTest::INFRA_IDP_RADIUS][] = ["Profile" => "UNCONCLUSIVE"];
400
-                    $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm);
400
+                    $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm);
401 401
                     break;
402 402
                 default:
403 403
             }
404 404
         } else {
405
-            $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm);
405
+            $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm);
406 406
         }
407 407
     }
408 408
 
Please login to merge, or discard this patch.
core/diag/RFC6614Tests.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * Test suite to verify that a given NAI realm has NAPTR records according to
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status'];
145 145
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']];
146 146
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected'];
147
-                $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private'];
147
+                $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private'];
148 148
                 if (!isset($this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k])) {
149 149
                     $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k] = [];
150 150
                 }
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 // but code analysers want this more explicit, so here is this extra
189 189
 // call to escapeshellarg()
190 190
         $escapedHost = escapeshellarg($host);
191
-        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1\n");
191
+        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1\n");
192 192
         $time_start = microtime(true);
193 193
         $opensslbabble = [];
194 194
         $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures
195
-        exec(CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
195
+        exec(CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
196 196
         $time_stop = microtime(true);
197 197
         $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000);
198 198
         $testresults['returncode'] = $result;
Please login to merge, or discard this patch.
core/diag/RFC7585Tests.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 namespace core\diag;
23 23
 
24
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
24
+require_once dirname(dirname(__DIR__))."/config/_config.php";
25 25
 
26 26
 /**
27 27
  * Test suite to verify that a given NAI realm has NAPTR records according to
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             $this->NAPTR_executed = RADIUSTests::RETVAL_NOTCONFIGURED;
170 170
             return RADIUSTests::RETVAL_NOTCONFIGURED;
171 171
         }
172
-        $NAPTRs = dns_get_record($this->realm . ".", DNS_NAPTR);
172
+        $NAPTRs = dns_get_record($this->realm.".", DNS_NAPTR);
173 173
         if ($NAPTRs === FALSE || count($NAPTRs) == 0) {
174 174
             $this->NAPTR_executed = RFC7585Tests::RETVAL_NONAPTR;
175 175
             return RFC7585Tests::RETVAL_NONAPTR;
Please login to merge, or discard this patch.
core/Options.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
         foreach (array_keys($this->typeDb) as $name) {
143 143
             if ($className === 0) {
144 144
                 $tempArray[] = $name;
145
-            } elseif (preg_match('/^' . $className . ':/', $name) > 0) {
145
+            } elseif (preg_match('/^'.$className.':/', $name) > 0) {
146 146
                 $tempArray[] = $name;
147 147
             }
148 148
         }
149 149
         $returnArray = $tempArray;
150 150
         // remove silverbullet-specific options if this deployment is not SB
151 151
         foreach ($tempArray as $key => $val) {
152
-            if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
152
+            if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
153 153
                 unset($returnArray[$key]);
154 154
             }
155
-            if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
155
+            if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
156 156
                 unset($returnArray[$key]);
157 157
             }
158 158
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         if (isset($this->typeDb[$optionname])) {
172 172
             return $this->typeDb[$optionname];
173 173
         }
174
-        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: " . htmlentities($optionname));
174
+        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: ".htmlentities($optionname));
175 175
     }
176 176
 
177 177
     /**
Please login to merge, or discard this patch.
core/DeviceFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
         parent::__construct();
59 59
         $Dev = \devices\Devices::listDevices();
60 60
         if (isset($Dev[$blueprint])) {
61
-            $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n");
62
-            $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_" . $Dev[$blueprint]['module'];
61
+            $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n");
62
+            $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_".$Dev[$blueprint]['module'];
63 63
             $this->device = new $class_name();
64 64
             if (!$this->device) {
65 65
                 $this->loggerInstance->debug(2, "module loading failed");
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         } else {
69 69
             print("unknown devicename:$blueprint\n");
70 70
         }
71
-        $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory'];
71
+        $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory'];
72 72
         $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0;
73 73
         $this->device->device_id = $blueprint;
74 74
         $options = \devices\Devices::$Options;
Please login to merge, or discard this patch.