Passed
Push — release_2_0 ( fb07bb...07486d )
by Stefan
17:09 queued 11s
created
web/admin/edit_idp.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
         </table>
95 95
     </div>
96 96
     <?php
97
-    echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier" . ($wizardStyle ? "&wizard=true" : "") . "' method='post' accept-charset='UTF-8'>
98
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
97
+    echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier".($wizardStyle ? "&wizard=true" : "")."' method='post' accept-charset='UTF-8'>
98
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>";
99 99
 
100 100
     if ($wizardStyle) {
101
-        echo "<p>" .
102
-        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst) . "</p>";
101
+        echo "<p>".
102
+        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst)."</p>";
103 103
     }
104 104
     $optionDisplay = new web\lib\admin\OptionDisplay($idpoptions, "IdP");
105 105
     ?>
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         <legend><strong><?php echo _("General Information"); ?></strong></legend>
108 108
         <?php
109 109
         if ($wizardStyle) {
110
-            echo "<p>" .
111
-            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p>
110
+            echo "<p>".
111
+            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:")."</p>
112 112
                       <ul>
113
-                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li>
114
-                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."),$uiElements->nomenclatureInst) . "</li>";
113
+                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).")."</li>
114
+                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $uiElements->nomenclatureInst)."</li>";
115 115
             echo "</ul>";
116 116
         }
117 117
         echo $optionDisplay->prefilledOptionTable("general");
@@ -125,30 +125,30 @@  discard block
 block discarded – undo
125 125
         <legend><strong><?php echo _("Media Properties"); ?></strong></legend>
126 126
         <?php
127 127
         if ($wizardStyle) {
128
-            echo "<p>" .
129
-            sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p>
128
+            echo "<p>".
129
+            sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p>
130 130
           <ul>";
131 131
             echo "<li>";
132
-            echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>";
132
+            echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:"))." </strong>";
133 133
             if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
134 134
                 $ssidlist = "";
135 135
                 foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssid) {
136
-                    $ssidlist .= ", '<strong>" . $ssid . "</strong>'";
136
+                    $ssidlist .= ", '<strong>".$ssid."</strong>'";
137 137
                 }
138 138
                 $ssidlist = substr($ssidlist, 2);
139 139
                 echo sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])), $ssidlist);
140 140
                 if (CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) {
141
-                    echo " " . _("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
141
+                    echo " "._("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
142 142
                 }
143
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
143
+                echo "<br/>".sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
144 144
             } else {
145 145
                 echo _("Please configure which SSIDs should be configured in the installers.");
146 146
             }
147
-            echo " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
147
+            echo " "._("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
148 148
             echo "</li>";
149 149
 
150 150
             echo "<li>";
151
-            echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>";
151
+            echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:"))." </strong>";
152 152
             if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']) > 0) {
153 153
                 $consortiumlist = "";
154 154
                 foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'] as $displayName => $oi) {
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
                 $consortiumlistFinal = substr($consortiumlist, 2);
158 158
                 echo sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])), $consortiumlistFinal);
159 159
 
160
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
160
+                echo "<br/>".sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
161 161
             } else {
162 162
                 echo _("Please configure which Consortium OIs should be configured in the installers.");
163 163
             }
164 164
             echo "</li>";
165
-            echo "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>"
166
-            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") .
165
+            echo "<li><strong>"._("Support for wired IEEE 802.1X:")." </strong>"
166
+            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).").
167 167
             "</li>";
168
-            echo "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>"
168
+            echo "<li><strong>"._("Removal of bootstrap/onboarding SSIDs:")." </strong>"
169 169
             . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.")
170 170
             . "</li>";
171 171
             echo "</ul>";
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
             echo "<p>"._("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.")."</p>";
182 182
             
183 183
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
184
-                echo "<p>" .
184
+                echo "<p>".
185 185
                         
186
-                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."),$uiElements->nomenclatureInst)  . "</p>" .
187
-                "<p>" .
188
-                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>";
186
+                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $uiElements->nomenclatureInst)."</p>".
187
+                "<p>".
188
+                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.")."</p>";
189 189
                 if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
190
-                echo "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME) ." " . _("This is the contact point for your end users' level 1 support.") . "</p>";
190
+                echo "<p>".sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME)." "._("This is the contact point for your end users' level 1 support.")."</p>";
191 191
                 }
192 192
             } elseif (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
193
-                echo "<p>". _("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
193
+                echo "<p>"._("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
194 194
             }
195 195
             
196 196
         }
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         <button type='button' class='newoption' onclick='getXML("support")'><?php echo _("Add new option"); ?></button></fieldset>
201 201
     <?php
202 202
     if ($wizardStyle) {
203
-        echo "<p>" . sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CONTINUE . "'>", "</button>") . "</p></form>";
203
+        echo "<p>".sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CONTINUE."'>", "</button>")."</p></form>";
204 204
     } else {
205
-        echo "<div><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></div></form>";
205
+        echo "<div><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></div></form>";
206 206
     }
207 207
     echo $deco->footer();
Please login to merge, or discard this patch.
devices/ms/Device_W8_10.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             foreach ($this->attributes['internal:consortia'] as $oneCons) {
97 97
                 $knownOiName = array_search($oneCons, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
98 98
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
99
-                    $knownOiName = $this->attributes['general:instname'][0] . " "._("Roaming Partner") . " $roamingPartner";
99
+                    $knownOiName = $this->attributes['general:instname'][0]." "._("Roaming Partner")." $roamingPartner";
100 100
                     $roamingPartner++;
101 101
                 }
102 102
                 $ssid = 'cat-passpoint-profile';
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
         if (empty($this->attributes['internal:realm'][0])) {
149 149
             $retval .= CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-domainname-fallback'];
150 150
         } else {
151
-            $retval .=  $this->attributes['internal:realm'][0];
151
+            $retval .= $this->attributes['internal:realm'][0];
152 152
         }
153 153
         $retval .= '</DomainName>';
154
-        $retval .= '<RoamingConsortium><OUI>' . $oi .
154
+        $retval .= '<RoamingConsortium><OUI>'.$oi.
155 155
             '</OUI></RoamingConsortium>';
156
-        $retval .=  '</Hotspot2>';
156
+        $retval .= '</Hotspot2>';
157 157
         return($retval);
158 158
     }
159 159
     
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
         $profileFileCont = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
163 163
 <EapMethod>
164 164
 ';
165
-        $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">' .
166
-                $this->selectedEap["OUTER"] . '</Type>
165
+        $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'.
166
+                $this->selectedEap["OUTER"].'</Type>
167 167
 <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
168 168
 <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
169
-<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId . '</AuthorId>
169
+<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId.'</AuthorId>
170 170
 </EapMethod>
171 171
 ';
172 172
         return($profileFileCont);
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 <eapTls:ServerValidation>
178 178
 <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation>
179 179
 ';
180
-        $profileFileCont .= '<eapTls:ServerNames>' . $this->servers . '</eapTls:ServerNames>';
180
+        $profileFileCont .= '<eapTls:ServerNames>'.$this->servers.'</eapTls:ServerNames>';
181 181
         foreach ($this->caArray as $certAuthority) {
182 182
             if ($certAuthority['root']) {
183
-                $profileFileCont .= "<eapTls:TrustedRootCA>" . $certAuthority['sha1'] . "</eapTls:TrustedRootCA>\n";
183
+                $profileFileCont .= "<eapTls:TrustedRootCA>".$certAuthority['sha1']."</eapTls:TrustedRootCA>\n";
184 184
             }
185 185
         }
186 186
         $profileFileCont .= '</eapTls:ServerValidation>
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
         $profileFileCont = '
193 193
         <ServerValidation>
194 194
 ';
195
-        $profileFileCont .= '<ServerNames>' . $this->servers . '</ServerNames> ';
195
+        $profileFileCont .= '<ServerNames>'.$this->servers.'</ServerNames> ';
196 196
         foreach ($this->caArray as $certAuthority) {
197 197
             if ($certAuthority['root']) {
198
-                $profileFileCont .= "<TrustedRootCAHash>" . chunk_split($certAuthority['sha1'], 2, ' ') . "</TrustedRootCAHash>\n";
198
+                $profileFileCont .= "<TrustedRootCAHash>".chunk_split($certAuthority['sha1'], 2, ' ')."</TrustedRootCAHash>\n";
199 199
             }
200 200
         }
201 201
         $profileFileCont .= '<DisablePrompt>true</DisablePrompt>
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
         $profileFileCont = '
228 228
         <ServerValidation>
229 229
 <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation>
230
-<ServerNames>' . $this->servers . '</ServerNames>';
230
+<ServerNames>' . $this->servers.'</ServerNames>';
231 231
         foreach ($this->caArray as $certAuthority) {
232 232
             if ($certAuthority['root']) {
233
-                $profileFileCont .= "<TrustedRootCA>" . $certAuthority['sha1'] . "</TrustedRootCA>\n";
233
+                $profileFileCont .= "<TrustedRootCA>".$certAuthority['sha1']."</TrustedRootCA>\n";
234 234
             }
235 235
         }
236 236
         $profileFileCont .= '</ServerValidation>
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         if ($this->useAnon) {
287 287
             $profileFileCont .= '<IdentityPrivacy>true</IdentityPrivacy>
288 288
 ';
289
-            $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity>
289
+            $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity>
290 290
                 ';
291 291
         } else {
292 292
             $profileFileCont .= '<IdentityPrivacy>false</IdentityPrivacy>
@@ -303,10 +303,10 @@  discard block
 block discarded – undo
303 303
         $profileFileCont = '
304 304
 <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
305 305
 <EAPIdentityProviderList xmlns="urn:ietf:params:xml:ns:yang:ietf-eap-metadata">
306
-<EAPIdentityProvider ID="' . $this->deviceUUID . '" namespace="urn:UUID">
306
+<EAPIdentityProvider ID="' . $this->deviceUUID.'" namespace="urn:UUID">
307 307
 
308 308
 <ProviderInfo>
309
-<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage) . '</DisplayName>
309
+<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage).'</DisplayName>
310 310
 </ProviderInfo>
311 311
 <AuthenticationMethods>
312 312
 <AuthenticationMethod>
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
             if ($this->outerUser == '') {
319 319
                 $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>';
320 320
             } else {
321
-                $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity>';
321
+                $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity>';
322 322
             }
323 323
         }
324 324
         $profileFileCont .= '</ClientSideCredential>
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         $profileFileCont .= $this->glTtlsServerValidation();
327 327
         $profileFileCont .= '
328 328
 <InnerAuthenticationMethod>
329
-<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'] . '</NonEAPAuthMethod>
329
+<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'].'</NonEAPAuthMethod>
330 330
 </InnerAuthenticationMethod>
331 331
 <VendorSpecific>
332 332
 <SessionResumption>false</SessionResumption>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 <UseWinLogonCredentials>false</UseWinLogonCredentials>
358 358
 </EapType>
359 359
 </Eap>
360
-<EnableQuarantineChecks>' . $nea . '</EnableQuarantineChecks>
360
+<EnableQuarantineChecks>' . $nea.'</EnableQuarantineChecks>
361 361
 <RequireCryptoBinding>false</RequireCryptoBinding>
362 362
 ';
363 363
         if ($this->useAnon) {
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                 $profileFileCont .= '<AnonymousUserName/>
370 370
 ';
371 371
             } else {
372
-                $profileFileCont .= '<AnonymousUserName>' . $this->outerUser . '</AnonymousUserName>
372
+                $profileFileCont .= '<AnonymousUserName>'.$this->outerUser.'</AnonymousUserName>
373 373
                 ';
374 374
             }
375 375
             $profileFileCont .= '</IdentityPrivacy>
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     private function prepareEapConfig() {
400 400
         if ($this->useAnon) {
401 401
             $this->outerUser = $this->attributes['internal:anon_local_value'][0];
402
-            $this->outerId = $this->outerUser . '@' . $this->attributes['internal:realm'][0];
402
+            $this->outerId = $this->outerUser.'@'.$this->attributes['internal:realm'][0];
403 403
         }
404 404
 
405 405
         $profileFileCont = $this->eapConfigHeader();
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
             default:
425 425
                 break;
426 426
         }
427
-        return(['win' => $profileFileCont . '</EapHostConfig></EAPConfig>']);
427
+        return(['win' => $profileFileCont.'</EapHostConfig></EAPConfig>']);
428 428
     }
429 429
 
430 430
     /**
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
     private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber, $oi = '') {
443 443
         $profileFileCont = '<?xml version="1.0"?>
444 444
 <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
445
-<name>' . $wlanProfileName . '</name>
445
+<name>' . $wlanProfileName.'</name>
446 446
 <SSIDConfig>
447 447
 <SSID>
448
-<name>' . $ssid . '</name>
448
+<name>' . $ssid.'</name>
449 449
 </SSID>
450 450
 <nonBroadcast>true</nonBroadcast>
451 451
 </SSIDConfig>';
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
 <MSM>
458 458
 <security>
459 459
 <authEncryption>
460
-<authentication>' . $auth . '</authentication>
461
-<encryption>' . $encryption . '</encryption>
460
+<authentication>' . $auth.'</authentication>
461
+<encryption>' . $encryption.'</encryption>
462 462
 <useOneX>true</useOneX>
463 463
 </authEncryption>
464 464
 ';
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
             mkdir('w8');
486 486
         }
487 487
         $xmlFname = "w8/wlan_prof-$profileNumber.xml";
488
-        file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing);
488
+        file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing);
489 489
         $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n");
490 490
         $hs20 = $oi == '' ? 0 : 1;
491 491
         return("\"$wlanProfileName\" \"$encryption\" $hs20");
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
             mkdir('w8');
514 514
         }
515 515
         $xmlFname = "w8/lan_prof.xml";
516
-        file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing);
516
+        file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing);
517 517
         $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n");
518 518
     }
519 519
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         }
535 535
         foreach ($caArray as $certAuthority) {
536 536
             $store = $certAuthority['root'] ? "root" : "ca";
537
-            $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
537
+            $fcontentsCerts .= '!insertmacro install_ca_cert "'.$certAuthority['file'].'" "'.$certAuthority['sha1'].'" "'.$store."\"\n";
538 538
         }
539 539
         fwrite($fileHandleCerts, $fcontentsCerts);
540 540
         fclose($fileHandleCerts);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     private function writeMainNSH($eap, $attr) {
544 544
         $this->loggerInstance->debug(4, "writeMainNSH");
545 545
         $this->loggerInstance->debug(4, $attr);
546
-        $this->loggerInstance->debug(4, "Device_id = " . $this->device_id . "\n");
546
+        $this->loggerInstance->debug(4, "Device_id = ".$this->device_id."\n");
547 547
         $fcontents = "!define W8\n";
548 548
         if ($this->device_id == 'w10') {
549 549
             $fcontents .= "!define W10\n";
@@ -573,8 +573,8 @@  discard block
 block discarded – undo
573 573
         if ($eap == \core\common\EAP::EAPTYPE_SILVERBULLET) {
574 574
             $fcontents .= "!define SILVERBULLET\n";
575 575
         }
576
-        $fcontents .= '!define ' . $eapStr;
577
-        $fcontents .= "\n" . '!define EXECLEVEL "' . $execLevel . '"';
576
+        $fcontents .= '!define '.$eapStr;
577
+        $fcontents .= "\n".'!define EXECLEVEL "'.$execLevel.'"';
578 578
         $fcontents .= $this->writeNsisDefines($attr);
579 579
         file_put_contents('main.nsh', $fcontents);
580 580
     }
Please login to merge, or discard this patch.
core/SanityTests.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 use GeoIp2\Database\Reader;
50 50
 use \Exception;
51 51
 
52
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
53
-require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php";
54
-require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php";
52
+require_once dirname(dirname(__FILE__))."/config/_config.php";
53
+require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php";
54
+require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php";
55 55
 
56 56
 class SanityTests extends CAT
57 57
 {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $this->test_result = [];
94 94
         $this->test_result['global'] = 0;
95 95
         // parse the schema file to find out the number of expected rows...
96
-        $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql");
96
+        $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql");
97 97
         $this->profile_option_ct = 0;
98 98
         $passedTheWindmill = FALSE;
99 99
         foreach ($schema as $schemaLine) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $this->out[$test] = [];
122 122
         $this->name = $test;
123
-        $m_name = $test . '_test';
123
+        $m_name = $test.'_test';
124 124
         $this->test_result[$test] = 0;
125 125
         if (!method_exists($this, $m_name)) {
126 126
             $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>.");
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
     private function php_test()
230 230
     {
231 231
         if (version_compare(phpversion(), $this->php_needversion, '>=')) {
232
-            $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . ".");
232
+            $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion().".");
233 233
         } else {
234
-            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have " . phpversion() . ".");
234
+            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have ".phpversion().".");
235 235
         }
236 236
     }
237 237
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly");
249 249
         } else {
250 250
             $rootFromScript = $m[1] === '' ? '/' : $m[1];
251
-            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>");
251
+            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>");
252 252
         }
253 253
     }
254 254
 
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
             $SSPconfig = \SimpleSAML\Configuration::getInstance();
267 267
             $sspVersion = explode('.', $SSPconfig->getVersion());
268 268
             if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) {
269
-                $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion));
269
+                $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion));
270 270
             } else {
271
-                $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion));
271
+                $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion));
272 272
             }
273 273
         }
274 274
     }
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
      */
330 330
     private function logdir_test()
331 331
     {
332
-        if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) {
333
-            $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!");
332
+        if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) {
333
+            $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!");
334 334
         } else {
335 335
             $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable.");
336 336
         }
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
         } else {
368 368
             $classname = 'Imagick';
369 369
         }
370
-        if (class_exists('\\' . $classname)) {
370
+        if (class_exists('\\'.$classname)) {
371 371
             $this->testReturn(\core\common\Entity::L_OK, "PHP extension <strong>$classname</strong> is installed.");
372 372
         } else {
373
-            $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/" . strtolower($classname) . "'>here</a>.");
373
+            $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/".strtolower($classname)."'>here</a>.");
374 374
         }
375 375
 
376 376
         if (function_exists('ImageCreate')) {
@@ -468,15 +468,15 @@  discard block
 block discarded – undo
468 468
         }
469 469
         $output = [];
470 470
         $retval = -100;
471
-        $t = exec($A['exec'] . ' version', $output, $retval);
471
+        $t = exec($A['exec'].' version', $output, $retval);
472 472
         if ($retval != 0 || count($output) != 1) {
473 473
             $this->testReturn(\core\common\Entity::L_ERROR, "<strong>openssl</strong> was not found on your system despite being configured!");
474 474
             return;
475 475
         }
476 476
         if ($A['exec_is'] == "EXPLICIT") {
477
-            $this->testReturn(\core\common\Entity::L_OK, "<strong>" . $output[0] . "</strong> was found and is configured explicitly in your config.");
477
+            $this->testReturn(\core\common\Entity::L_OK, "<strong>".$output[0]."</strong> was found and is configured explicitly in your config.");
478 478
         } else {
479
-            $this->testReturn(\core\common\Entity::L_WARN, "<strong>" . $output[0] . "</strong> was found, but is not configured with an absolute path in your config.");
479
+            $this->testReturn(\core\common\Entity::L_WARN, "<strong>".$output[0]."</strong> was found, but is not configured with an absolute path in your config.");
480 480
         }
481 481
     }
482 482
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         }
503 503
         $output = [];
504 504
         $retval = -100;
505
-        $t = exec($A['exec'] . ' -VERSION', $output, $retval);
505
+        $t = exec($A['exec'].' -VERSION', $output, $retval);
506 506
         if ($retval != 0 || count($output) != 1) {
507 507
             $this->testReturn(\core\common\Entity::L_ERROR, "<strong>makensis</strong> was not found on your system despite being configured!");
508 508
             return;
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
             $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config.");
514 514
         }
515 515
         $outputArray = [];
516
-        exec($A['exec'] . ' -HELP', $outputArray);
516
+        exec($A['exec'].' -HELP', $outputArray);
517 517
         $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray));
518 518
         if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) {
519 519
             $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!");
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         $NSIS_Module_status = [];
541 541
         foreach ($this->NSIS_Modules as $module) {
542 542
             unset($out);
543
-            exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
543
+            exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
544 544
             if ($retval > 0) {
545 545
                 $NSIS_Module_status[$module] = 0;
546 546
             } else {
@@ -605,8 +605,8 @@  discard block
 block discarded – undo
605 605
         $locales = shell_exec("locale -a");
606 606
         $allthere = "";
607 607
         foreach (CONFIG['LANGUAGES'] as $onelanguage) {
608
-            if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) {
609
-                $allthere .= $onelanguage['locale'] . " ";
608
+            if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) {
609
+                $allthere .= $onelanguage['locale']." ";
610 610
             }
611 611
         }
612 612
         if ($allthere == "") {
@@ -620,47 +620,47 @@  discard block
 block discarded – undo
620 620
         ["SETTING" => CONFIG['APPEARANCE']['from-mail'],
621 621
             "DEFVALUE" => "[email protected]",
622 622
             "COMPLAINTSTRING" => "APPEARANCE/from-mail ",
623
-            "REQUIRED" => FALSE,],
623
+            "REQUIRED" => FALSE, ],
624 624
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'],
625 625
             "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!",
626 626
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ",
627
-            "REQUIRED" => FALSE,],
627
+            "REQUIRED" => FALSE, ],
628 628
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'],
629 629
             "DEFVALUE" => "[email protected]",
630 630
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ",
631
-            "REQUIRED" => FALSE,],
631
+            "REQUIRED" => FALSE, ],
632 632
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'],
633 633
             "DEFVALUE" => "[email protected]",
634 634
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ",
635
-            "REQUIRED" => FALSE,],
635
+            "REQUIRED" => FALSE, ],
636 636
         ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'],
637 637
             "DEFVALUE" => "[email protected]",
638 638
             "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ",
639
-            "REQUIRED" => FALSE,],
639
+            "REQUIRED" => FALSE, ],
640 640
         ["SETTING" => CONFIG['APPEARANCE']['MOTD'],
641 641
             "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!",
642 642
             "COMPLAINTSTRING" => "APPEARANCE/MOTD ",
643
-            "REQUIRED" => FALSE,],
643
+            "REQUIRED" => FALSE, ],
644 644
         ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'],
645 645
             "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'],
646 646
             "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ",
647
-            "REQUIRED" => TRUE,],
647
+            "REQUIRED" => TRUE, ],
648 648
         ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'],
649 649
             "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'],
650 650
             "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ",
651
-            "REQUIRED" => TRUE,],
651
+            "REQUIRED" => TRUE, ],
652 652
         ["SETTING" => CONFIG['DB']['INST']['host'],
653 653
             "DEFVALUE" => "db.host.example",
654 654
             "COMPLAINTSTRING" => "DB/INST ",
655
-            "REQUIRED" => TRUE,],
655
+            "REQUIRED" => TRUE, ],
656 656
         ["SETTING" => CONFIG['DB']['INST']['host'],
657 657
             "DEFVALUE" => "db.host.example",
658 658
             "COMPLAINTSTRING" => "DB/USER ",
659
-            "REQUIRED" => TRUE,],
659
+            "REQUIRED" => TRUE, ],
660 660
         ["SETTING" => CONFIG['DB']['EXTERNAL']['host'],
661 661
             "DEFVALUE" => "customerdb.otherhost.example",
662 662
             "COMPLAINTSTRING" => "DB/EXTERNAL ",
663
-            "REQUIRED" => FALSE,],
663
+            "REQUIRED" => FALSE, ],
664 664
     ];
665 665
 
666 666
     /**
@@ -688,11 +688,11 @@  discard block
 block discarded – undo
688 688
         if (isset(CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'])) {
689 689
             foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) {
690 690
                 foreach ($cadata['certificates'] as $cert_files) {
691
-                    if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) {
692
-                        $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " ";
691
+                    if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) {
692
+                        $defaultvalues .= "CERTIFICATE/".$cert_files['public']." ";
693 693
                     }
694
-                    if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) {
695
-                        $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " ";
694
+                    if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) {
695
+                        $defaultvalues .= "CERTIFICATE/".$cert_files['private']." ";
696 696
                     }
697 697
                 }
698 698
             }
@@ -785,14 +785,14 @@  discard block
 block discarded – undo
785 785
         if ($global_no_cache) {
786 786
             foreach ($Devs as $dev => $D) {
787 787
                 if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) {
788
-                    $no_cache_dev .= $dev . " ";
788
+                    $no_cache_dev .= $dev." ";
789 789
                     $no_cache_dev_count++;
790 790
                 }
791 791
             }
792 792
         } else {
793 793
             foreach ($Devs as $dev => $D) {
794 794
                 if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) {
795
-                    $no_cache_dev .= $dev . " ";
795
+                    $no_cache_dev .= $dev." ";
796 796
                     $no_cache_dev_count++;
797 797
                 }
798 798
             }
@@ -831,13 +831,13 @@  discard block
 block discarded – undo
831 831
         $mail->isHTML(FALSE);
832 832
         $mail->CharSet = 'UTF-8';
833 833
         $mail->From = CONFIG['APPEARANCE']['from-mail'];
834
-        $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System";
834
+        $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System";
835 835
         $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']);
836 836
         $mail->Subject = "testing CAT configuration mail";
837 837
         $mail->Body = "Testing CAT mailing\n";
838 838
         $sent = $mail->send();
839 839
         if ($sent) {
840
-            $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced.");
840
+            $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced.");
841 841
         } else {
842 842
             $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS");
843 843
         }
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
     /**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         for ($i = count($trace); $i--; $i > 0) {
259 259
             if (isset($trace[$i - 1]['class']) && preg_match('/Entity/', $trace[$i - 1]['class'])) {
260 260
                 if ($showTrace) {
261
-                    echo "FOUND caller: ".print_r($trace[$i],true). " - class is ".$trace[$i]['class'];
261
+                    echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class'];
262 262
                 }
263 263
                 $caller = $trace[$i];
264 264
                 break;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT));
270 270
         if ($showTrace === TRUE) {   
271 271
             echo "<pre>".print_r($trace, true)."</pre>";
272
-            echo "CLASS = " . $myName ."<br/>";
272
+            echo "CLASS = ".$myName."<br/>";
273 273
         }
274 274
         if (preg_match("/diag/", $myName) == 1) {
275 275
             $ret = "diagnostics";
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
         if ($catalogue === NULL) {
303 303
             $theCatalogue = Entity::determineOwnCatalogue($trace);
304 304
             textdomain($theCatalogue);
305
-            bindtextdomain($theCatalogue, ROOT . "/translation/");
305
+            bindtextdomain($theCatalogue, ROOT."/translation/");
306 306
         } else {
307 307
             textdomain($catalogue);
308
-            bindtextdomain($catalogue, ROOT . "/translation/");
308
+            bindtextdomain($catalogue, ROOT."/translation/");
309 309
         }
310 310
     }
311 311
 
Please login to merge, or discard this patch.
core/CertificationAuthorityEduPkiServer.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 class CertificationAuthorityEduPkiServer extends EntityWithDBProperties implements CertificationAuthorityInterface
18 18
 {
19 19
 
20
-    private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
21
-    private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
22
-    private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
20
+    private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem";
21
+    private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
22
+    private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
23 23
     private const EDUPKI_RA_ID = 700;
24 24
     private const EDUPKI_CERT_PROFILE = "Radius Server SOAP";
25 25
     private const EDUPKI_RA_PKEY_PASSPHRASE = "...";
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
         parent::__construct();
36 36
 
37 37
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) {
38
-            throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
38
+            throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
39 39
         }
40 40
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) {
41
-            throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
41
+            throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
42 42
         }
43 43
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) {
44
-            throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
44
+            throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
45 45
         }
46 46
     }
47 47
 
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
92 92
         try {
93 93
             $altArray = [# Array mit den Subject Alternative Names
94
-                "email:" . $csr["USERMAIL"]
94
+                "email:".$csr["USERMAIL"]
95 95
             ];
96 96
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
97 97
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
98
-            $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n");
99
-            $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n");
98
+            $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n");
99
+            $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n");
100 100
             $this->loggerInstance->debug(5, "PARAM_3: ");
101 101
             $this->loggerInstance->debug(5, $altArray);
102
-            $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n");
103
-            $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n");
104
-            $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n");
105
-            $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n");
106
-            $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n");
102
+            $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n");
103
+            $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n");
104
+            $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n");
105
+            $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n");
106
+            $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n");
107 107
             $this->loggerInstance->debug(5, "PARAM_9: false\n");
108 108
             $soapNewRequest = $soapPub->newRequest(
109 109
                     CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
         } catch (Exception $e) {
126 126
             // PHP 7.1 can do this much better
127 127
             if (is_soap_fault($e)) {
128
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}:  {
128
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}:  {
129 129
                     $e->faultstring
130 130
                 }\n");
131 131
             }
132
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
132
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
133 133
         }
134 134
         try {
135 135
             $soap = $this->initEduPKISoapSession("RA");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
164 164
             // rather than just using the string. Grr.
165 165
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
166
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext);
166
+            file_put_contents($tempdir['dir']."/content.txt", $soapCleartext);
167 167
             // retrieve our RA cert from filesystem                    
168 168
             // the RA certificates are not needed right now because we
169 169
             // have resorted to S/MIME signatures with openssl command-line
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
176 176
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
177 177
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n  $soapCleartext\n");
178
-            $execCmd = CONFIG['PATHS']['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
178
+            $execCmd = CONFIG['PATHS']['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem";
179 179
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline:   $execCmd\n");
180 180
             $output = [];
181 181
             $return = 999;
@@ -184,21 +184,21 @@  discard block
 block discarded – undo
184 184
                 throw new Exception("Non-zero return value from openssl smime!");
185 185
             }
186 186
             // and get the signature blob back from the filesystem
187
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
187
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
188 188
             $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n");
189
-            $this->loggerInstance->debug(5, $soapReqnum . "\n");
190
-            $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending!
191
-            $this->loggerInstance->debug(5, $detachedSig . "\n");
189
+            $this->loggerInstance->debug(5, $soapReqnum."\n");
190
+            $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending!
191
+            $this->loggerInstance->debug(5, $detachedSig."\n");
192 192
             $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig);
193
-            $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest());
194
-            $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse());
193
+            $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest());
194
+            $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse());
195 195
             if ($soapIssueCert === FALSE) {
196 196
                 throw new Exception("The locally approved request was NOT processed by the CA.");
197 197
             }
198 198
         } catch (SoapFault $e) {
199
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
199
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
200 200
         } catch (Exception $e) {
201
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
201
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
202 202
         }
203 203
         return $soapReqnum;
204 204
     }
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
                 throw new Exception("CAInfo has no root certificate for us!");
249 249
             }
250 250
         } catch (SoapFault $e) {
251
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
251
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
252 252
         } catch (Exception $e) {
253
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
253
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
254 254
         }
255 255
         return [
256 256
             "CERT" => openssl_x509_read($parsedCert['pem']),
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
284 284
             // rather than just using the string. Grr.
285 285
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
286
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest);
286
+            file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest);
287 287
             // retrieve our RA cert from filesystem
288 288
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
289 289
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
290 290
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n");
291
-            $execCmd = CONFIG['PATHS']['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT;
291
+            $execCmd = CONFIG['PATHS']['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT;
292 292
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n");
293 293
             $output = [];
294 294
             $return = 999;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                 throw new Exception("Non-zero return value from openssl smime!");
298 298
             }
299 299
             // and get the signature blob back from the filesystem
300
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
300
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
301 301
             $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig);
302 302
             if ($soapIssueRev === FALSE) {
303 303
                 throw new Exception("The locally approved revocation request was NOT processed by the CA.");
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
         } catch (Exception $e) {
306 306
             // PHP 7.1 can do this much better
307 307
             if (is_soap_fault($e)) {
308
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n");
308
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n");
309 309
             }
310
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
310
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
311 311
         }
312 312
     }
313 313
 
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
      */
408 408
     public function soapToXmlInteger($x)
409 409
     {
410
-        return '<' . $x[0] . '>'
410
+        return '<'.$x[0].'>'
411 411
                 . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1)
412
-                . '</' . $x[0] . '>';
412
+                . '</'.$x[0].'>';
413 413
     }
414 414
 
415 415
     /**
@@ -428,9 +428,9 @@  discard block
 block discarded – undo
428 428
         // dump private key into directory
429 429
         $outstring = "";
430 430
         openssl_pkey_export($privateKey, $outstring);
431
-        file_put_contents($tempdir . "/pkey.pem", $outstring);
431
+        file_put_contents($tempdir."/pkey.pem", $outstring);
432 432
         // PHP can only do one DC in the Subject. But we need three.
433
-        $execCmd = CONFIG['PATHS']['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username";
433
+        $execCmd = CONFIG['PATHS']['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username";
434 434
         $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n");
435 435
         $output = [];
436 436
         $return = 999;
Please login to merge, or discard this patch.
web/admin/overview_certificates.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert
82 82
             $status = $oneCert['STATUS'];
83 83
             if ($status == "ISSUED") {
84
-                $status = "<span onclick='alert(\"".str_replace("\n","\\n",$oneCert['CERT'])."\");'>$status</span>";
84
+                $status = "<span onclick='alert(\"".str_replace("\n", "\\n", $oneCert['CERT'])."\");'>$status</span>";
85 85
             }
86 86
             echo "<tr><td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td></tr>";
87 87
         }
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     // also send user back to the overview page
73 73
     if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
74 74
         // basic sanity checks before we hand this over to openssl
75
-        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "" , TRUE);
75
+        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE);
76 76
         if (openssl_csr_get_public_key($sanitisedCsr) === FALSE) {
77 77
             throw new Exception("Sorry: Unable to parse the submitted public key - no public key inside?");
78 78
         }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 $fed = $validator->Federation($_POST['NRO-list']);
87 87
                 $country = strtoupper($fed->tld);
88 88
                 $DN[] = "C=$country";
89
-                $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)];
89
+                $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)];
90 90
                 $DN[] = "CN=comes.from.eduroam.db";
91 91
                 $policies[] = "eduroam IdP";
92 92
                 $policies[] = "eduroam SP";
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
             default:
105 105
                 throw new Exception("Sorry: Unknown level of issuance requested.");
106 106
         }
107
-        echo "<p>" . _("Requesting a certificate with the following properties");
107
+        echo "<p>"._("Requesting a certificate with the following properties");
108 108
         echo "<ul>";
109
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
110
-        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>";
111
-        echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').") . "</li>";
109
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
110
+        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>";
111
+        echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').")."</li>";
112 112
         echo "</ul></p>";
113 113
         /* $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes);
114 114
         if (is_resource($ossl)) {
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
             throw new Exception("Calling openssl in a fancy way did not work.");
122 122
         }
123 123
         echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */
124
-        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country];
124
+        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country];
125 125
         // our certs can be good for max 5 years
126 126
         $fed->requestCertificate($newCsrWithMeta, 1825);
127 127
         echo "<p>"._("The certificate was requested.")."</p>";
128 128
         ?>
129 129
         <form action="overview_certificates.php" method="GET">
130
-            <button type="submit"><?php echo _("Back to Certificate Overview");?></button>
130
+            <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
131 131
         </form>
132 132
     <?php
133 133
     echo $deco->footer();
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 
137 137
     // if we did not get a SAVE button, display UI for a fresh request instead
138 138
     ?>
139
-    <h2><?php echo _("1. Certificate Holder Details");?></h2>
139
+    <h2><?php echo _("1. Certificate Holder Details"); ?></h2>
140 140
     <form action="action_req_certificate.php" method="POST">
141 141
         <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input>
142 142
         <?php
143 143
         if (count($feds) == 1) {
144 144
             $fedObject = new \core\Federation($feds[0]['value']);
145
-            echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>";
146
-            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>';
145
+            echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>";
146
+            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>';
147 147
         } else {
148 148
             ?>
149 149
             <select name="NRO-list" id="NRO-list">
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 <?php
152 152
                 foreach ($feds as $oneFed) {
153 153
                     $fedObject = new \core\Federation($oneFed['value']);
154
-                    echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>";
154
+                    echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>";
155 155
                 }
156 156
                 ?>
157 157
             </select>
@@ -171,15 +171,15 @@  discard block
 block discarded – undo
171 171
                 }
172 172
             }
173 173
             foreach ($allIdPs as $id => $name) {
174
-                echo '<option value="' . $id . '">' . $name . "</option>";
174
+                echo '<option value="'.$id.'">'.$name."</option>";
175 175
             }
176 176
             ?>
177 177
         </select>
178 178
         <br/>
179
-        <h2><?php echo _("2. CSR generation");?></h2>
180
-        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p>
179
+        <h2><?php echo _("2. CSR generation"); ?></h2>
180
+        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
181 181
         <p>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /DC=test/DC=test/DC=eduroam/C=XY/O=WillBeReplaced/CN=will.be.replaced</p>
182
-        <h2><?php echo _("3. Submission");?></h2>
182
+        <h2><?php echo _("3. Submission"); ?></h2>
183 183
         <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/>
184 184
     <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button>
185 185
 </form>
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
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function listProfiles(bool $activeOnly = FALSE)
116 116
     {
117
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
117
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
118 118
         $allProfiles = $this->databaseHandle->exec($query);
119 119
         $returnarray = [];
120 120
         // SELECT -> resource, not boolean
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $returnarray[] = $oneProfile;
125 125
         }
126 126
 
127
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
127
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
128 128
         return $returnarray;
129 129
     }
130 130
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
230 230
                     $theProfile = new ProfileSilverbullet($identifier, $this);
231 231
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
232
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
232
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
233 233
                     return $theProfile;
234 234
                 default:
235 235
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     public function getExternalDBId()
351 351
     {
352 352
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
353
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
353
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
354 354
             // SELECT -> it's a resource, not a boolean
355 355
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
356 356
                 return FALSE;
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $profile = $validator->Profile($_GET['profile_id'], $my_inst->identifier);
57 57
         } else {
58 58
             $profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
59
-            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $my_inst->identifier . " - Profile created");
59
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$my_inst->identifier." - Profile created");
60 60
         }
61 61
 
62 62
         if (!$profile instanceof \core\ProfileRADIUS) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $uiElements = new web\lib\admin\UIElements();
119 119
             // set realm info, if submitted
120 120
             if ($realm !== FALSE) {
121
-                $profile->setRealm($anonLocal . "@" . $realm);
121
+                $profile->setRealm($anonLocal."@".$realm);
122 122
                 echo $uiElements->boxOkay(sprintf(_("Realm: <strong>%s</strong>"), $realm));
123 123
             } else {
124 124
                 $profile->setRealm("");
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!"));
142 142
                 } else {
143 143
                     $profile->setRealmcheckUser(true, $checkuser_name);
144
-                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm));
144
+                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm));
145 145
                 }
146 146
             } else {
147 147
                 $profile->setRealmCheckUser(false);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 } else {
155 155
                     $profile->setInputVerificationPreference($verify, $hint);
156 156
                     if ($hint !== FALSE) {
157
-                        $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
157
+                        $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
158 158
                     } else {
159 159
                         $extratext = ".";
160 160
                     }
@@ -191,29 +191,29 @@  discard block
 block discarded – undo
191 191
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
192 192
             }
193 193
 
194
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
194
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
195 195
 
196 196
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
197 197
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
198 198
                     continue;
199 199
                 }
200
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
201
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
200
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
201
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
202 202
                     // add EAP type to profile as requested, but ...
203 203
                     $profile->addSupportedEapMethod($a, $priority);
204
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
204
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
205 205
                     // see if we can enable the EAP type, or if info is missing
206 206
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
207 207
                     if ($eapcompleteness === true) {
208
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
208
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
209 209
                     } else {
210 210
                         $warntext = "";
211 211
                         if (is_array($eapcompleteness)) {
212 212
                             foreach ($eapcompleteness as $item) {
213
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
213
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
214 214
                             }
215 215
                         }
216
-                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
216
+                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext)."<br/>"._("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
217 217
                     }
218 218
                 }
219 219
             }
@@ -223,23 +223,23 @@  discard block
 block discarded – undo
223 223
             if (count($significantChanges) > 0) {
224 224
                 $myInstOriginal = new \core\IdP($profile->institution);
225 225
                 // send a notification/alert mail to someone we know is in charge
226
-                $text = _("To whom it may concern,") . "\n\n";
226
+                $text = _("To whom it may concern,")."\n\n";
227 227
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
228
-                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
228
+                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
229 229
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
230
-                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:") . "\n\n";
231
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
230
+                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:")."\n\n";
231
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
232 232
                 }
233 233
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
234 234
                     $text .= _("A new trusted root CA was added. The details are below:\n\n");
235
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
235
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
236 236
                 }
237 237
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
238
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
239
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
238
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
239
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
240 240
                 }
241
-                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n";
242
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
241
+                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n";
242
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
243 243
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
244 244
                 $fed = new core\Federation($myInstOriginal->federation);
245 245
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         <?php
259 259
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
260 260
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
261
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
261
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
262 262
     </form>";
263 263
         }
264 264
         echo $deco->footer();
Please login to merge, or discard this patch.