Passed
Push — release_2_0 ( e3c1e9...2b9a09 )
by Stefan
08:14
created
devices/apple_mobileconfig/MobileconfigSuperclass.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
       <key>PayloadDescription</key>
99 99
          <string>$tagline</string>
100 100
       <key>PayloadDisplayName</key>
101
-         <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</string>
101
+         <string>".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</string>
102 102
       <key>PayloadIdentifier</key>
103
-         <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
103
+         <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
104 104
       <key>PayloadOrganization</key>
105
-         <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>
105
+         <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>
106 106
       <key>PayloadType</key>
107 107
          <string>Configuration</string>
108 108
       <key>PayloadUUID</key>
109
-         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
109
+         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
110 110
       <key>PayloadVersion</key>
111 111
          <integer>1</integer>";
112 112
         \core\common\Entity::outOfThePotatoes();
@@ -138,16 +138,16 @@  discard block
 block discarded – undo
138 138
     {
139 139
         \core\common\Entity::intoThePotatoes();
140 140
         if (isset($this->attributes['support:info_file'])) {
141
-            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;
141
+            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;
142 142
         }
143 143
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
144 144
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
145 145
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
146
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
146
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
147 147
                 \core\common\Entity::outOfThePotatoes();
148 148
                 return $retval;
149 149
             }
150
-            $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;
150
+            $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;
151 151
             \core\common\Entity::outOfThePotatoes();
152 152
             return $retval;
153 153
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         // also escape htmlspecialchars
172 172
         // not all names and profiles have a name, so be prepared
173 173
 
174
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
174
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
175 175
 
176 176
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
177 177
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         file_put_contents('installer_profile', $outputXml);
215 215
 
216
-        $fileName = $this->installerBasename . '.mobileconfig';
216
+        $fileName = $this->installerBasename.'.mobileconfig';
217 217
 
218 218
         if (!$this->sign) {
219 219
             rename("installer_profile", $fileName);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             return $fileName;
222 222
         }
223 223
         // still here? Then we are signing.
224
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
224
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
225 225
         if ($signing === FALSE) {
226 226
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
227 227
         }
@@ -240,19 +240,19 @@  discard block
 block discarded – undo
240 240
         \core\common\Entity::intoThePotatoes();
241 241
         $ssidCount = count($this->attributes['internal:SSID']);
242 242
         $certCount = count($this->attributes['internal:CAs'][0]);
243
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
243
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
244 244
         $out .= "<p>";
245 245
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
246 246
         $out .= "<ul>";
247
-        $out .= "<li>" . _("to install the profile") . "</li>";
248
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
247
+        $out .= "<li>"._("to install the profile")."</li>";
248
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
249 249
         if ($certCount > 1) {
250
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
250
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
251 251
         }
252 252
         $out .= "</li>";
253
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
253
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
254 254
         if ($ssidCount > 1) {
255
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
255
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
256 256
         }
257 257
         $out .= "</li>";
258 258
         $out .= "</ul>";
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $retval .= "                <key>RoamingConsortiumOIs</key>
306 306
                 <array>";
307 307
 
308
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
308
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
309 309
 
310 310
         $retval .= "</array>";
311 311
         // this is an undocumented value found on the net. Does it do something useful?
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                   <dict>
347 347
                       <key>AcceptEAPTypes</key>
348 348
                          <array>
349
-                            <integer>" . $eapType['OUTER'] . "</integer>
349
+                            <integer>" . $eapType['OUTER']."</integer>
350 350
                          </array>
351 351
                       <key>EAPFASTProvisionPAC</key>
352 352
                             <true />
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 ";
360 360
         if ($realm !== NULL) {
361 361
             $retval .= "<key>OuterIdentity</key>
362
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
362
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
363 363
 ";
364 364
         }
365 365
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
         $retval .= "
384 384
                          </array>";
385 385
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
386
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
386
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
387 387
         }
388 388
         $retval .= "
389 389
                       <key>TTLSInnerAuthentication</key>
390
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
390
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
391 391
                    </dict>";
392 392
         return $retval;
393 393
     }
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
             // characters are still reversed, invert on use!
408 408
             $buffer .= "<string>Manual</string>
409 409
                   <key>ProxyServer</key>
410
-                  <string>" . strrev($serverAndPort[1]) . "</string>
410
+                  <string>" . strrev($serverAndPort[1])."</string>
411 411
                   <key>ProxyServerPort</key>
412
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
412
+                  <integer>" . strrev($serverAndPort[0])."</integer>
413 413
                   <key>ProxyPACFallbackAllowed</key>
414 414
                   <false/>";
415 415
         } else {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                     throw new Exception("SSID must be a string!");
439 439
                 }
440 440
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
441
-                $payloadIdentifier = "wifi." . $this->serial;
441
+                $payloadIdentifier = "wifi.".$this->serial;
442 442
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
443 443
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
444 444
                 $encryptionTypeString = "WPA";
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 $payloadIdentifier = "hs20.$toBeConfigured";
469 469
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
470 470
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
471
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
471
+                    $knownOiName = $this->instName." "._("Roaming Partner");
472 472
                 }
473 473
                 $payloadShortName = $knownOiName;
474 474
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
                <key>PayloadDisplayName</key>
491 491
                   <string>$payloadShortName</string>
492 492
                <key>PayloadIdentifier</key>
493
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
493
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
494 494
                <key>PayloadOrganization</key>
495
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
495
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
496 496
                <key>PayloadType</key>
497
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
497
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
498 498
         $retval .= $this->proxySettings();
499 499
         $retval .= $setupModesString;
500 500
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
         }
507 507
         $retval .= "
508 508
                <key>PayloadUUID</key>
509
-                  <string>" . \core\common\Entity::uuid() . "</string>
509
+                  <string>" . \core\common\Entity::uuid()."</string>
510 510
                <key>PayloadVersion</key>
511 511
                   <integer>1</integer>
512 512
                   $wifiNetworkIdentification</dict>";
@@ -536,15 +536,15 @@  discard block
 block discarded – undo
536 536
 	<key>IsHotspot</key>
537 537
 	<false/>
538 538
 	<key>PayloadDescription</key>
539
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
539
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
540 540
 	<key>PayloadDisplayName</key>
541
-	<string>" . _("Disabled WiFi network") . "</string>
541
+	<string>" . _("Disabled WiFi network")."</string>
542 542
 	<key>PayloadIdentifier</key>
543
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
543
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
544 544
 	<key>PayloadType</key>
545 545
 	<string>com.apple.wifi.managed</string>
546 546
 	<key>PayloadUUID</key>
547
-	<string>" . \core\common\Entity::uuid() . "</string>
547
+	<string>".\core\common\Entity::uuid()."</string>
548 548
 	<key>PayloadVersion</key>
549 549
 	<real>1</real>";
550 550
         $retval .= $this->proxySettings();
@@ -623,12 +623,12 @@  discard block
 block discarded – undo
623 623
         $mimeBlob = base64_encode($binaryBlob);
624 624
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
625 625
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
626
-        $retArray = ["block" => "<dict>" .
626
+        $retArray = ["block" => "<dict>".
627 627
             // we don't include the import password. It's displayed on screen, and should be input by the user.
628 628
             // <key>Password</key>
629 629
             //   <string>" . $this->clientCert['password'] . "</string>
630 630
             "<key>PayloadCertificateFileName</key>
631
-                     <string>" . $this->massagedConsortium . ".pfx</string>
631
+                     <string>" . $this->massagedConsortium.".pfx</string>
632 632
                   <key>PayloadContent</key>
633 633
                      <data>
634 634
 $mimeFormatted
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                   <key>PayloadDescription</key>
637 637
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
638 638
                   <key>PayloadDisplayName</key>
639
-                     <string>" . _("eduroam user certificate") . "</string>
639
+                     <string>"._("eduroam user certificate")."</string>
640 640
                   <key>PayloadIdentifier</key>
641 641
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
642 642
                   <key>PayloadType</key>
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                   <key>PayloadVersion</key>
647 647
                      <integer>1</integer>
648 648
                 </dict>",
649
-            "UUID" => $payloadUUID,];
649
+            "UUID" => $payloadUUID, ];
650 650
         \core\common\Entity::outOfThePotatoes();
651 651
         return $retArray;
652 652
     }
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         }
666 666
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
667 667
         return "<key>RemovalDate</key>
668
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
668
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
669 669
     }
670 670
 
671 671
     private $CAsAccountedFor = [];
@@ -689,27 +689,27 @@  discard block
 block discarded – undo
689 689
             $stream = "
690 690
             <dict>
691 691
                <key>PayloadCertificateFileName</key>
692
-               <string>" . $ca['uuid'] . ".der</string>
692
+               <string>" . $ca['uuid'].".der</string>
693 693
                <key>PayloadContent</key>
694 694
                <data>
695
-" . $trimmedPem . "</data>
695
+" . $trimmedPem."</data>
696 696
                <key>PayloadDescription</key>
697
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
697
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
698 698
                <key>PayloadDisplayName</key>
699 699
                <string>" . 
700 700
                     /// example: "Identity Provider CA #1 (Root)"
701
-                    sprintf(_("%s CA #%d (%s)" ), 
701
+                    sprintf(_("%s CA #%d (%s)"), 
702 702
                             \core\common\Entity::$nomenclature_inst, 
703
-                            count($this->CAsAccountedFor)+1, 
704
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
703
+                            count($this->CAsAccountedFor) + 1, 
704
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
705 705
               "</string>
706 706
                <key>PayloadIdentifier</key>
707
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
708 708
                <key>PayloadOrganization</key>
709
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
709
+               <string>".$this->massagedConsortium.".1x-config.org</string>
710 710
                <key>PayloadType</key>
711 711
                <string>com.apple.security.root</string>
712
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
712
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
713 713
                <key>PayloadVersion</key>
714 714
                <integer>1</integer>
715 715
             </dict>";
Please login to merge, or discard this patch.