Passed
Push — release_2_0 ( c9a182...4d277c )
by Stefan
09:38
created
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
 
@@ -760,12 +760,12 @@  discard block
 block discarded – undo
760 760
 // so test if there's something PEMy in the file at all
761 761
 // serverchain.pem is the output from eapol_test; incomingserver.pem is written by extractIncomingCertsfromEAP() if there was at least one server cert.
762 762
         if (filesize("$tmpDir/serverchain.pem") > 10 && filesize("$tmpDir/incomingserver.pem") > 10) {
763
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
764
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
765
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
766
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
767
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
768
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
763
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
764
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
765
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
766
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
767
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
768
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
769 769
         }
770 770
 
771 771
 
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
         // we are UNHAPPY if no names match!
833 833
         $happiness = "UNHAPPY";
834 834
         foreach ($this->expectedServerNames as $expectedName) {
835
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
835
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
836 836
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
837 837
                 $this->loggerInstance->debug(4, "Totally happy!");
838 838
                 $happiness = "TOTALLY";
@@ -877,11 +877,11 @@  discard block
 block discarded – undo
877 877
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
878 878
         // the config intentionally does not include CA checking. We do this
879 879
         // ourselves after getting the chain with -o.
880
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
880
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
881 881
 
882 882
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
883 883
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
884
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
884
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
885 885
         $time_start = microtime(true);
886 886
         $pflow = [];
887 887
         exec($cmdline, $pflow);
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
926 926
             array_pop($packetflow);
927 927
         }
928
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
928
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
929 929
         $packetcount = array_count_values($packetflow);
930 930
         $testresults['packetcount'] = $packetcount;
931 931
         $testresults['packetflow'] = $packetflow;
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
     private function wasModernTlsNegotiated(&$testresults, $packetflow_orig)
968 968
     {
969 969
         $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION);
970
-        $this->loggerInstance->debug(4,"TLS version found is: $negotiatedTlsVersion"."\n");
970
+        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n");
971 971
         if ($negotiatedTlsVersion === FALSE) {
972 972
             $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION;
973 973
         } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) {
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
         $x509 = new \core\common\X509();
1029 1029
 // $eap_certarray holds all certs received in EAP conversation
1030
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
1030
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
1031 1031
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
1032 1032
             $eapCertArray = $x509->splitCertificate($incomingData);
1033 1033
         } else {
@@ -1057,10 +1057,10 @@  discard block
 block discarded – undo
1057 1057
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
1058 1058
                     $servercert[] = $cert;
1059 1059
                     if (count($servercert) == 1) {
1060
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
1060
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
1061 1061
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
1062 1062
                         }
1063
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
1063
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
1064 1064
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
1065 1065
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
1066 1066
                     }
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         chdir($tmpDir);
1142 1142
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1143 1143
         if ($clientcertdata !== NULL) {
1144
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1144
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1145 1145
         }
1146 1146
         $testresults = [];
1147 1147
         // initialise the sub-array for cleaner parsing
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
                     'issuer' => $this->printDN($certdata['issuer']),
1243 1243
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1244 1244
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1245
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1245
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1246 1246
                     'sha1' => $certdata['sha1'],
1247 1247
                     'extensions' => $certdata['extensions']
1248 1248
                 ];
Please login to merge, or discard this patch.
web/admin/edit_profile.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     <?php
128 128
     echo $uiElements->instLevelInfoBoxes($my_inst);
129 129
 
130
-    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier" . ($my_profile !== NULL ? "&amp;profile_id=" . $my_profile->identifier : "") . "' method='post' accept-charset='UTF-8'>
131
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
130
+    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier".($my_profile !== NULL ? "&amp;profile_id=".$my_profile->identifier : "")."' method='post' accept-charset='UTF-8'>
131
+                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>";
132 132
     $optionDisplay = new \web\lib\admin\OptionDisplay($profile_options, "Profile");
133 133
     ?>
134 134
     <fieldset class="option_container">
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
         </legend>
138 138
         <?php
139 139
         if ($wizardStyle) {
140
-            echo "<p>" . _("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.") . "</p>";
140
+            echo "<p>"._("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.")."</p>";
141 141
         }
142 142
         ?>
143 143
         <h3><?php echo _("Profile Name and RADIUS realm"); ?></h3>
144 144
         <?php
145 145
         if ($wizardStyle) {
146
-            echo "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>";
147
-            echo "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>";
148
-            echo "<p>" . _("You can also tell us your RADIUS realm. ");
146
+            echo "<p>"._("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.")."</p>";
147
+            echo "<p>"._("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.")."</p>";
148
+            echo "<p>"._("You can also tell us your RADIUS realm. ");
149 149
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] !== NULL) {
150 150
                 printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
151 151
             }
152
-            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
152
+            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).")."</p>";
153 153
         }
154 154
 
155 155
         echo $optionDisplay->prefilledOptionTable("profile");
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 
204 204
         <?php
205 205
         if ($wizardStyle) {
206
-            echo "<p>" . sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types") . "</p>";
207
-            echo "<p>" . _("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.") . "</p>";
208
-            echo "<p>" . _("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.") . "</p>";
206
+            echo "<p>".sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types")."</p>";
207
+            echo "<p>"._("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.")."</p>";
208
+            echo "<p>"._("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.")."</p>";
209 209
         }
210 210
         ?>
211 211
         <p>
@@ -214,46 +214,46 @@  discard block
 block discarded – undo
214 214
             <!-- UI table to align elements-->
215 215
         <table style="margin-left: 25px; border-collapse: collapse;">
216 216
             <tr>
217
-                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling");?></th>
217
+                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
218 218
             </tr>
219 219
             <tr>
220 220
                 <!-- checkbox and input field for anonymity support, available only when realm is known-->
221 221
                 <td>
222
-                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
222
+                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
223 223
                         <?php echo _("Enable Anonymous Outer Identity:"); ?>
224 224
                     </span>
225 225
                 </td>
226 226
                 <td>
227
-                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
227
+                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='anon_support' onclick='
228 228
                             if (this.form.elements["anon_support"].checked !== true) {
229 229
                                 this.form.elements["anon_local"].setAttribute("disabled", "disabled");
230 230
                             } else {
231 231
                                 this.form.elements["anon_local"].removeAttribute("disabled");
232 232
                             }
233 233
                             ;'/>
234
-                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
234
+                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : ""); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
235 235
                 </td>
236 236
             </tr>
237 237
             <tr>
238 238
                 <!-- checkbox and input field for check realm outer id, available only when realm is known-->
239 239
                 <td>
240
-                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
240
+                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
241 241
                         <?php echo _("Use special Outer Identity for realm checks:"); ?>
242 242
                     </span>
243 243
                 </td>
244 244
                 <td>
245
-                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
245
+                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='checkuser_support' onclick='
246 246
                             if (this.form.elements["checkuser_support"].checked !== true) {
247 247
                                 this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
248 248
                             } else {
249 249
                                 this.form.elements["checkuser_local"].removeAttribute("disabled");
250 250
                             }
251 251
                             ;'/>
252
-                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
252
+                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : ""); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
253 253
                 </td>
254 254
             </tr>
255 255
             <tr>
256
-                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling");?></th>
256
+                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling"); ?></th>
257 257
             </tr>
258 258
             <tr>
259 259
                 <!-- checkbox for "verify-->
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 </td>
265 265
                 <td>
266 266
                     <input type='checkbox' <?php
267
-                    echo ($verify != FALSE ? "checked" : "" );
267
+                    echo ($verify != FALSE ? "checked" : "");
268 268
                     ?> name='verify_support' onclick='
269 269
                             if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
270 270
                                 this.form.elements["hint_support"].setAttribute("disabled", "disabled");
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
             </tr>
277 277
             <tr>
278 278
                 <td>
279
-                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
279
+                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
280 280
                         <?php echo _("Enforce exact realm in username"); ?>
281 281
                     </span>
282 282
                 </td>
283 283
                 <td>
284
-                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
284
+                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : ""); ?> name='hint_support' <?php echo ($hint != FALSE ? "checked" : ""); ?> />
285 285
                 </td>
286 286
             </tr>
287 287
         </table>
@@ -291,20 +291,20 @@  discard block
 block discarded – undo
291 291
 
292 292
     <?php
293 293
     if ($wizardStyle) {
294
-        echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
294
+        echo "<p>"._("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).")."</p>";
295 295
     }
296 296
     ?>
297 297
     <p>
298 298
 
299 299
         <?php
300
-        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
301
-                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
300
+        echo "<span id='redirect_label' style='".($realm == "" ? "color:#999999" : "")."'><label for='redirect'>"._("Redirect end users to own web page:")."</label></span>
301
+                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ")."onclick='
302 302
                               if (this.form.elements[\"redirect\"].checked != true) {
303 303
                                 this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
304 304
                               } else {
305 305
                                 this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
306 306
                               };'/>
307
-                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
307
+                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled")."/>";
308 308
         ?>
309 309
     </p>
310 310
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
314 314
     <?php
315 315
     if ($wizardStyle) {
316
-        echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
316
+        echo "<p>"._("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.")."</p>";
317 317
     }
318 318
     ?>
319 319
     <?php
@@ -327,9 +327,9 @@  discard block
 block discarded – undo
327 327
      * @return void
328 328
      */
329 329
     function priority(string $eapType, bool $isenabled, int $priority) {
330
-        echo "<td><select id='$eapType-priority' name='$eapType-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">";
330
+        echo "<td><select id='$eapType-priority' name='$eapType-priority' ".(!$isenabled ? "disabled='disabled'" : "").">";
331 331
         for ($a = 1; $a < 7; $a = $a + 1) {
332
-            echo "<option id='$eapType-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
332
+            echo "<option id='$eapType-$a' value='$a' ".($isenabled && $a == $priority ? "selected" : "").">$a</option>";
333 333
         }
334 334
         echo "</select></td>";
335 335
     }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      * @return void
346 346
      */
347 347
     function inherited_options($idpwideoptions, $eapType, $isVisible) {
348
-        echo "<td><div style='" . (!$isVisible ? "visibility:hidden" : "") . "' class='inheritedoptions' id='$eapType-inherited-global'>";
348
+        echo "<td><div style='".(!$isVisible ? "visibility:hidden" : "")."' class='inheritedoptions' id='$eapType-inherited-global'>";
349 349
 
350 350
         $eapoptions = [];
351 351
 
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
         $eapoptionsNames = array_count_values($eapoptions);
359 359
 
360 360
         if (count($eapoptionsNames) > 0) {
361
-            echo "<strong>" . _("EAP options inherited from Global level:") . "</strong><br />";
361
+            echo "<strong>"._("EAP options inherited from Global level:")."</strong><br />";
362 362
             foreach ($eapoptionsNames as $optionname => $count) {
363 363
                 /// option count and enumeration
364 364
                 /// Example: "(3x) Server Name"
365 365
                 $uiElements = new web\lib\admin\UIElements();
366
-                printf(_("(%dx) %s") . "<br />", $count, $uiElements->displayName($optionname));
366
+                printf(_("(%dx) %s")."<br />", $count, $uiElements->displayName($optionname));
367 367
             }
368 368
         }
369 369
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                         <?php
399 399
                         $D = [];
400 400
                         foreach ($prefill_methods as $prio => $value) {
401
-                            print '<li>' . $value->getPrintableRep() . "</li>\n";
401
+                            print '<li>'.$value->getPrintableRep()."</li>\n";
402 402
                             $D[$value->getPrintableRep()] = $prio;
403 403
                         }
404 404
                         ?>
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                             }
425 425
                             $display = $a->getPrintableRep();
426 426
                             if (!isset($D[$a->getPrintableRep()])) {
427
-                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
427
+                                print '<li class="eap1">'.$a->getPrintableRep()."</li>\n";
428 428
                             }
429 429
                         }
430 430
                         ?>
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
     foreach ($methods as $a) {
438 438
         $display = $a->getPrintableRep();
439 439
         $v = isset($D[$display]) ? $D[$display] : '';
440
-        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
441
-        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
440
+        print '<input type="hidden" class="eapm" name="'.$display.'" id="EAP-'.$display.'" value="'.$display.'">';
441
+        print '<input type="hidden" class="eapmv" name="'.$display.'-priority" id="EAP-'.$display.'-priority" value="'.$v.'">';
442 442
     }
443 443
     ?>
444 444
     <br style="clear:both;" />
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
 foreach ($optionsAlreadySet as $optionNames) {
459 459
     if (preg_match("/^support:/", $optionNames)) {
460 460
         $has_support_options[$optionNames] = "SET";
461
-        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
461
+        $support_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
462 462
     }
463 463
     if (preg_match("/^media:/", $optionNames)) {
464 464
         $has_media_options[$$optionNames] = "SET";
465
-        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
465
+        $media_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
466 466
     }
467 467
 }
468 468
 $fields = [
@@ -471,22 +471,22 @@  discard block
 block discarded – undo
471 471
     "media" => _("Media Properties for this profile")];
472 472
 
473 473
 foreach ($fields as $name => $description) {
474
-    echo "<fieldset class='option_container' id='" . $name . "_override'>
474
+    echo "<fieldset class='option_container' id='".$name."_override'>
475 475
     <legend><strong>$description</strong></legend>
476 476
     <p>";
477 477
 
478
-    if (count(${"has_" . $name . "_options"}) > 0) {
479
-        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_" . $name . "_options"})), "<ul>" . ${$name . "_text"} . "</ul>");
478
+    if (count(${"has_".$name."_options"}) > 0) {
479
+        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_".$name."_options"})), "<ul>".${$name."_text"}."</ul>");
480 480
     }
481 481
 
482 482
     echo "</p>";
483 483
     echo $optionDisplay->prefilledOptionTable($name);
484
-    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>" . _("Add new option") . "</button>";
484
+    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>"._("Add new option")."</button>";
485 485
     echo "</fieldset>";
486 486
 }
487 487
 
488 488
 if ($wizardStyle) {
489
-    echo "<p>" . _("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.") . "</p>";
489
+    echo "<p>"._("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.")."</p>";
490 490
 }
491
-echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
491
+echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
492 492
 echo $deco->footer();
Please login to merge, or discard this patch.
core/ProfileRADIUS.php 1 patch
Spacing   +9 added lines, -9 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,7 +299,7 @@  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") . " WHERE profile_id = $this->identifier");
302
+        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier");
303 303
         if ($localpart !== NULL) {
304 304
             $this->databaseHandle->exec("UPDATE profile SET checkuser_value = ? WHERE profile_id = $this->identifier", "s", $localpart);
305 305
         }
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
      * @return void
314 314
      */
315 315
     public function setInputVerificationPreference($verify, $hint) {
316
-        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = " . ($verify === true ? "1" : "0") .
317
-                ", hint_userinput_suffix = " . ($hint === true ? "1" : "0") .
316
+        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = ".($verify === true ? "1" : "0").
317
+                ", hint_userinput_suffix = ".($hint === true ? "1" : "0").
318 318
                 " WHERE profile_id = $this->identifier");
319 319
     }
320 320
 
Please login to merge, or discard this patch.
core/DBConnection.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 use \Exception;
34 34
 
35
-require_once dirname(__DIR__) . "/config/_config.php";
35
+require_once dirname(__DIR__)."/config/_config.php";
36 36
 
37 37
 /**
38 38
  * This class is a singleton for establishing a connection to the database
@@ -61,24 +61,24 @@  discard block
 block discarded – undo
61 61
             case "EXTERNAL":
62 62
             case "FRONTEND":
63 63
             case "DIAGNOSTICS":
64
-                if (!isset(self::${"instance" . $theDb})) {
64
+                if (!isset(self::${"instance".$theDb})) {
65 65
                     $class = __CLASS__;
66
-                    self::${"instance" . $theDb} = new $class($database);
67
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
66
+                    self::${"instance".$theDb} = new $class($database);
67
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
68 68
                 }
69
-                return self::${"instance" . $theDb};
69
+                return self::${"instance".$theDb};
70 70
             case "RADIUS":
71
-                if (!isset(self::${"instance" . $theDb})) {
71
+                if (!isset(self::${"instance".$theDb})) {
72 72
                     $class = __CLASS__;
73 73
                     foreach (CONFIG_CONFASSISTANT['DB'] as $name => $oneRadiusAuthDb) {
74 74
                         $theInstance = new $class($name);
75
-                        self::${"instance" . $theDb}[] = $theInstance;
75
+                        self::${"instance".$theDb}[] = $theInstance;
76 76
                         $theInstance->databaseInstance = $theDb;
77 77
                     }
78 78
                 }
79
-                return self::${"instance" . $theDb};
79
+                return self::${"instance".$theDb};
80 80
             default:
81
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
81
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
82 82
         }
83 83
     }
84 84
 
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
             }
118 118
         }
119 119
         // log exact query to debug log, if log level is at 5
120
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
120
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
121 121
         if ($types !== NULL) {
122
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
122
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
123 123
         }
124 124
 
125 125
         if ($this->connection->connect_error) {
126
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
126
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
127 127
         }
128 128
         if ($types === NULL) {
129 129
             $result = $this->connection->query($querystring);
130 130
             if ($result === FALSE) {
131
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
131
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
132 132
             }
133 133
         } else {
134 134
             // fancy! prepared statement with dedicated argument list
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             }
142 142
             $prepResult = $statementObject->prepare($querystring);
143 143
             if ($prepResult === FALSE) {
144
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
144
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
145 145
             }
146 146
 
147 147
             // we have a variable number of arguments packed into the ... array
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
             array_unshift($localArray, $types);
154 154
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
155 155
             if ($retval === FALSE) {
156
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
156
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
157 157
             }
158 158
             $result = $statementObject->execute();
159 159
             if ($result === FALSE) {
160
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
160
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
161 161
             }
162 162
             $selectResult = $statementObject->get_result();
163 163
             if ($selectResult !== FALSE) {
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
 
170 170
         // all cases where $result could be FALSE have been caught earlier
171 171
         if ($this->connection->errno) {
172
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
172
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
173 173
         }
174 174
 
175 175
 
176 176
         if ($isMoreThanSelect) {
177
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
177
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
178 178
             if ($types !== NULL) {
179
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
179
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
180 180
             }
181 181
         }
182 182
         return $result;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
             $this->readOnly = CONFIG_CONFASSISTANT['DB'][$databaseCapitalised]['readonly'];
274 274
         }
275 275
         if ($this->connection->connect_error) {
276
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
276
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
277 277
         }
278 278
         // it does not matter for internal time calculations with TIMESTAMPs but
279 279
         // sometimes we operate on date/time strings. Since MySQL returns those
Please login to merge, or discard this patch.
core/IdPlist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         foreach ($idps as $idp) {
38 38
             $idpTitle[$idp['entityID']] = $idp['title'];
39 39
             $d = self::getIdpDistance($idp, $here);
40
-            $resultSet[$idp['entityID']] = $d . " " . $idp['title'];
40
+            $resultSet[$idp['entityID']] = $d." ".$idp['title'];
41 41
         }
42 42
         asort($resultSet);
43 43
         $outarray = [];
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $allIDPs = ($country != "" ? $handle->exec($query, "s", $country) : $handle->exec($query));
80 80
         $returnarray = [];
81 81
         // SELECTs never return a booleans, always an object
82
-        $i=0;
82
+        $i = 0;
83 83
         while ($queryResult = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allIDPs)) {
84 84
             $i++;
85 85
             $institutionOptions = explode('---', $queryResult->options);
Please login to merge, or discard this patch.
web/skins/modern/user/js/cat_js.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 $cat = new core\CAT();
27
-$idpId = filter_input(INPUT_GET, 'idp', FILTER_VALIDATE_INT) ?? filter_input(INPUT_POST, 'idp', FILTER_VALIDATE_INT)?? 0;
27
+$idpId = filter_input(INPUT_GET, 'idp', FILTER_VALIDATE_INT) ?? filter_input(INPUT_POST, 'idp', FILTER_VALIDATE_INT) ?? 0;
28 28
 $profileId = filter_input(INPUT_GET, 'profile', FILTER_VALIDATE_INT) ?? filter_input(INPUT_POST, 'profile', FILTER_VALIDATE_INT) ?? 0;
29 29
 $skinObject = $Gui->skinObject;
30 30
 if (isset(CONFIG_CONFASSISTANT['PRELOAD_IDPS']) && CONFIG_CONFASSISTANT['PRELOAD_IDPS']) {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         otherdata = j.otherdata;
127 127
     if(! result) {
128 128
       alert("<?php escaped_echo(_("no matching data found"))?>");
129
-      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
129
+      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
130 130
     }
131 131
     j = j.data;
132 132
     n = j.length;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
        result = j1.status;
264 264
        if(! result) {
265 265
             alert("<?php escaped_echo(_("no matching data found")) ?>");
266
-            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
266
+            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
267 267
        }
268 268
        j = j1.data;
269 269
        if(j.description !== undefined && j.description) {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
          $("#profile_desc").hide();
275 275
          $("#profile_desc").text('');
276 276
        }
277
-       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:"));?>'+' '+j.last_changed+'</span><br/>';
277
+       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:")); ?>'+' '+j.last_changed+'</span><br/>';
278 278
        if(j.local_url !== undefined && j.local_url) 
279 279
        txt = txt+'<span class="user_info"><?php escaped_echo(_("WWW:")); ?> <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>';
280 280
        if(j.local_email !== undefined && j.local_email) 
Please login to merge, or discard this patch.
web/lib/admin/OptionDisplay.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 use Exception;
26 26
 
27
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
27
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
28 28
 
29 29
 /**
30 30
  * We need to display previously set options in various forms. This class covers
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @return string HTML code <table>
88 88
      */
89 89
     public function prefilledOptionTable(string $attributePrefix) {
90
-        $retval = "<table id='expandable_$attributePrefix" . "_options'>";
90
+        $retval = "<table id='expandable_$attributePrefix"."_options'>";
91 91
 
92 92
         $prepopulate = [];
93 93
         foreach ($this->listOfOptions as $existingAttribute) {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
         if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" && CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != "LOCAL") {
120 120
             $blackListOnPrefill .= "|fed:silverbullet";
121 121
         }
122
-        if (is_array($prepopulate) && ( count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific")) { // editing... fill with values
122
+        if (is_array($prepopulate) && (count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific")) { // editing... fill with values
123 123
             foreach ($prepopulate as $option) {
124 124
                 if (preg_match("/$class:/", $option['name']) && !preg_match("/($blackListOnPrefill)/", $option['name'])) {
125 125
                     $optiontypearray = $optioninfo->optionType($option['name']);
126 126
                     $loggerInstance = new \core\common\Logging();
127 127
                     $loggerInstance->debug(5, "About to execute optiontext with PREFILL!\n");
128
-                    $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-' . $option['level'] . '-' . $option['row'] : $option['value']), $option['lang']);
128
+                    $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-'.$option['level'].'-'.$option['row'] : $option['value']), $option['lang']);
129 129
                 }
130 130
             }
131 131
         } else { // not editing exist, this in new: add empty list
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
             return "";
189 189
         }
190 190
         $descriptions["profile:openroaming"] = 
191
-                sprintf(_("By opting in to OpenRoaming, you agree to be bound by the '%s'."),"eduroam Ecosystem Broker OpenRoaming Identity Provider Policy").
191
+                sprintf(_("By opting in to OpenRoaming, you agree to be bound by the '%s'."), "eduroam Ecosystem Broker OpenRoaming Identity Provider Policy").
192 192
                 " ".
193
-                sprintf(_("Note that your requirement to inform users about the OpenRoaming End User Terms & Conditions is fulfilled when directing your end users to the %s download portal for installer download. Any other means of providing the installers needs to present this information via its own channel."),CONFIG['APPEARANCE']['product_name']).
193
+                sprintf(_("Note that your requirement to inform users about the OpenRoaming End User Terms & Conditions is fulfilled when directing your end users to the %s download portal for installer download. Any other means of providing the installers needs to present this information via its own channel."), CONFIG['APPEARANCE']['product_name']).
194 194
                 " ".
195 195
                 _("You are also aware that for best technical interoperability, you need to add a DNS entry into your realm's DNS zone.").
196 196
                 " ".
197
-                sprintf(_("Read <a href='%s'>these instructions</a>."),"https://wiki.geant.org/display/H2eduroam/Roaming+with+third+parties+based+on+Passpoint");
198
-        return "<span class='tooltip' id='S$rowid-tooltip-$input' style='display:" . ($isVisible ? "block" : "none") . "' onclick='alert(\"" . $descriptions[$input] . "\")'><img src='../resources/images/icons/question-mark-icon.png" . "'></span>";
197
+                sprintf(_("Read <a href='%s'>these instructions</a>."), "https://wiki.geant.org/display/H2eduroam/Roaming+with+third+parties+based+on+Passpoint");
198
+        return "<span class='tooltip' id='S$rowid-tooltip-$input' style='display:".($isVisible ? "block" : "none")."' onclick='alert(\"".$descriptions[$input]."\")'><img src='../resources/images/icons/question-mark-icon.png"."'></span>";
199 199
     }
200 200
 
201 201
     /**
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
      */
209 209
     private function selectElement($rowid, $list) {
210 210
         $jsmagic = "onchange='
211
-                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
211
+                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid."-select\").value)) {
212 212
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
213 213
                                    } else {
214 214
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"none\";
215 215
                                    }";
216 216
         foreach (array_keys(OptionDisplay::HTML_DATATYPE_TEXTS) as $key) {
217
-            $jsmagic .= "if (/#" . $key . "#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
218
-                                  document.getElementById(\"S$rowid-input-file\").style.display = \"" . ($key == \core\Options::TYPECODE_FILE ? "block" : "none") . "\";
219
-                                  document.getElementById(\"S$rowid-input-text\").style.display = \"" . ($key == \core\Options::TYPECODE_TEXT ? "block" : "none") . "\";
220
-                                  document.getElementById(\"S$rowid-input-string\").style.display = \"" . ($key == \core\Options::TYPECODE_STRING ? "block" : "none") . "\";
221
-                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"" . ($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none") . "\";
222
-                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"" . ($key == \core\Options::TYPECODE_INTEGER ? "block" : "none") . "\";
217
+            $jsmagic .= "if (/#".$key."#/.test(document.getElementById(\"option-S".$rowid."-select\").value)) {
218
+                                  document.getElementById(\"S$rowid-input-file\").style.display = \"".($key == \core\Options::TYPECODE_FILE ? "block" : "none")."\";
219
+                                  document.getElementById(\"S$rowid-input-text\").style.display = \"".($key == \core\Options::TYPECODE_TEXT ? "block" : "none")."\";
220
+                                  document.getElementById(\"S$rowid-input-string\").style.display = \"".($key == \core\Options::TYPECODE_STRING ? "block" : "none")."\";
221
+                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"".($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none")."\";
222
+                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"".($key == \core\Options::TYPECODE_INTEGER ? "block" : "none")."\";
223 223
                              }
224 224
                              ";
225 225
             // hide all tooltips (each is a <span>, and there are no other <span>s)
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $activelisttype = [];
249 249
         foreach ($list as $value) {
250 250
             $listtype = $optioninfo->optionType($value);
251
-            $retval .= "<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ";
251
+            $retval .= "<option id='option-S$rowid-v-$value' value='$value#".$listtype["type"]."#".$listtype["flag"]."#' ";
252 252
             if ($iterator == $this->optionIterator) {
253 253
                 $retval .= "selected='selected'";
254 254
                 $activelisttype = $listtype;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             } else {
257 257
                 $tooltips .= $this->tooltip($rowid, $value, FALSE);
258 258
             }
259
-            $retval .= ">" . $uiElements->displayName($value) . "</option>";
259
+            $retval .= ">".$uiElements->displayName($value)."</option>";
260 260
             $iterator++;
261 261
         }
262 262
         if (count($activelisttype) == 0) {
@@ -279,9 +279,9 @@  discard block
 block discarded – undo
279 279
      */
280 280
     private function selectLanguage($rowid, $makeVisible) {
281 281
         \core\common\Entity::intoThePotatoes();
282
-        $retval = "<select style='display:" . ($makeVisible ? "block" : "none") . "' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect'>
283
-            <option value='' name='select_language' selected>" . _("select language") . "</option>
284
-            <option value='C' name='all_languages'>" . _("default/other languages") . "</option>";
282
+        $retval = "<select style='display:".($makeVisible ? "block" : "none")."' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect'>
283
+            <option value='' name='select_language' selected>" . _("select language")."</option>
284
+            <option value='C' name='all_languages'>" . _("default/other languages")."</option>";
285 285
         foreach (CONFIG['LANGUAGES'] as $langindex => $possibleLang) {
286 286
             $thislang = $possibleLang['display'];
287 287
             $retval .= "<option value='$langindex' name='$langindex'>$thislang</option>";
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     private function inputFields($rowid, $activetype) {
310 310
         $retval = "";
311 311
         foreach (OptionDisplay::HTML_DATATYPE_TEXTS as $key => $type) {
312
-            $retval .= "<" . $type['html'] . " style='display:" . ($activetype['type'] == $key ? "block" : "none") . "' name='value[S$rowid-$key]' id='S" . $rowid . "-input-" . $key . "'" . $type['tail'] . ">";
312
+            $retval .= "<".$type['html']." style='display:".($activetype['type'] == $key ? "block" : "none")."' name='value[S$rowid-$key]' id='S".$rowid."-input-".$key."'".$type['tail'].">";
313 313
         }
314 314
         return $retval;
315 315
     }
@@ -324,11 +324,11 @@  discard block
 block discarded – undo
324 324
     private function noPrefillText(int $rowid, array $list) {
325 325
         // first column: the <select> element with the names of options and their field-toggling JS magic
326 326
         $selectorInfo = $this->selectElement($rowid, $list);
327
-        $retval = "<td>" . $selectorInfo["TEXT"] . "</td>";
327
+        $retval = "<td>".$selectorInfo["TEXT"]."</td>";
328 328
         // second column: the <select> element for language selection - only visible if the active option is multi-lang
329
-        $retval .= "<td>" . $this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML") . "</td>";
329
+        $retval .= "<td>".$this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML")."</td>";
330 330
         // third column: the actual input fields; the data type of the active option is visible, all others hidden
331
-        $retval .= "<td>" . $this->inputFields($rowid, $selectorInfo['ACTIVE']) . "</td>";
331
+        $retval .= "<td>".$this->inputFields($rowid, $selectorInfo['ACTIVE'])."</td>";
332 332
         return $retval;
333 333
     }
334 334
 
@@ -351,20 +351,20 @@  discard block
 block discarded – undo
351 351
         $retval .= "<td>";
352 352
         $uiElements = new UIElements();
353 353
         $listtype = $optioninfo->optionType($optionName);
354
-        $retval .= "<span style='display:flex;'>" . $uiElements->displayName($optionName);
355
-        $retval .= $this->tooltip($rowid, $optionName, TRUE) . "</span>";
356
-        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ></td>";
354
+        $retval .= "<span style='display:flex;'>".$uiElements->displayName($optionName);
355
+        $retval .= $this->tooltip($rowid, $optionName, TRUE)."</span>";
356
+        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#".$listtype["type"]."#".$listtype["flag"]."#' ></td>";
357 357
 
358 358
         // language tag if any
359 359
         $retval .= "<td>";
360 360
         if ($listtype["flag"] == "ML") {
361 361
 
362
-            $language = "(" . strtoupper($optionLang) . ")";
362
+            $language = "(".strtoupper($optionLang).")";
363 363
             if ($optionLang == 'C') {
364 364
                 $language = _("(default/other languages)");
365 365
             }
366 366
             $retval .= $language;
367
-            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect' value='" . $optionLang . "' style='display:block'>";
367
+            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect' value='".$optionLang."' style='display:block'>";
368 368
         }
369 369
         $retval .= "</td>";
370 370
 // attribute content
@@ -374,12 +374,12 @@  discard block
 block discarded – undo
374 374
             case \core\Options::TYPECODE_COORDINATES:
375 375
                 $this->allLocationCount = $this->allLocationCount + 1;
376 376
                 // display of the locations varies by map provider
377
-                $classname = "\web\lib\admin\Map" . CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'];
377
+                $classname = "\web\lib\admin\Map".CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'];
378 378
                 $link = $classname::optionListDisplayCode($optionValue, $this->allLocationCount);
379
-                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-" . \core\Options::TYPECODE_TEXT . "]' id='S$rowid-input-text' value='$optionValue'>$link";
379
+                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-".\core\Options::TYPECODE_TEXT."]' id='S$rowid-input-text' value='$optionValue'>$link";
380 380
                 break;
381 381
             case \core\Options::TYPECODE_FILE:
382
-                $retval .= "<input readonly type='text' name='value[S$rowid-" . \core\Options::TYPECODE_STRING . "]' id='S" . $rowid . "-input-string' style='display:none' value='" . urlencode($optionValue) . "'>";
382
+                $retval .= "<input readonly type='text' name='value[S$rowid-".\core\Options::TYPECODE_STRING."]' id='S".$rowid."-input-string' style='display:none' value='".urlencode($optionValue)."'>";
383 383
                 $uiElements = new UIElements();
384 384
                 switch ($optionName) {
385 385
                     case "eap:ca_file":
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                 if ($listtype['type'] == \core\Options::TYPECODE_BOOLEAN) {// only modify in this one case
410 410
                     $displayedVariant = ($optionValue == "on" ? _("on") : _("off"));
411 411
                 }
412
-                $retval .= "<strong>$displayedVariant</strong><input type='hidden' name='value[S$rowid-" . $listtype['type'] . "]' id='S" . $rowid . "-input-" . $listtype["type"] . "' value=\"" . htmlspecialchars($optionValue) . "\" style='display:block'>";
412
+                $retval .= "<strong>$displayedVariant</strong><input type='hidden' name='value[S$rowid-".$listtype['type']."]' id='S".$rowid."-input-".$listtype["type"]."' value=\"".htmlspecialchars($optionValue)."\" style='display:block'>";
413 413
                 break;
414 414
             default:
415 415
                 // this should never happen!
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
        <td>
454 454
           <button type='button' class='delete' onclick='";
455 455
         if ($prefillValue !== NULL && $item == "general:geo_coordinates") {
456
-            $funcname = "Map" . CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'] . 'DeleteCoord';
457
-            $retval .= 'if (typeof ' . $funcname . ' === "function") { ' . $funcname . '(' . $this->allLocationCount . '); } ';
456
+            $funcname = "Map".CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'].'DeleteCoord';
457
+            $retval .= 'if (typeof '.$funcname.' === "function") { '.$funcname.'('.$this->allLocationCount.'); } ';
458 458
         }
459
-        $retval .= 'deleteOption("option-S' . $rowid . '")';
459
+        $retval .= 'deleteOption("option-S'.$rowid.'")';
460 460
         $retval .= "'>-</button>
461 461
        </td>
462 462
     </tr>";
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Spacing   +24 added lines, -24 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("");
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!"));
145 145
                 } else {
146 146
                     $profile->setRealmcheckUser(true, $checkuser_name);
147
-                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm));
147
+                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm));
148 148
                 }
149 149
             } else {
150 150
                 $profile->setRealmCheckUser(false);
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
                 $extratext = "";
157 157
                 if (!empty($realm)) {
158 158
                     if ($hint !== FALSE) {
159
-                        $extratext = " " . sprintf(_("The realm portion MUST be exactly '...@%s'."), $realm);
159
+                        $extratext = " ".sprintf(_("The realm portion MUST be exactly '...@%s'."), $realm);
160 160
                     } else {
161
-                        $extratext = " " . sprintf(_("The realm portion MUST end with '%s' but sub-realms of it are allowed (i.e. 'user@%s' and 'user@<...>.%s' are both acceptable)."), $realm, $realm, $realm);
161
+                        $extratext = " ".sprintf(_("The realm portion MUST end with '%s' but sub-realms of it are allowed (i.e. 'user@%s' and 'user@<...>.%s' are both acceptable)."), $realm, $realm, $realm);
162 162
                     }
163 163
                 }
164
-                echo $uiElements->boxOkay(_("Where possible, supplicants will verify that username inputs contain a syntactically correct realm.") . $extratext);
164
+                echo $uiElements->boxOkay(_("Where possible, supplicants will verify that username inputs contain a syntactically correct realm.").$extratext);
165 165
             } else {
166 166
                 $profile->setInputVerificationPreference(false, false);
167 167
             }
@@ -193,29 +193,29 @@  discard block
 block discarded – undo
193 193
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
194 194
             }
195 195
 
196
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
196
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
197 197
 
198 198
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
199 199
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
200 200
                     continue;
201 201
                 }
202
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
203
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
202
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
203
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
204 204
                     // add EAP type to profile as requested, but ...
205 205
                     $profile->addSupportedEapMethod($a, $priority);
206
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
206
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
207 207
                     // see if we can enable the EAP type, or if info is missing
208 208
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
209 209
                     if ($eapcompleteness === true) {
210
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
210
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
211 211
                     } else {
212 212
                         $warntext = "";
213 213
                         if (is_array($eapcompleteness)) {
214 214
                             foreach ($eapcompleteness as $item) {
215
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
215
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
216 216
                             }
217 217
                         }
218
-                        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."));
218
+                        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."));
219 219
                     }
220 220
                 }
221 221
             }
@@ -225,23 +225,23 @@  discard block
 block discarded – undo
225 225
             if (count($significantChanges) > 0) {
226 226
                 $myInstOriginal = new \core\IdP($profile->institution);
227 227
                 // send a notification/alert mail to someone we know is in charge
228
-                $text = _("To whom it may concern,") . "\n\n";
228
+                $text = _("To whom it may concern,")."\n\n";
229 229
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
230
-                $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";
230
+                $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";
231 231
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
232
-                    $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";
233
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
232
+                    $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";
233
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
234 234
                 }
235 235
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
236 236
                     $text .= _("A new trusted root CA was added. The details are below:")."\n\n";
237
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
237
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
238 238
                 }
239 239
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
240
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
241
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
240
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
241
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
242 242
                 }
243
-                $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";
244
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
243
+                $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";
244
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
245 245
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
246 246
                 $fed = new core\Federation($myInstOriginal->federation);
247 247
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         <?php
261 261
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
262 262
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
263
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
263
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
264 264
     </form>";
265 265
         }
266 266
         echo $deco->footer();
Please login to merge, or discard this patch.
web/skins/modern/div_user_welcome.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
     if (false /* display only if IdP has opted in to OpenRoaming - or maybe always, and only display pertinent ones from the set of consortia? */) {
43 43
         foreach ([
44 44
                 "eduroam" => [ 
45
-                      "TOU"  => "https://wiki.geant.org/display/H2eduroam/Terms+and+Conditions",
46
-                      "PRIV" => "https://www.eduroam.org/privacy/",
45
+                        "TOU"  => "https://wiki.geant.org/display/H2eduroam/Terms+and+Conditions",
46
+                        "PRIV" => "https://www.eduroam.org/privacy/",
47 47
                     ], 
48 48
                 "OpenRoaming" => [ 
49
-                      "TOU"  => "https://wballiance.com/openroaming/toc-2020/",
50
-                      "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
49
+                        "TOU"  => "https://wballiance.com/openroaming/toc-2020/",
50
+                        "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
51 51
                     ]
52 52
             ] as $consortium => $terms) {
53 53
             printf("<p>" . _("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply." . "</p>"), $consortium, $terms['TOU'], $terms['PRIV']);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                       "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
51 51
                     ]
52 52
             ] as $consortium => $terms) {
53
-            printf("<p>" . _("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply." . "</p>"), $consortium, $terms['TOU'], $terms['PRIV']);
53
+            printf("<p>"._("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply."."</p>"), $consortium, $terms['TOU'], $terms['PRIV']);
54 54
         }
55 55
         // this would actually be a checkbox which grays out the actual download button until ACKed
56 56
         echo "<p>"._("I agree to be bound by these Terms and Conditions.")."</p>";
Please login to merge, or discard this patch.