Passed
Push — release_2_0 ( 948471...5c9cd7 )
by Stefan
08:48
created
devices/apple_mobileconfig/MobileconfigSuperclass.php 1 patch
Spacing   +48 added lines, -48 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,21 +138,21 @@  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 ($this->attributes['internal:hint_userinput_suffix'][0] != 0) {
145
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username MUST end exactly with '...@%s' !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
145
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username MUST end exactly with '...@%s' !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
146 146
                 \core\common\Entity::outOfThePotatoes();
147 147
                 return $retval;
148 148
             } else { 
149 149
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
150 150
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
151
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username MUST contain an '@' and end with ...%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
151
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username MUST contain an '@' and end with ...%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
152 152
                 \core\common\Entity::outOfThePotatoes();
153 153
                 return $retval;
154 154
             }
155
-            $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;
155
+            $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;
156 156
             \core\common\Entity::outOfThePotatoes();
157 157
             return $retval;
158 158
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         // also escape htmlspecialchars
178 178
         // not all names and profiles have a name, so be prepared
179 179
 
180
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
180
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
181 181
 
182 182
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
183 183
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
         file_put_contents('installer_profile', $outputXml);
221 221
 
222
-        $fileName = $this->installerBasename . '.mobileconfig';
222
+        $fileName = $this->installerBasename.'.mobileconfig';
223 223
 
224 224
         if (!$this->sign) {
225 225
             rename("installer_profile", $fileName);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             return $fileName;
228 228
         }
229 229
         // still here? Then we are signing.
230
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
230
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
231 231
         if ($signing === FALSE) {
232 232
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
233 233
         }
@@ -246,19 +246,19 @@  discard block
 block discarded – undo
246 246
         \core\common\Entity::intoThePotatoes();
247 247
         $ssidCount = count($this->attributes['internal:SSID']);
248 248
         $certCount = count($this->attributes['internal:CAs'][0]);
249
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
249
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
250 250
         $out .= "<p>";
251 251
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
252 252
         $out .= "<ul>";
253
-        $out .= "<li>" . _("to install the profile") . "</li>";
254
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
253
+        $out .= "<li>"._("to install the profile")."</li>";
254
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
255 255
         if ($certCount > 1) {
256
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
256
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
257 257
         }
258 258
         $out .= "</li>";
259
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
259
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
260 260
         if ($ssidCount > 1) {
261
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
261
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
262 262
         }
263 263
         $out .= "</li>";
264 264
         $out .= "</ul>";
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         $retval .= "                <key>RoamingConsortiumOIs</key>
312 312
                 <array>";
313 313
 
314
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
314
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
315 315
 
316 316
         $retval .= "</array>";
317 317
         // this is an undocumented value found on the net. Does it do something useful?
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                   <dict>
353 353
                       <key>AcceptEAPTypes</key>
354 354
                          <array>
355
-                            <integer>" . $eapType['OUTER'] . "</integer>
355
+                            <integer>" . $eapType['OUTER']."</integer>
356 356
                          </array>
357 357
                       <key>EAPFASTProvisionPAC</key>
358 358
                             <true />
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 ";
366 366
         if ($realm !== NULL) {
367 367
             $retval .= "<key>OuterIdentity</key>
368
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
368
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
369 369
 ";
370 370
         }
371 371
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
         $retval .= "
390 390
                          </array>";
391 391
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
392
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
392
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
393 393
         }
394 394
         $retval .= "
395 395
                       <key>TTLSInnerAuthentication</key>
396
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
396
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
397 397
                    </dict>";
398 398
         return $retval;
399 399
     }
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
             // characters are still reversed, invert on use!
414 414
             $buffer .= "<string>Manual</string>
415 415
                   <key>ProxyServer</key>
416
-                  <string>" . strrev($serverAndPort[1]) . "</string>
416
+                  <string>" . strrev($serverAndPort[1])."</string>
417 417
                   <key>ProxyServerPort</key>
418
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
418
+                  <integer>" . strrev($serverAndPort[0])."</integer>
419 419
                   <key>ProxyPACFallbackAllowed</key>
420 420
                   <false/>";
421 421
         } else {
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                     throw new Exception("SSID must be a string!");
445 445
                 }
446 446
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
447
-                $payloadIdentifier = "wifi." . $this->serial;
447
+                $payloadIdentifier = "wifi.".$this->serial;
448 448
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
449 449
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
450 450
                 $encryptionTypeString = "WPA";
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 $payloadIdentifier = "hs20.$toBeConfigured";
475 475
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
476 476
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
477
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
477
+                    $knownOiName = $this->instName." "._("Roaming Partner");
478 478
                 }
479 479
                 $payloadShortName = $knownOiName;
480 480
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                <key>PayloadDisplayName</key>
497 497
                   <string>$payloadShortName</string>
498 498
                <key>PayloadIdentifier</key>
499
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
499
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
500 500
                <key>PayloadOrganization</key>
501
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
501
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
502 502
                <key>PayloadType</key>
503
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
503
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
504 504
         $retval .= $this->proxySettings();
505 505
         $retval .= $setupModesString;
506 506
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
         }
513 513
         $retval .= "
514 514
                <key>PayloadUUID</key>
515
-                  <string>" . \core\common\Entity::uuid() . "</string>
515
+                  <string>" . \core\common\Entity::uuid()."</string>
516 516
                <key>PayloadVersion</key>
517 517
                   <integer>1</integer>
518 518
                   $wifiNetworkIdentification</dict>";
@@ -542,15 +542,15 @@  discard block
 block discarded – undo
542 542
 	<key>IsHotspot</key>
543 543
 	<false/>
544 544
 	<key>PayloadDescription</key>
545
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
545
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
546 546
 	<key>PayloadDisplayName</key>
547
-	<string>" . _("Disabled WiFi network") . "</string>
547
+	<string>" . _("Disabled WiFi network")."</string>
548 548
 	<key>PayloadIdentifier</key>
549
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
549
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
550 550
 	<key>PayloadType</key>
551 551
 	<string>com.apple.wifi.managed</string>
552 552
 	<key>PayloadUUID</key>
553
-	<string>" . \core\common\Entity::uuid() . "</string>
553
+	<string>".\core\common\Entity::uuid()."</string>
554 554
 	<key>PayloadVersion</key>
555 555
 	<real>1</real>";
556 556
         $retval .= $this->proxySettings();
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
         $mimeBlob = base64_encode($binaryBlob);
630 630
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
631 631
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
632
-        $retArray = ["block" => "<dict>" .
632
+        $retArray = ["block" => "<dict>".
633 633
             // we don't include the import password. It's displayed on screen, and should be input by the user.
634 634
             // <key>Password</key>
635 635
             //   <string>" . $this->clientCert['password'] . "</string>
636 636
             "<key>PayloadCertificateFileName</key>
637
-                     <string>" . $this->massagedConsortium . ".pfx</string>
637
+                     <string>" . $this->massagedConsortium.".pfx</string>
638 638
                   <key>PayloadContent</key>
639 639
                      <data>
640 640
 $mimeFormatted
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
                   <key>PayloadDescription</key>
643 643
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
644 644
                   <key>PayloadDisplayName</key>
645
-                     <string>" . _("eduroam user certificate") . "</string>
645
+                     <string>"._("eduroam user certificate")."</string>
646 646
                   <key>PayloadIdentifier</key>
647 647
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
648 648
                   <key>PayloadType</key>
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                   <key>PayloadVersion</key>
653 653
                      <integer>1</integer>
654 654
                 </dict>",
655
-            "UUID" => $payloadUUID,];
655
+            "UUID" => $payloadUUID, ];
656 656
         \core\common\Entity::outOfThePotatoes();
657 657
         return $retArray;
658 658
     }
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         }
672 672
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
673 673
         return "<key>RemovalDate</key>
674
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
674
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
675 675
     }
676 676
 
677 677
     private $CAsAccountedFor = [];
@@ -695,27 +695,27 @@  discard block
 block discarded – undo
695 695
             $stream = "
696 696
             <dict>
697 697
                <key>PayloadCertificateFileName</key>
698
-               <string>" . $ca['uuid'] . ".der</string>
698
+               <string>" . $ca['uuid'].".der</string>
699 699
                <key>PayloadContent</key>
700 700
                <data>
701
-" . $trimmedPem . "</data>
701
+" . $trimmedPem."</data>
702 702
                <key>PayloadDescription</key>
703
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
703
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
704 704
                <key>PayloadDisplayName</key>
705 705
                <string>" . 
706 706
                     /// example: "Identity Provider CA #1 (Root)"
707
-                    sprintf(_("%s CA #%d (%s)" ), 
707
+                    sprintf(_("%s CA #%d (%s)"), 
708 708
                             \core\common\Entity::$nomenclature_inst, 
709
-                            count($this->CAsAccountedFor)+1, 
710
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
709
+                            count($this->CAsAccountedFor) + 1, 
710
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
711 711
               "</string>
712 712
                <key>PayloadIdentifier</key>
713
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
713
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
714 714
                <key>PayloadOrganization</key>
715
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
715
+               <string>".$this->massagedConsortium.".1x-config.org</string>
716 716
                <key>PayloadType</key>
717 717
                <string>com.apple.security.root</string>
718
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
718
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
719 719
                <key>PayloadVersion</key>
720 720
                <integer>1</integer>
721 721
             </dict>";
Please login to merge, or discard this patch.