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