Passed
Push — release_2_0 ( 8d8369...4b2eb9 )
by Stefan
07:17
created
web/admin/112365365321.php 1 patch
Spacing   +3 added lines, -3 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(__DIR__)) . '/config/_config.php';
22
+require_once dirname(dirname(__DIR__)).'/config/_config.php';
23 23
 
24 24
 $uiElements = new web\lib\admin\UIElements();
25 25
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                         // filesystem cleanup
76 76
                     case web\lib\common\FormElements::BUTTON_DELETE:
77 77
                         $i = web\lib\admin\Maintenance::deleteObsoleteTempDirs();
78
-                        echo "<div class='ca-summary'><table>" . $uiElements->boxRemark(sprintf("Deleted %d cache directories.", $i), "Cache deleted") . "</table></div>";
78
+                        echo "<div class='ca-summary'><table>".$uiElements->boxRemark(sprintf("Deleted %d cache directories.", $i), "Cache deleted")."</table></div>";
79 79
                         break;
80 80
                     default:
81 81
                         break;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     $admin_query = $dbHandle->exec("SELECT SUM(downloads_admin) AS admin, SUM(downloads_user) AS user, SUM(downloads_silverbullet) as silverbullet FROM downloads WHERE device_id = '$index'");
142 142
                     // SELECT -> mysqli_result, not boolean
143 143
                     while ($a = mysqli_fetch_object(/** @scrutinizer ignore-type */ $admin_query)) {
144
-                        echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s", $a->user + $a->silverbullet) . "</td>";
144
+                        echo "<td>".$device_array['display']."</td><td>".$a->admin."</td><td>".$a->user."</td><td>".$a->silverbullet."</td><td>".sprintf("%s", $a->user + $a->silverbullet)."</td>";
145 145
                         $gross_admin = $gross_admin + $a->admin;
146 146
                         $gross_user = $gross_user + $a->user;
147 147
                         $gross_silverbullet = $gross_silverbullet + $a->silverbullet;
Please login to merge, or discard this patch.
devices/apple_mobileconfig/MobileconfigSuperclass.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
       <key>PayloadDescription</key>
94 94
          <string>$tagline</string>
95 95
       <key>PayloadDisplayName</key>
96
-         <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</string>
96
+         <string>".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</string>
97 97
       <key>PayloadIdentifier</key>
98
-         <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
98
+         <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
99 99
       <key>PayloadOrganization</key>
100
-         <string>" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8') . ( $this->attributes['internal:profile_count'][0] > 1 ? " (" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8') . ")" : "") . "</string>
100
+         <string>".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8').($this->attributes['internal:profile_count'][0] > 1 ? " (".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8').")" : "")."</string>
101 101
       <key>PayloadType</key>
102 102
          <string>Configuration</string>
103 103
       <key>PayloadUUID</key>
104
-         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
104
+         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
105 105
       <key>PayloadVersion</key>
106 106
          <integer>1</integer>";
107 107
         \core\common\Entity::outOfThePotatoes();
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
     protected function consentBlock() {
133 133
         \core\common\Entity::intoThePotatoes();
134 134
         if (isset($this->attributes['support:info_file'])) {
135
-            return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
135
+            return MobileconfigSuperclass::BUFFER_CONSENT_PRE.htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8').MobileconfigSuperclass::BUFFER_CONSENT_POST;
136 136
         }
137 137
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
138 138
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
139
-                $retval =MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s!"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
139
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s!"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
140 140
                 \core\common\Entity::outOfThePotatoes();
141 141
                 return $retval;
142 142
             }
143
-            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . _("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.") . MobileconfigSuperclass::BUFFER_CONSENT_POST;
143
+            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE._("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.").MobileconfigSuperclass::BUFFER_CONSENT_POST;
144 144
             \core\common\Entity::outOfThePotatoes();
145 145
             return $retval;
146 146
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // also escape htmlspecialchars
164 164
         // not all names and profiles have a name, so be prepared
165 165
 
166
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
166
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
167 167
 
168 168
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
169 169
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
         file_put_contents('installer_profile', $outputXml);
207 207
 
208
-        $fileName = $this->installerBasename . '.mobileconfig';
208
+        $fileName = $this->installerBasename.'.mobileconfig';
209 209
 
210 210
         if (!$this->sign) {
211 211
             rename("installer_profile", $fileName);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             return $fileName;
214 214
         }
215 215
         // still here? Then we are signing.
216
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
216
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
217 217
         if ($signing === FALSE) {
218 218
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
219 219
         }
@@ -231,19 +231,19 @@  discard block
 block discarded – undo
231 231
         \core\common\Entity::intoThePotatoes();
232 232
         $ssidCount = count($this->attributes['internal:SSID']);
233 233
         $certCount = count($this->attributes['internal:CAs'][0]);
234
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
234
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
235 235
         $out .= "<p>";
236 236
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
237 237
         $out .= "<ul>";
238
-        $out .= "<li>" . _("to install the profile") . "</li>";
239
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
238
+        $out .= "<li>"._("to install the profile")."</li>";
239
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
240 240
         if ($certCount > 1) {
241
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
241
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
242 242
         }
243 243
         $out .= "</li>";
244
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
244
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
245 245
         if ($ssidCount > 1) {
246
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
246
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
247 247
         }
248 248
         $out .= "</li>";
249 249
         $out .= "</ul>";
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                <key>ServiceProviderRoamingEnabled</key>
281 281
                <true/>
282 282
                <key>DisplayedOperatorName</key>
283
-               <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " via Passpoint</string>";
283
+               <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." via Passpoint</string>";
284 284
         // if we don't know the realm, omit the entire DomainName key
285 285
         if (isset($this->attributes['internal:realm'])) {
286 286
             $retval .= "<key>DomainName</key>
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                   <dict>
333 333
                       <key>AcceptEAPTypes</key>
334 334
                          <array>
335
-                            <integer>" . $eapType['OUTER'] . "</integer>
335
+                            <integer>" . $eapType['OUTER']."</integer>
336 336
                          </array>
337 337
                       <key>EAPFASTProvisionPAC</key>
338 338
                             <true />
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 ";
346 346
         if ($realm !== NULL) {
347 347
             $retval .= "<key>OuterIdentity</key>
348
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
348
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
349 349
 ";
350 350
         }
351 351
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
         $retval .= "
370 370
                          </array>";
371 371
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
372
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
372
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
373 373
         }
374 374
         $retval .= "
375 375
                       <key>TTLSInnerAuthentication</key>
376
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
376
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
377 377
                    </dict>";
378 378
         return $retval;
379 379
     }
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
             // characters are still reversed, invert on use!
393 393
             $buffer .= "<string>Manual</string>
394 394
                   <key>ProxyServer</key>
395
-                  <string>" . strrev($serverAndPort[1]) . "</string>
395
+                  <string>" . strrev($serverAndPort[1])."</string>
396 396
                   <key>ProxyServerPort</key>
397
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
397
+                  <integer>" . strrev($serverAndPort[0])."</integer>
398 398
                   <key>ProxyPACFallbackAllowed</key>
399 399
                   <false/>";
400 400
         } else {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                     throw new Exception("SSID must be a string!");
423 423
                 }
424 424
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
425
-                $payloadIdentifier = "wifi." . $this->serial;
425
+                $payloadIdentifier = "wifi.".$this->serial;
426 426
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
427 427
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
428 428
                 $encryptionTypeString = "WPA";
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
                <key>PayloadDisplayName</key>
471 471
                   <string>$payloadShortName</string>
472 472
                <key>PayloadIdentifier</key>
473
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
473
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
474 474
                <key>PayloadOrganization</key>
475
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
475
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
476 476
                <key>PayloadType</key>
477
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
477
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
478 478
         $retval .= $this->proxySettings();
479 479
         $retval .= $setupModesString;
480 480
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         }
487 487
         $retval .= "
488 488
                <key>PayloadUUID</key>
489
-                  <string>" . \core\common\Entity::uuid() . "</string>
489
+                  <string>" . \core\common\Entity::uuid()."</string>
490 490
                <key>PayloadVersion</key>
491 491
                   <integer>1</integer>
492 492
                   $wifiNetworkIdentification</dict>";
@@ -515,15 +515,15 @@  discard block
 block discarded – undo
515 515
 	<key>IsHotspot</key>
516 516
 	<false/>
517 517
 	<key>PayloadDescription</key>
518
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
518
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
519 519
 	<key>PayloadDisplayName</key>
520
-	<string>" . _("Disabled WiFi network") . "</string>
520
+	<string>" . _("Disabled WiFi network")."</string>
521 521
 	<key>PayloadIdentifier</key>
522
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
522
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
523 523
 	<key>PayloadType</key>
524 524
 	<string>com.apple.wifi.managed</string>
525 525
 	<key>PayloadUUID</key>
526
-	<string>" . \core\common\Entity::uuid() . "</string>
526
+	<string>".\core\common\Entity::uuid()."</string>
527 527
 	<key>PayloadVersion</key>
528 528
 	<real>1</real>";
529 529
         $retval .= $this->proxySettings();
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         $mimeBlob = base64_encode($binaryBlob);
598 598
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
599 599
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
600
-        $retArray = ["block" => "<dict>" .
600
+        $retArray = ["block" => "<dict>".
601 601
             // we don't include the import password. It's displayed on screen, and should be input by the user.
602 602
             // <key>Password</key>
603 603
             //   <string>" . $this->clientCert['password'] . "</string>
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
                   <key>PayloadDescription</key>
611 611
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
612 612
                   <key>PayloadDisplayName</key>
613
-                     <string>" . _("eduroam user certificate") . "</string>
613
+                     <string>"._("eduroam user certificate")."</string>
614 614
                   <key>PayloadIdentifier</key>
615 615
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
616 616
                   <key>PayloadType</key>
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
                   <key>PayloadVersion</key>
621 621
                      <integer>1</integer>
622 622
                 </dict>",
623
-            "UUID" => $payloadUUID,];
623
+            "UUID" => $payloadUUID, ];
624 624
         \core\common\Entity::outOfThePotatoes();
625 625
         return $retArray;
626 626
     }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
         }
639 639
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
640 640
         return "<key>RemovalDate</key>
641
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
641
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
642 642
     }
643 643
 
644 644
     private $CAsAccountedFor = [];
@@ -661,21 +661,21 @@  discard block
 block discarded – undo
661 661
             $stream = "
662 662
             <dict>
663 663
                <key>PayloadCertificateFileName</key>
664
-               <string>" . $ca['uuid'] . ".der</string>
664
+               <string>" . $ca['uuid'].".der</string>
665 665
                <key>PayloadContent</key>
666 666
                <data>
667
-" . $trimmedPem . "</data>
667
+" . $trimmedPem."</data>
668 668
                <key>PayloadDescription</key>
669
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
669
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
670 670
                <key>PayloadDisplayName</key>
671
-               <string>" . sprintf(_("%s CA"), \core\common\Entity::$nomenclature_inst) . "</string>
671
+               <string>" . sprintf(_("%s CA"), \core\common\Entity::$nomenclature_inst)."</string>
672 672
                <key>PayloadIdentifier</key>
673
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
673
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
674 674
                <key>PayloadOrganization</key>
675
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
675
+               <string>".$this->massagedConsortium.".1x-config.org</string>
676 676
                <key>PayloadType</key>
677 677
                <string>com.apple.security.root</string>
678
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
678
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
679 679
                <key>PayloadVersion</key>
680 680
                <integer>1</integer>
681 681
             </dict>";
Please login to merge, or discard this patch.
core/common/Entity.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function __construct() {
96 96
         $this->loggerInstance = new Logging();
97
-        $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n");
97
+        $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n");
98 98
         $this->languageInstance = new Language();
99 99
         Entity::intoThePotatoes("core");
100 100
         // some config elements are displayable. We need some dummies to 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $dummy_inst2 = _("organisation");
107 107
         $dummy_inst3 = _("Identity Provider");
108 108
         // and do something useless with the strings so that there's no "unused" complaint
109
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) {
109
+        if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3) < 0) {
110 110
             throw new \Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
111 111
         }
112 112
         Entity::$nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * Logs the end of lifetime of the entity to the debug log on level 5.
122 122
      */
123 123
     public function __destruct() {
124
-        (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n");
124
+        (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n");
125 125
     }
126 126
 
127 127
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) {
153 153
         $loggerInstance = new Logging();
154
-        $name = md5(time() . rand());
154
+        $name = md5(time().rand());
155 155
         $path = ROOT;
156 156
         switch ($purpose) {
157 157
             case 'silverbullet':
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             default:
170 170
                 throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n");
171 171
         }
172
-        $tmpDir = $path . '/' . $name;
172
+        $tmpDir = $path.'/'.$name;
173 173
         $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n");
174 174
         if (!mkdir($tmpDir, 0700, true)) {
175 175
             if ($failIsFatal) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * @return void
190 190
      */
191 191
     public static function rrmdir($dir) {
192
-        foreach (glob($dir . '/*') as $file) {
192
+        foreach (glob($dir.'/*') as $file) {
193 193
             if (is_dir($file)) {
194 194
                 Entity::rrmdir($file);
195 195
             } else {
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
         }
215 215
         // these substr() are guaranteed to yield actual string data, as the
216 216
         // base string is an MD5 hash - has sufficient length
217
-        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-';
218
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-';
219
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-';
220
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-';
217
+        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-';
218
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-';
219
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-';
220
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-';
221 221
         $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12);
222
-        return $prefix . $uuid;
222
+        return $prefix.$uuid;
223 223
     }
224 224
 
225 225
     /**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         for ($i = count($trace); $i--; $i > 0) {
258 258
             if (preg_match('/Entity/', $trace[$i - 1]['class'])) {
259 259
                 if ($showTrace) {
260
-                    echo "FOUND caller: ".print_r($trace[$i],true). " - class is ".$trace[$i]['class'];
260
+                    echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class'];
261 261
                 }
262 262
                 $caller = $trace[$i];
263 263
                 break;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT));
269 269
         if ($showTrace === TRUE) {   
270 270
             echo "<pre>".print_r($trace, true)."</pre>";
271
-            echo "CLASS = " . $myName ."<br/>";
271
+            echo "CLASS = ".$myName."<br/>";
272 272
         }
273 273
         if (preg_match("/diag/", $myName) == 1) {
274 274
             $ret = "diagnostics";
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
         if ($catalogue === NULL) {
301 301
             $theCatalogue = Entity::determineOwnCatalogue($trace);
302 302
             textdomain($theCatalogue);
303
-            bindtextdomain($theCatalogue, ROOT . "/translation/");
303
+            bindtextdomain($theCatalogue, ROOT."/translation/");
304 304
         } else {
305 305
             textdomain($catalogue);
306
-            bindtextdomain($catalogue, ROOT . "/translation/");
306
+            bindtextdomain($catalogue, ROOT."/translation/");
307 307
         }
308 308
     }
309 309
 
Please login to merge, or discard this patch.
config/config-confassistant-template.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -116,16 +116,16 @@
 block discarded – undo
116 116
         'server_suffix' => '.hosted.eduroam.org',
117 117
         'gracetime' => 90,
118 118
         'CA' => ["type" => "embedded"], # OCSP URL needs to be configured in openssl.cnf
119
-      # 'CA' => ["type" => "DFN", "SOAP_API_ENDPOINT" => "http://no.idea.where/"],
119
+        # 'CA' => ["type" => "DFN", "SOAP_API_ENDPOINT" => "http://no.idea.where/"],
120 120
 
121 121
     ],
122 122
     
123 123
         /**
124
-     * Lists the RADIUS servers. They have a built-in DB to log auth requests.
125
-     * We need to query those to get auth stats for silverbullet admins
126
-     *
127
-     * @var array
128
-     */
124
+         * Lists the RADIUS servers. They have a built-in DB to log auth requests.
125
+         * We need to query those to get auth stats for silverbullet admins
126
+         *
127
+         * @var array
128
+         */
129 129
     'DB' => [
130 130
         // names don't matter - the source code will iterate through
131 131
         // all entries
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,13 +134,13 @@
 block discarded – undo
134 134
             'db' => 'radacct',
135 135
             'user' => 'someuser',
136 136
             'pass' => 'somepass',
137
-            'readonly' => TRUE,],
137
+            'readonly' => TRUE, ],
138 138
         'RADIUS_2' => [
139 139
             'host' => 'auth-2.hosted.eduroam.org',
140 140
             'db' => 'radacct',
141 141
             'user' => 'someuser',
142 142
             'pass' => 'somepass',
143
-            'readonly' => TRUE,],
143
+            'readonly' => TRUE, ],
144 144
     ],
145 145
 
146 146
     /**
Please login to merge, or discard this patch.
web/admin/inc/userStats.inc.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * ******************************************************************************
10 10
  */
11 11
 
12
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
12
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
13 13
 
14 14
 $auth = new \web\lib\admin\Authentication();
15 15
 $auth->authenticate();
@@ -22,30 +22,30 @@  discard block
 block discarded – undo
22 22
 
23 23
 ?>
24 24
 
25
-<h1><?php echo _("User Authentication Records");?></h1>
26
-<p><?php echo _("Note that:");?></p>
25
+<h1><?php echo _("User Authentication Records"); ?></h1>
26
+<p><?php echo _("Note that:"); ?></p>
27 27
 <ul>
28
-    <li><?php echo _("Authentication records are deleted after six months retention time");?></li>
29
-    <li><?php echo _("Operator Domain is based on the RADIUS attribute 'Operator-Name' and not sent by all hotspots");?></li>
30
-    <li><?php echo _("Different MAC addresses per credential may be due to MAC Address randomisation in recent operating systems");?></li>
28
+    <li><?php echo _("Authentication records are deleted after six months retention time"); ?></li>
29
+    <li><?php echo _("Operator Domain is based on the RADIUS attribute 'Operator-Name' and not sent by all hotspots"); ?></li>
30
+    <li><?php echo _("Different MAC addresses per credential may be due to MAC Address randomisation in recent operating systems"); ?></li>
31 31
 </ul>
32 32
 <table class='authrecord'>
33 33
     <tr>
34
-        <td><strong><?php echo _("Timestamp");?></strong></td>
35
-        <td><strong><?php echo _("Credential");?></strong></td>
36
-        <td><strong><?php echo _("MAC Address");?></strong></td>
37
-        <td><strong><?php echo _("Result");?></strong></td>
38
-        <td><strong><?php echo _("Operator Domain");?></strong></td>
34
+        <td><strong><?php echo _("Timestamp"); ?></strong></td>
35
+        <td><strong><?php echo _("Credential"); ?></strong></td>
36
+        <td><strong><?php echo _("MAC Address"); ?></strong></td>
37
+        <td><strong><?php echo _("Result"); ?></strong></td>
38
+        <td><strong><?php echo _("Operator Domain"); ?></strong></td>
39 39
     </tr>
40 40
     <?php
41 41
     $userAuthData = $profile->getUserAuthRecords($userInt);
42 42
     foreach ($userAuthData as $oneRecord) {
43
-        echo "<tr class='".($oneRecord['RESULT'] == "Access-Accept" ? "auth-success" : "auth-fail" )."'>"
43
+        echo "<tr class='".($oneRecord['RESULT'] == "Access-Accept" ? "auth-success" : "auth-fail")."'>"
44 44
                 . "<td>".$oneRecord['TIMESTAMP']."</td>"
45
-                . "<td>".substr_replace($oneRecord['CN'], "@…", strpos($oneRecord['CN'],"@"))."</td>"
45
+                . "<td>".substr_replace($oneRecord['CN'], "@…", strpos($oneRecord['CN'], "@"))."</td>"
46 46
                 . "<td>".$oneRecord['MAC']."</td>"
47 47
                 . "<td>".($oneRecord['RESULT'] == "Access-Accept" ? _("Success") : _("Failure"))."</td>"
48
-                . "<td>".substr($oneRecord['OPERATOR'] ?? "1(unknown)",1)."</td>"
48
+                . "<td>".substr($oneRecord['OPERATOR'] ?? "1(unknown)", 1)."</td>"
49 49
                 . "</tr>";
50 50
     }
51 51
     ?>
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
@@ -60,24 +60,24 @@  discard block
 block discarded – undo
60 60
             case "EXTERNAL":
61 61
             case "FRONTEND":
62 62
             case "DIAGNOSTICS":
63
-                if (!isset(self::${"instance" . $theDb})) {
63
+                if (!isset(self::${"instance".$theDb})) {
64 64
                     $class = __CLASS__;
65
-                    self::${"instance" . $theDb} = new $class($database);
66
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
65
+                    self::${"instance".$theDb} = new $class($database);
66
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
67 67
                 }
68
-                return self::${"instance" . $theDb};
68
+                return self::${"instance".$theDb};
69 69
             case "RADIUS":
70
-                if (!isset(self::${"instance" . $theDb})) {
70
+                if (!isset(self::${"instance".$theDb})) {
71 71
                     $class = __CLASS__;
72 72
                     foreach (CONFIG_CONFASSISTANT['DB'] as $name => $oneRadiusAuthDb) {
73 73
                         $theInstance = new $class($name);
74
-                        self::${"instance" . $theDb}[] = $theInstance;
74
+                        self::${"instance".$theDb}[] = $theInstance;
75 75
                         $theInstance->databaseInstance = $theDb;
76 76
                     }
77 77
                 }
78
-                return self::${"instance" . $theDb};
78
+                return self::${"instance".$theDb};
79 79
             default:
80
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
80
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
81 81
         }
82 82
     }
83 83
 
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
             }
117 117
         }
118 118
         // log exact query to debug log, if log level is at 5
119
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
119
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
120 120
         if ($types !== NULL) {
121
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
121
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
122 122
         }
123 123
 
124 124
         if ($this->connection->connect_error) {
125
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
125
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
126 126
         }
127 127
         if ($types === NULL) {
128 128
             $result = $this->connection->query($querystring);
129 129
             if ($result === FALSE) {
130
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
130
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
131 131
             }
132 132
         } else {
133 133
             // fancy! prepared statement with dedicated argument list
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             }
141 141
             $prepResult = $statementObject->prepare($querystring);
142 142
             if ($prepResult === FALSE) {
143
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
143
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
144 144
             }
145 145
 
146 146
             // we have a variable number of arguments packed into the ... array
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
             array_unshift($localArray, $types);
153 153
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
154 154
             if ($retval === FALSE) {
155
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
155
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
156 156
             }
157 157
             $result = $statementObject->execute();
158 158
             if ($result === FALSE) {
159
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
159
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
160 160
             }
161 161
             $selectResult = $statementObject->get_result();
162 162
             if ($selectResult !== FALSE) {
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
 
169 169
         // all cases where $result could be FALSE have been caught earlier
170 170
         if ($this->connection->errno) {
171
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
171
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
172 172
         }
173 173
 
174 174
 
175 175
         if ($isMoreThanSelect) {
176
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
176
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
177 177
             if ($types !== NULL) {
178
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
178
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
179 179
             }
180 180
         }
181 181
         return $result;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             $this->readOnly = CONFIG_CONFASSISTANT['DB'][$databaseCapitalised]['readonly'];
271 271
         }
272 272
         if ($this->connection->connect_error) {
273
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
273
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
274 274
         }
275 275
 
276 276
         if ($databaseCapitalised == "EXTERNAL" && CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") {
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * @return array<AbstractProfile> list of Profiles of this IdP
111 111
      */
112 112
     public function listProfiles(bool $activeOnly = FALSE) {
113
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
113
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
114 114
         $allProfiles = $this->databaseHandle->exec($query);
115 115
         $returnarray = [];
116 116
         // SELECT -> resource, not boolean
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $returnarray[] = $oneProfile;
121 121
         }
122 122
 
123
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
123
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
124 124
         return $returnarray;
125 125
     }
126 126
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
220 220
                     $theProfile = new ProfileSilverbullet($identifier, $this);
221 221
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
222
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
222
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
223 223
                     return $theProfile;
224 224
                 default:
225 225
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     public function getExternalDBId() {
338 338
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
339
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
339
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
340 340
             // SELECT -> it's a resource, not a boolean
341 341
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
342 342
                 return FALSE;
Please login to merge, or discard this patch.
web/lib/common/InputValidation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     private function inputValidationError($customtext) {
39 39
         \core\common\Entity::intoThePotatoes();
40
-        $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>";
40
+        $retval = "<p>"._("Input validation error: ").$customtext."</p>";
41 41
         \core\common\Entity::outOfThePotatoes();
42 42
         return $retval;
43 43
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function string($input, $allowWhitespace = FALSE) {
151 151
     // always chop out invalid characters, and surrounding whitespace
152
-    $retvalStep0 =  iconv("UTF-8", "UTF-8//TRANSLIT", $input);
152
+    $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input);
153 153
     if ($retvalStep0 === FALSE) {
154 154
         throw new Exception("iconv failure for string sanitisation. With TRANSLIT, this should never happen!");
155 155
     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     try {
458 458
         $image->readImageBlob($binary);
459 459
     } catch (\ImagickException $exception) {
460
-        echo "Error" . $exception->getMessage();
460
+        echo "Error".$exception->getMessage();
461 461
         return FALSE;
462 462
     }
463 463
     // image survived the sanity check
Please login to merge, or discard this patch.
web/skins/modern/user/js/cat_js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         otherdata = j.otherdata;
88 88
     if(! result) {
89 89
       alert("<?php escaped_echo(_("no matching data found"))?>");
90
-      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
90
+      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
91 91
     }
92 92
     j = j.data;
93 93
     n = j.length;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
        result = j1.status;
225 225
        if(! result) {
226 226
             alert("<?php escaped_echo(_("no matching data found")) ?>");
227
-            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
227
+            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
228 228
        }
229 229
        j = j1.data;
230 230
        if(j.description !== undefined && j.description) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
          $("#profile_desc").hide();
236 236
          $("#profile_desc").text('');
237 237
        }
238
-       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:"));?>'+' '+j.last_changed+'</span><br/>';
238
+       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:")); ?>'+' '+j.last_changed+'</span><br/>';
239 239
        if(j.local_url !== undefined && j.local_url) 
240 240
        txt = txt+'<span class="user_info"><?php escaped_echo(_("WWW:")); ?> <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>';
241 241
        if(j.local_email !== undefined && j.local_email) 
Please login to merge, or discard this patch.