Passed
Push — release_2_0 ( c174a1...0e4618 )
by Stefan
07:01
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/apple_mobileconfig/MobileconfigSuperclass.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -701,7 +701,7 @@
 block discarded – undo
701 701
                             \core\common\Entity::$nomenclature_inst, 
702 702
                             count($this->CAsAccountedFor)+1, 
703 703
                             ($ca['root'] ? _("Root") : _("Intermediate"))) . 
704
-              "</string>
704
+                "</string>
705 705
                <key>PayloadIdentifier</key>
706 706
                <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707 707
                <key>PayloadOrganization</key>
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
       <key>PayloadDescription</key>
99 99
          <string>$tagline</string>
100 100
       <key>PayloadDisplayName</key>
101
-         <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</string>
101
+         <string>".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</string>
102 102
       <key>PayloadIdentifier</key>
103
-         <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
103
+         <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
104 104
       <key>PayloadOrganization</key>
105
-         <string>" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8') . ( $this->attributes['internal:profile_count'][0] > 1 ? " (" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8') . ")" : "") . "</string>
105
+         <string>".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8').($this->attributes['internal:profile_count'][0] > 1 ? " (".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8').")" : "")."</string>
106 106
       <key>PayloadType</key>
107 107
          <string>Configuration</string>
108 108
       <key>PayloadUUID</key>
109
-         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
109
+         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
110 110
       <key>PayloadVersion</key>
111 111
          <integer>1</integer>";
112 112
         \core\common\Entity::outOfThePotatoes();
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
     {
139 139
         \core\common\Entity::intoThePotatoes();
140 140
         if (isset($this->attributes['support:info_file'])) {
141
-            return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
141
+            return MobileconfigSuperclass::BUFFER_CONSENT_PRE.htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8').MobileconfigSuperclass::BUFFER_CONSENT_POST;
142 142
         }
143 143
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
144 144
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
145
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s!"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
145
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s!"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
146 146
                 \core\common\Entity::outOfThePotatoes();
147 147
                 return $retval;
148 148
             }
149
-            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . _("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.") . MobileconfigSuperclass::BUFFER_CONSENT_POST;
149
+            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE._("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.").MobileconfigSuperclass::BUFFER_CONSENT_POST;
150 150
             \core\common\Entity::outOfThePotatoes();
151 151
             return $retval;
152 152
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         // also escape htmlspecialchars
171 171
         // not all names and profiles have a name, so be prepared
172 172
 
173
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
173
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
174 174
 
175 175
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
176 176
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         file_put_contents('installer_profile', $outputXml);
214 214
 
215
-        $fileName = $this->installerBasename . '.mobileconfig';
215
+        $fileName = $this->installerBasename.'.mobileconfig';
216 216
 
217 217
         if (!$this->sign) {
218 218
             rename("installer_profile", $fileName);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             return $fileName;
221 221
         }
222 222
         // still here? Then we are signing.
223
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
223
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
224 224
         if ($signing === FALSE) {
225 225
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
226 226
         }
@@ -239,19 +239,19 @@  discard block
 block discarded – undo
239 239
         \core\common\Entity::intoThePotatoes();
240 240
         $ssidCount = count($this->attributes['internal:SSID']);
241 241
         $certCount = count($this->attributes['internal:CAs'][0]);
242
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
242
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
243 243
         $out .= "<p>";
244 244
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
245 245
         $out .= "<ul>";
246
-        $out .= "<li>" . _("to install the profile") . "</li>";
247
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
246
+        $out .= "<li>"._("to install the profile")."</li>";
247
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
248 248
         if ($certCount > 1) {
249
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
249
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
250 250
         }
251 251
         $out .= "</li>";
252
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
252
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
253 253
         if ($ssidCount > 1) {
254
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
254
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
255 255
         }
256 256
         $out .= "</li>";
257 257
         $out .= "</ul>";
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $retval .= "                <key>RoamingConsortiumOIs</key>
305 305
                 <array>";
306 306
 
307
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
307
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
308 308
 
309 309
         $retval .= "</array>";
310 310
         // this is an undocumented value found on the net. Does it do something useful?
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                   <dict>
346 346
                       <key>AcceptEAPTypes</key>
347 347
                          <array>
348
-                            <integer>" . $eapType['OUTER'] . "</integer>
348
+                            <integer>" . $eapType['OUTER']."</integer>
349 349
                          </array>
350 350
                       <key>EAPFASTProvisionPAC</key>
351 351
                             <true />
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 ";
359 359
         if ($realm !== NULL) {
360 360
             $retval .= "<key>OuterIdentity</key>
361
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
361
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
362 362
 ";
363 363
         }
364 364
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -382,11 +382,11 @@  discard block
 block discarded – undo
382 382
         $retval .= "
383 383
                          </array>";
384 384
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
385
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
385
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
386 386
         }
387 387
         $retval .= "
388 388
                       <key>TTLSInnerAuthentication</key>
389
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
389
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
390 390
                    </dict>";
391 391
         return $retval;
392 392
     }
@@ -406,9 +406,9 @@  discard block
 block discarded – undo
406 406
             // characters are still reversed, invert on use!
407 407
             $buffer .= "<string>Manual</string>
408 408
                   <key>ProxyServer</key>
409
-                  <string>" . strrev($serverAndPort[1]) . "</string>
409
+                  <string>" . strrev($serverAndPort[1])."</string>
410 410
                   <key>ProxyServerPort</key>
411
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
411
+                  <integer>" . strrev($serverAndPort[0])."</integer>
412 412
                   <key>ProxyPACFallbackAllowed</key>
413 413
                   <false/>";
414 414
         } else {
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                     throw new Exception("SSID must be a string!");
438 438
                 }
439 439
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
440
-                $payloadIdentifier = "wifi." . $this->serial;
440
+                $payloadIdentifier = "wifi.".$this->serial;
441 441
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
442 442
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
443 443
                 $encryptionTypeString = "WPA";
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                 $payloadIdentifier = "hs20.$toBeConfigured";
468 468
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
469 469
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
470
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
470
+                    $knownOiName = $this->instName." "._("Roaming Partner");
471 471
                 }
472 472
                 $payloadShortName = $knownOiName;
473 473
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -489,11 +489,11 @@  discard block
 block discarded – undo
489 489
                <key>PayloadDisplayName</key>
490 490
                   <string>$payloadShortName</string>
491 491
                <key>PayloadIdentifier</key>
492
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
492
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
493 493
                <key>PayloadOrganization</key>
494
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
494
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
495 495
                <key>PayloadType</key>
496
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
496
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
497 497
         $retval .= $this->proxySettings();
498 498
         $retval .= $setupModesString;
499 499
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
         }
506 506
         $retval .= "
507 507
                <key>PayloadUUID</key>
508
-                  <string>" . \core\common\Entity::uuid() . "</string>
508
+                  <string>" . \core\common\Entity::uuid()."</string>
509 509
                <key>PayloadVersion</key>
510 510
                   <integer>1</integer>
511 511
                   $wifiNetworkIdentification</dict>";
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
 	<key>IsHotspot</key>
536 536
 	<false/>
537 537
 	<key>PayloadDescription</key>
538
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
538
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
539 539
 	<key>PayloadDisplayName</key>
540
-	<string>" . _("Disabled WiFi network") . "</string>
540
+	<string>" . _("Disabled WiFi network")."</string>
541 541
 	<key>PayloadIdentifier</key>
542
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
542
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
543 543
 	<key>PayloadType</key>
544 544
 	<string>com.apple.wifi.managed</string>
545 545
 	<key>PayloadUUID</key>
546
-	<string>" . \core\common\Entity::uuid() . "</string>
546
+	<string>".\core\common\Entity::uuid()."</string>
547 547
 	<key>PayloadVersion</key>
548 548
 	<real>1</real>";
549 549
         $retval .= $this->proxySettings();
@@ -622,12 +622,12 @@  discard block
 block discarded – undo
622 622
         $mimeBlob = base64_encode($binaryBlob);
623 623
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
624 624
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
625
-        $retArray = ["block" => "<dict>" .
625
+        $retArray = ["block" => "<dict>".
626 626
             // we don't include the import password. It's displayed on screen, and should be input by the user.
627 627
             // <key>Password</key>
628 628
             //   <string>" . $this->clientCert['password'] . "</string>
629 629
             "<key>PayloadCertificateFileName</key>
630
-                     <string>" . $this->massagedConsortium . ".pfx</string>
630
+                     <string>" . $this->massagedConsortium.".pfx</string>
631 631
                   <key>PayloadContent</key>
632 632
                      <data>
633 633
 $mimeFormatted
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
                   <key>PayloadDescription</key>
636 636
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
637 637
                   <key>PayloadDisplayName</key>
638
-                     <string>" . _("eduroam user certificate") . "</string>
638
+                     <string>"._("eduroam user certificate")."</string>
639 639
                   <key>PayloadIdentifier</key>
640 640
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
641 641
                   <key>PayloadType</key>
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
                   <key>PayloadVersion</key>
646 646
                      <integer>1</integer>
647 647
                 </dict>",
648
-            "UUID" => $payloadUUID,];
648
+            "UUID" => $payloadUUID, ];
649 649
         \core\common\Entity::outOfThePotatoes();
650 650
         return $retArray;
651 651
     }
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
         }
665 665
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
666 666
         return "<key>RemovalDate</key>
667
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
667
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
668 668
     }
669 669
 
670 670
     private $CAsAccountedFor = [];
@@ -688,27 +688,27 @@  discard block
 block discarded – undo
688 688
             $stream = "
689 689
             <dict>
690 690
                <key>PayloadCertificateFileName</key>
691
-               <string>" . $ca['uuid'] . ".der</string>
691
+               <string>" . $ca['uuid'].".der</string>
692 692
                <key>PayloadContent</key>
693 693
                <data>
694
-" . $trimmedPem . "</data>
694
+" . $trimmedPem."</data>
695 695
                <key>PayloadDescription</key>
696
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
696
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
697 697
                <key>PayloadDisplayName</key>
698 698
                <string>" . 
699 699
                     /// example: "Identity Provider CA #1 (Root)"
700
-                    sprintf(_("%s CA #%d (%s)" ), 
700
+                    sprintf(_("%s CA #%d (%s)"), 
701 701
                             \core\common\Entity::$nomenclature_inst, 
702
-                            count($this->CAsAccountedFor)+1, 
703
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
702
+                            count($this->CAsAccountedFor) + 1, 
703
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
704 704
               "</string>
705 705
                <key>PayloadIdentifier</key>
706
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
706
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707 707
                <key>PayloadOrganization</key>
708
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
708
+               <string>".$this->massagedConsortium.".1x-config.org</string>
709 709
                <key>PayloadType</key>
710 710
                <string>com.apple.security.root</string>
711
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
711
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
712 712
                <key>PayloadVersion</key>
713 713
                <integer>1</integer>
714 714
             </dict>";
Please login to merge, or discard this patch.
web/diag/action_realmcheck.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
22
+require_once dirname(dirname(__DIR__))."/config/_config.php";
23 23
 
24 24
 $loggerInstance = new \core\common\Logging();
25 25
 
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
         $testsuite = new \core\diag\RADIUSTests($check_realm, $testedProfile->getRealmCheckOuterUsername(), $testedProfile->getEapMethodsinOrderOfPreference(1), $testedProfile->getCollapsedAttributes()['eap:server_name'], $testedProfile->getCollapsedAttributes()["eap:ca_file"]);
66 66
         $rfc7585suite = new \core\diag\RFC7585Tests($check_realm);
67 67
     } else {
68
-        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>";
68
+        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>";
69 69
     }
70 70
 } else { // someone else's realm, and we don't know anything about it... only shallow checks
71 71
     $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? "");
72 72
     if ($check_realm !== FALSE) {
73 73
         $_SESSION['check_realm'] = $check_realm;
74
-        $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
74
+        $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
75 75
         $rfc7585suite = new \core\diag\RFC7585Tests($check_realm);
76 76
     } else {
77 77
         $error_message = _("No valid realm name given, cannot execute any checks!");
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>";
120 120
     var getitfrom = "<?php echo _("Get it from here.") ?>";
121 121
     var listsource = "<?php echo CONFIG_DIAGNOSTICS['RADIUSTESTS']['accreditedCAsURL'] ?>";
122
-    var moretext = "<?php echo _("more") . "&raquo;" ?>";
122
+    var moretext = "<?php echo _("more")."&raquo;" ?>";
123 123
     var lesstext = "<?php echo "&laquo" ?>";
124 124
     var morealltext = "<?php echo _("Show detailed information for all tests") ?>";
125 125
     var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>";
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                         }
257 257
                     }
258 258
                     cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
259
-                    cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
259
+                    cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
260 260
                     cliinfo = cliinfo + '</tbody></table></ul></li>';
261 261
                     if (data.ca[key].certificate[c].finalerror === 1) {
262 262
                         cliinfo = cliinfo + '<li>' + restskipped + '</li>';
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
 <?php
427 427
 foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
428 428
     print "
429
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
430
-$(\"#live_src" . $hostindex . "_img\").show();
429
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
430
+$(\"#live_src" . $hostindex."_img\").show();
431 431
 $.ajax({
432 432
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
433 433
     type: 'POST',
@@ -457,15 +457,15 @@  discard block
 block discarded – undo
457 457
 <?php
458 458
 foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
459 459
     if ($testedProfile !== NULL) {
460
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
460
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
461 461
     } else {
462 462
         $extraarg = "";
463 463
     }
464 464
     print "
465
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
465
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
466 466
 $(\"#src$hostindex\").html('');
467 467
 running_ajax_stat++;
468
-$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex'  }, udp, 'json');
468
+$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex'  }, udp, 'json');
469 469
 
470 470
 ";
471 471
 }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     if ($check_realm === FALSE) {
493 493
         print "<p>$error_message</p>";
494 494
     } else {
495
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
495
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
496 496
         ?>
497 497
         <div id="debug_out" style="display: none"></div>
498 498
         <div id="tabs" style="min-width: 600px; max-width:800px">
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
                     </legend>
510 510
                     <?php
511 511
                     // NAPTR existence check
512
-                    echo "<strong>" . _("DNS chekcs") . "</strong><div>";
512
+                    echo "<strong>"._("DNS chekcs")."</strong><div>";
513 513
                     $naptr = $rfc7585suite->relevantNAPTR();
514 514
                     if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
515 515
                         echo "<table>";
516 516
                         // output in friendly words
517
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
517
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
518 518
                         switch ($naptr) {
519 519
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
520 520
                                 echo _("This realm has no NAPTR records.");
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 
530 530
                         // compliance checks for NAPTRs
531 531
                         if ($naptr > 0) {
532
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
532
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
533 533
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
534 534
                             switch ($naptr_valid) {
535 535
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 
547 547
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
548 548
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
549
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
549
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
550 550
                             switch ($srv) {
551 551
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
552 552
                                     echo _("This check was skipped.");
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
                         // IP addresses for the hosts
563 563
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
564 564
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
565
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
565
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
566 566
                             switch ($srv) {
567 567
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
568 568
                                     echo _("This check was skipped.");
@@ -578,12 +578,12 @@  discard block
 block discarded – undo
578 578
 
579 579
                         echo "</table><br/><br/>";
580 580
                         if (count($testsuite->listerrors()) == 0) {
581
-                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
581
+                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
582 582
                         } else {
583
-                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
583
+                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
584 584
                             echo "<div class='notacceptable'><table>";
585 585
                             foreach ($testsuite->listerrors() as $details) {
586
-                                echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
586
+                                echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
587 587
                             }
588 588
                             echo "</table></div>";
589 589
                         }
@@ -599,25 +599,25 @@  discard block
 block discarded – undo
599 599
                  $("#dynamic_tests").show();
600 600
               ';
601 601
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
602
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
602
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
603 603
                             print "
604 604
                             running_ajax_dyn++;
605
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); 
605
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); 
606 606
                             running_ajax_dyn++;
607
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
607
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
608 608
                        ";
609 609
                         }
610 610
                         echo "}
611 611
               </script><hr>";
612 612
                     } else {
613
-                        echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
613
+                        echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
614 614
                     }
615
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
615
+                    echo "<strong>"._("Static connectivity tests")."</strong>
616 616
          <table><tr>
617 617
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'>&nbsp;</td>
618 618
          </tr></table>";
619 619
                     if ($naptr > 0) {
620
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
620
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
621 621
          <table><tr>
622 622
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'>&nbsp;</td>
623 623
          </tr></table>";
@@ -637,12 +637,12 @@  discard block
 block discarded – undo
637 637
                     print "<p>";
638 638
                     foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
639 639
                         print "<hr>";
640
-                        printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
640
+                        printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
641 641
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
642 642
 <tr>
643
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
643
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
644 644
 <td id='src$hostindex' colspan=2>
645
-" . _("testing...") . "
645
+"._("testing...")."
646 646
 </td>
647 647
 </tr>
648 648
 </table>";
@@ -661,21 +661,21 @@  discard block
 block discarded – undo
661 661
 
662 662
                     <?php
663 663
                     echo "<div id='dynamic_tests'><fieldset class='option_container'>
664
-                <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>";
664
+                <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>";
665 665
 
666 666
                     $resultstoprint = [];
667 667
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
668
-                        $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</table><table style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</table>';
669
-                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
668
+                        $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</table><table style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</table>';
669
+                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
670 670
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
671
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
672
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>';
671
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
672
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>';
673 673
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
674 674
                             $resultstoprint[] = "<table id='caresults$hostindex'  style='width:100%'>
675 675
 <tr>
676
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td>
676
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td>
677 677
 <td id='srcca$hostindex'>
678
-" . _("testing...") . "
678
+"._("testing...")."
679 679
 </td>
680 680
 </tr>
681 681
 </table>";
@@ -683,12 +683,12 @@  discard block
 block discarded – undo
683 683
                         }
684 684
                         $clientstest = [];
685 685
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
686
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
686
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
687 687
                             $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'>
688 688
 <tr>
689
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td>
689
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td>
690 690
 <td id='srcclient$hostindex'>
691
-" . _("testing...") . "
691
+"._("testing...")."
692 692
 </td>
693 693
 </tr>
694 694
 </table></span>";
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
                         }
697 697
                         echo '<div style="align:right;">';
698 698
                         echo join('', $resultstoprint);
699
-                        echo '<span id="clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from  CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>';
699
+                        echo '<span id="clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from  CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>';
700 700
                         print join('', $clientstest);
701 701
                         echo '</span>';
702 702
                         echo '</div>';
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
                 //     check if truncates/dies on Operator-Name
711 711
                 if ($my_profile !== NULL) {
712 712
                     echo "<div id='tabs-4'><fieldset class='option_container'>
713
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
713
+                <legend><strong>" . _("Live login test")."</strong></legend>";
714 714
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
715 715
                     if (count($prof_compl) > 0) {
716 716
                         $passwordReqired = FALSE;
@@ -723,34 +723,34 @@  discard block
 block discarded – undo
723 723
                                 $clientCertRequired = TRUE;
724 724
                             }
725 725
                         }
726
-                        echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p>
727
-                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p>
728
-                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div>
726
+                        echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p>
727
+                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p>
728
+                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div>
729 729
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
730 730
                     <input type='hidden' name='test_type' value='udp_login'>
731
-                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang() . "'>
732
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
731
+                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang()."'>
732
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
733 733
                     <table id='live_tests'>";
734 734
 // if any password based EAP methods are available enable this section
735 735
                         if ($passwordReqired) {
736
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
737
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
736
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
737
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
740 740
                         }
741 741
                         // ask for cert + privkey if TLS-based method is active
742 742
                         if ($clientCertRequired) {
743
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
744
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
743
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
744
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
747 747
                         }
748
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
748
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
749 749
                         echo "<div id='live_login_results' style='display:none'>";
750 750
                         foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
751 751
                             print "<hr>";
752
-                            printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
753
-                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
752
+                            printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
753
+                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
754 754
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
755 755
                         }
756 756
                         echo "</div>";
@@ -765,9 +765,9 @@  discard block
 block discarded – undo
765 765
             }
766 766
 
767 767
             if (isset($_POST['comefrom'])) {
768
-                $return = htmlspecialchars_decode($_POST['comefrom']) . "?inst_id=" . $my_inst->identifier;
768
+                $return = htmlspecialchars_decode($_POST['comefrom'])."?inst_id=".$my_inst->identifier;
769 769
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
770
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>"
770
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>"
771 771
                 . "</form>";
772 772
             }
773 773
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.
core/CertificationAuthorityEduPkiServer.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
69 69
         try {
70 70
             $altArray = [# Array mit den Subject Alternative Names
71
-                 "email:" . $csr["USERMAIL"]
71
+                    "email:" . $csr["USERMAIL"]
72 72
             ];
73 73
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
74 74
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 
17 17
 class CertificationAuthorityEduPkiServer extends EntityWithDBProperties implements CertificationAuthorityInterface {
18 18
 
19
-    private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
20
-    private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
21
-    private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
19
+    private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem";
20
+    private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
21
+    private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
22 22
     private const EDUPKI_RA_ID = 700;
23 23
     private const EDUPKI_CERT_PROFILE = "Radius Server SOAP";
24 24
     private const EDUPKI_RA_PKEY_PASSPHRASE = "...";
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
         parent::__construct();
34 34
 
35 35
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) {
36
-            throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
36
+            throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
37 37
         }
38 38
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) {
39
-            throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
39
+            throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
40 40
         }
41 41
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) {
42
-            throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
42
+            throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
43 43
         }
44 44
     }
45 45
 
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
69 69
         try {
70 70
             $altArray = [# Array mit den Subject Alternative Names
71
-                 "email:" . $csr["USERMAIL"]
71
+                 "email:".$csr["USERMAIL"]
72 72
             ];
73 73
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
74 74
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
75
-            $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n");
76
-            $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n");
75
+            $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n");
76
+            $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n");
77 77
             $this->loggerInstance->debug(5, "PARAM_3: ");
78 78
             $this->loggerInstance->debug(5, $altArray);
79
-            $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n");
80
-            $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n");
81
-            $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n");
82
-            $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n");
83
-            $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n");
79
+            $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n");
80
+            $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n");
81
+            $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n");
82
+            $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n");
83
+            $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n");
84 84
             $this->loggerInstance->debug(5, "PARAM_9: false\n");
85 85
             $soapNewRequest = $soapPub->newRequest(
86 86
                     CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
         } catch (Exception $e) {
103 103
             // PHP 7.1 can do this much better
104 104
             if (is_soap_fault($e)) {
105
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}:  {
105
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}:  {
106 106
                     $e->faultstring
107 107
                 }\n");
108 108
             }
109
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
109
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
110 110
         }
111 111
         try {
112 112
             $soap = $this->initEduPKISoapSession("RA");
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
141 141
             // rather than just using the string. Grr.
142 142
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
143
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext);
143
+            file_put_contents($tempdir['dir']."/content.txt", $soapCleartext);
144 144
             // retrieve our RA cert from filesystem                    
145 145
             // the RA certificates are not needed right now because we
146 146
             // have resorted to S/MIME signatures with openssl command-line
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
153 153
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
154 154
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n  $soapCleartext\n");
155
-            $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";
155
+            $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";
156 156
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline:   $execCmd\n");
157 157
             $output = [];
158 158
             $return = 999;
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
                 throw new Exception("Non-zero return value from openssl smime!");
162 162
             }
163 163
             // and get the signature blob back from the filesystem
164
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
164
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
165 165
             $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n");
166
-            $this->loggerInstance->debug(5, $soapReqnum . "\n");
167
-            $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending!
168
-            $this->loggerInstance->debug(5, $detachedSig . "\n");
166
+            $this->loggerInstance->debug(5, $soapReqnum."\n");
167
+            $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending!
168
+            $this->loggerInstance->debug(5, $detachedSig."\n");
169 169
             $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig);
170
-            $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest());
171
-            $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse());
170
+            $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest());
171
+            $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse());
172 172
             if ($soapIssueCert === FALSE) {
173 173
                 throw new Exception("The locally approved request was NOT processed by the CA.");
174 174
             }
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
                 throw new Exception("CAInfo has no root certificate for us!");
206 206
             }
207 207
         } catch (SoapFault $e) {
208
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
208
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
209 209
         } catch (Exception $e) {
210
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
210
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
211 211
         }
212 212
         return [
213 213
             "CERT" => openssl_x509_read($parsedCert['pem']),
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
240 240
             // rather than just using the string. Grr.
241 241
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
242
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest);
242
+            file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest);
243 243
             // retrieve our RA cert from filesystem
244 244
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
245 245
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
246 246
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n");
247
-            $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;
247
+            $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;
248 248
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n");
249 249
             $output = [];
250 250
             $return = 999;
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                 throw new Exception("Non-zero return value from openssl smime!");
254 254
             }
255 255
             // and get the signature blob back from the filesystem
256
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
256
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
257 257
             $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig);
258 258
             if ($soapIssueRev === FALSE) {
259 259
                 throw new Exception("The locally approved revocation request was NOT processed by the CA.");
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
         } catch (Exception $e) {
262 262
             // PHP 7.1 can do this much better
263 263
             if (is_soap_fault($e)) {
264
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n");
264
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n");
265 265
             }
266
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
266
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
267 267
         }
268 268
     }
269 269
 
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
      * @return string the integer as string in an XML fragment
361 361
      */
362 362
     public function soapToXmlInteger($x) {
363
-        return '<' . $x[0] . '>'
363
+        return '<'.$x[0].'>'
364 364
                 . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1)
365
-                . '</' . $x[0] . '>';
365
+                . '</'.$x[0].'>';
366 366
     }
367 367
 
368 368
     /**
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
         // dump private key into directory
381 381
         $outstring = "";
382 382
         openssl_pkey_export($privateKey, $outstring);
383
-        file_put_contents($tempdir . "/pkey.pem", $outstring);
383
+        file_put_contents($tempdir."/pkey.pem", $outstring);
384 384
         // PHP can only do one DC in the Subject. But we need three.
385
-        $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";
385
+        $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";
386 386
         $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n");
387 387
         $output = [];
388 388
         $return = 999;
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 1 patch
Spacing   +14 added lines, -14 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";
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
             default:
107 107
                 throw new Exception("Sorry: Unknown level of issuance requested.");
108 108
         }
109
-        echo "<p>" . _("Requesting a certificate with the following properties");
109
+        echo "<p>"._("Requesting a certificate with the following properties");
110 110
         echo "<ul>";
111
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
112
-        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>";
113
-        echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').") . "</li>";
111
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
112
+        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>";
113
+        echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').")."</li>";
114 114
         echo "</ul></p>";
115
-        $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes);
115
+        $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => ["file", "/tmp/voodoo-error", "a"]], $pipes);
116 116
         if (is_resource($ossl)) {
117 117
             fwrite($pipes[0], $_POST['CSR']);
118 118
             fclose($pipes[0]);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         }
125 125
         echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>";
126 126
         echo "<p>"._("Please WAIT. This can take several MINUTES!")."</p>";
127
-        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "CN" => "[email protected]" , "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country];
127
+        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "CN" => "[email protected]", "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country];
128 128
         $eduPki = new core\CertificationAuthorityEduPkiServer();
129 129
         // our certs can be good for max 5 years
130 130
         $cert = $eduPki->signRequest($newCsrWithMeta, 1825);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         echo "<p>"._("Here is your certificate:")."<pre>$certPem</pre></p>";
133 133
         ?>
134 134
         <form action="overview_certificates.php" method="GET">
135
-            <button type="submit"><?php echo _("Back to Certificate Overview");?></button>
135
+            <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
136 136
         </form>
137 137
     <?php
138 138
     echo $deco->footer();
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
         <?php
147 147
         if (count($feds) == 1) {
148 148
             $fedObject = new \core\Federation($feds[0]['value']);
149
-            echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>";
150
-            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>';
149
+            echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>";
150
+            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>';
151 151
         } else {
152 152
             ?>
153 153
             <select name="NRO-list" id="NRO-list">
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 <?php
156 156
                 foreach ($feds as $oneFed) {
157 157
                     $fedObject = new \core\Federation($oneFed['value']);
158
-                    echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>";
158
+                    echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>";
159 159
                 }
160 160
                 ?>
161 161
             </select>
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 }
176 176
             }
177 177
             foreach ($allIdPs as $id => $name) {
178
-                echo '<option value="' . $id . '">' . $name . "</option>";
178
+                echo '<option value="'.$id.'">'.$name."</option>";
179 179
             }
180 180
             ?>
181 181
         </select>
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.