Passed
Push — release_2_0 ( 2b9a09...993113 )
by Stefan
08:43
created
web/admin/overview_certificates.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert
82 82
             $status = $oneCert['STATUS'];
83 83
             if ($status == "ISSUED") {
84
-                $status = "<span onclick='alert(\"".str_replace("\n","\\n",$oneCert['CERT'])."\");'>$status</span>";
84
+                $status = "<span onclick='alert(\"".str_replace("\n", "\\n", $oneCert['CERT'])."\");'>$status</span>";
85 85
             }
86 86
             echo "<tr><td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td></tr>";
87 87
         }
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     // also send user back to the overview page
73 73
     if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
74 74
         // basic sanity checks before we hand this over to openssl
75
-        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "" , TRUE);
75
+        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE);
76 76
         if (openssl_csr_get_public_key($sanitisedCsr) === FALSE) {
77 77
             throw new Exception("Sorry: Unable to parse the submitted public key - no public key inside?");
78 78
         }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 $fed = $validator->Federation($_POST['NRO-list']);
87 87
                 $country = strtoupper($fed->tld);
88 88
                 $DN[] = "C=$country";
89
-                $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)];
89
+                $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)];
90 90
                 $DN[] = "CN=comes.from.eduroam.db";
91 91
                 $policies[] = "eduroam IdP";
92 92
                 $policies[] = "eduroam SP";
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
             default:
105 105
                 throw new Exception("Sorry: Unknown level of issuance requested.");
106 106
         }
107
-        echo "<p>" . _("Requesting a certificate with the following properties");
107
+        echo "<p>"._("Requesting a certificate with the following properties");
108 108
         echo "<ul>";
109
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
110
-        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>";
111
-        echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').") . "</li>";
109
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
110
+        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>";
111
+        echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').")."</li>";
112 112
         echo "</ul></p>";
113 113
         /* $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes);
114 114
         if (is_resource($ossl)) {
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
             throw new Exception("Calling openssl in a fancy way did not work.");
122 122
         }
123 123
         echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */
124
-        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country];
124
+        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country];
125 125
         // our certs can be good for max 5 years
126 126
         $fed->requestCertificate($newCsrWithMeta, 1825);
127 127
         echo "<p>"._("The certificate was requested.")."</p>";
128 128
         ?>
129 129
         <form action="overview_certificates.php" method="GET">
130
-            <button type="submit"><?php echo _("Back to Certificate Overview");?></button>
130
+            <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
131 131
         </form>
132 132
     <?php
133 133
     echo $deco->footer();
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 
137 137
     // if we did not get a SAVE button, display UI for a fresh request instead
138 138
     ?>
139
-    <h2><?php echo _("1. Certificate Holder Details");?></h2>
139
+    <h2><?php echo _("1. Certificate Holder Details"); ?></h2>
140 140
     <form action="action_req_certificate.php" method="POST">
141 141
         <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input>
142 142
         <?php
143 143
         if (count($feds) == 1) {
144 144
             $fedObject = new \core\Federation($feds[0]['value']);
145
-            echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>";
146
-            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>';
145
+            echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>";
146
+            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>';
147 147
         } else {
148 148
             ?>
149 149
             <select name="NRO-list" id="NRO-list">
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 <?php
152 152
                 foreach ($feds as $oneFed) {
153 153
                     $fedObject = new \core\Federation($oneFed['value']);
154
-                    echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>";
154
+                    echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>";
155 155
                 }
156 156
                 ?>
157 157
             </select>
@@ -171,15 +171,15 @@  discard block
 block discarded – undo
171 171
                 }
172 172
             }
173 173
             foreach ($allIdPs as $id => $name) {
174
-                echo '<option value="' . $id . '">' . $name . "</option>";
174
+                echo '<option value="'.$id.'">'.$name."</option>";
175 175
             }
176 176
             ?>
177 177
         </select>
178 178
         <br/>
179
-        <h2><?php echo _("2. CSR generation");?></h2>
180
-        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p>
179
+        <h2><?php echo _("2. CSR generation"); ?></h2>
180
+        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
181 181
         <p>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /DC=test/DC=test/DC=eduroam/C=XY/O=WillBeReplaced/CN=will.be.replaced</p>
182
-        <h2><?php echo _("3. Submission");?></h2>
182
+        <h2><?php echo _("3. Submission"); ?></h2>
183 183
         <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/>
184 184
     <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button>
185 185
 </form>
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function listProfiles(bool $activeOnly = FALSE)
116 116
     {
117
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
117
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
118 118
         $allProfiles = $this->databaseHandle->exec($query);
119 119
         $returnarray = [];
120 120
         // SELECT -> resource, not boolean
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $returnarray[] = $oneProfile;
125 125
         }
126 126
 
127
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
127
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
128 128
         return $returnarray;
129 129
     }
130 130
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
230 230
                     $theProfile = new ProfileSilverbullet($identifier, $this);
231 231
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
232
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
232
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
233 233
                     return $theProfile;
234 234
                 default:
235 235
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     public function getExternalDBId()
351 351
     {
352 352
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
353
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
353
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
354 354
             // SELECT -> it's a resource, not a boolean
355 355
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
356 356
                 return FALSE;
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $profile = $validator->Profile($_GET['profile_id'], $my_inst->identifier);
57 57
         } else {
58 58
             $profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
59
-            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $my_inst->identifier . " - Profile created");
59
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$my_inst->identifier." - Profile created");
60 60
         }
61 61
 
62 62
         if (!$profile instanceof \core\ProfileRADIUS) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $uiElements = new web\lib\admin\UIElements();
119 119
             // set realm info, if submitted
120 120
             if ($realm !== FALSE) {
121
-                $profile->setRealm($anonLocal . "@" . $realm);
121
+                $profile->setRealm($anonLocal."@".$realm);
122 122
                 echo $uiElements->boxOkay(sprintf(_("Realm: <strong>%s</strong>"), $realm));
123 123
             } else {
124 124
                 $profile->setRealm("");
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!"));
142 142
                 } else {
143 143
                     $profile->setRealmcheckUser(true, $checkuser_name);
144
-                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm));
144
+                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm));
145 145
                 }
146 146
             } else {
147 147
                 $profile->setRealmCheckUser(false);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 } else {
155 155
                     $profile->setInputVerificationPreference($verify, $hint);
156 156
                     if ($hint !== FALSE) {
157
-                        $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
157
+                        $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
158 158
                     } else {
159 159
                         $extratext = ".";
160 160
                     }
@@ -191,29 +191,29 @@  discard block
 block discarded – undo
191 191
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
192 192
             }
193 193
 
194
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
194
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
195 195
 
196 196
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
197 197
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
198 198
                     continue;
199 199
                 }
200
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
201
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
200
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
201
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
202 202
                     // add EAP type to profile as requested, but ...
203 203
                     $profile->addSupportedEapMethod($a, $priority);
204
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
204
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
205 205
                     // see if we can enable the EAP type, or if info is missing
206 206
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
207 207
                     if ($eapcompleteness === true) {
208
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
208
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
209 209
                     } else {
210 210
                         $warntext = "";
211 211
                         if (is_array($eapcompleteness)) {
212 212
                             foreach ($eapcompleteness as $item) {
213
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
213
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
214 214
                             }
215 215
                         }
216
-                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
216
+                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext)."<br/>"._("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
217 217
                     }
218 218
                 }
219 219
             }
@@ -223,23 +223,23 @@  discard block
 block discarded – undo
223 223
             if (count($significantChanges) > 0) {
224 224
                 $myInstOriginal = new \core\IdP($profile->institution);
225 225
                 // send a notification/alert mail to someone we know is in charge
226
-                $text = _("To whom it may concern,") . "\n\n";
226
+                $text = _("To whom it may concern,")."\n\n";
227 227
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
228
-                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
228
+                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
229 229
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
230
-                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:") . "\n\n";
231
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
230
+                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:")."\n\n";
231
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
232 232
                 }
233 233
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
234 234
                     $text .= _("A new trusted root CA was added. The details are below:\n\n");
235
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
235
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
236 236
                 }
237 237
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
238
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
239
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
238
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
239
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
240 240
                 }
241
-                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n";
242
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
241
+                $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n";
242
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
243 243
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
244 244
                 $fed = new core\Federation($myInstOriginal->federation);
245 245
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         <?php
259 259
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
260 260
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
261
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
261
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
262 262
     </form>";
263 263
         }
264 264
         echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/edit_idp_result.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $loggerInstance = new \core\common\Logging();
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 $myInstOriginal = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
39 39
 $instId = $myInstOriginal->identifier;
40 40
 
41
-$hello = _("To whom it may concern,") . "\n\n";
42
-$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n" .
43
-        _("Greetings, ") . "\n\n" .
41
+$hello = _("To whom it may concern,")."\n\n";
42
+$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n".
43
+        _("Greetings, ")."\n\n".
44 44
         CONFIG['APPEARANCE']['productname_long'];
45 45
 
46 46
 switch ($_POST['submitbutton']) {
47 47
     case web\lib\common\FormElements::BUTTON_DELETE:
48 48
         $myInstOriginal->destroy();
49
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
49
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
50 50
         header("Location: overview_user.php");
51 51
         exit;
52 52
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         }
57 57
         // flush all IdP attributes and send user to creation wizard
58 58
         $myInstOriginal->flushAttributes();
59
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
60
-        $text = $hello .
61
-                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n" .
59
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
60
+        $text = $hello.
61
+                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n".
62 62
                 $bye;
63 63
         $fed = new core\Federation($myInstOriginal->federation);
64 64
         foreach ($fed->listFederationAdmins() as $id) {
@@ -77,19 +77,19 @@  discard block
 block discarded – undo
77 77
             exit(0);
78 78
         }
79 79
         $inst_name = $myInstOriginal->name;
80
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
80
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
81 81
         echo "<table>";
82 82
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
83 83
         echo "</table>";
84 84
 // delete cached logo, if present
85
-        $dir = ROOT . '/web/downloads/logos/';
86
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
85
+        $dir = ROOT.'/web/downloads/logos/';
86
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
87 87
         if ($globResult === FALSE) { // we should catch the improbable error condition
88 88
             $globResult = [];
89 89
         }
90 90
         array_map('unlink', $globResult);
91 91
         $loggerInstance->debug(4, "UNLINK from $dir\n");
92
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
92
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
93 93
 
94 94
 // re-instantiate ourselves... profiles need fresh data
95 95
         $myInstReinstantiated = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
         if (count($significantChanges) > 0) {
99 99
             // send a notification/alert mail to someone we know is in charge
100 100
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
101
-            $text = $hello . sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
101
+            $text = $hello.sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
102 102
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
103
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst) . "\n\n";
104
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
103
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst)."\n\n";
104
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
105 105
             }
106 106
             $text .= $bye;
107 107
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 
118 118
         if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
119 119
             foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) {
120
-                $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
120
+                $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
121 121
             }
122 122
         }
123 123
 
124 124
         foreach ($myInstReinstantiated->getAttributes("media:SSID_with_legacy") as $ssidname) {
125
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)");
125
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)");
126 126
         }
127 127
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
128
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
128
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
129 129
         }
130 130
 
131 131
         echo "<table>";
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         if (count($ssids) > 0) {
134 134
             $printedlist = "";
135 135
             foreach ($ssids as $names) {
136
-                $printedlist = $printedlist . "$names ";
136
+                $printedlist = $printedlist."$names ";
137 137
             }
138 138
             echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
139 139
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 // did we get an email address? then, show the silverbullet jumpstart button
162 162
                 // otherwise, issue a smartass comment
163 163
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
164
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
164
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
165 165
                 } else {
166 166
                     echo "<table>";
167 167
                     echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!"));
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
                 }
170 170
             }
171 171
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
172
-                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
172
+                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
173 173
             }
174 174
         }
175
-        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
175
+        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
176 176
         echo $deco->footer();
177 177
         break;
178 178
     default:
Please login to merge, or discard this patch.
core/diag/RFC6614Tests.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * Test suite to verify that a given NAI realm has NAPTR records according to
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status'];
145 145
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']];
146 146
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected'];
147
-                $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private'];
147
+                $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private'];
148 148
                 if (!isset($this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k])) {
149 149
                     $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k] = [];
150 150
                 }
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 // but code analysers want this more explicit, so here is this extra
189 189
 // call to escapeshellarg()
190 190
         $escapedHost = escapeshellarg($host);
191
-        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1\n");
191
+        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1\n");
192 192
         $time_start = microtime(true);
193 193
         $opensslbabble = [];
194 194
         $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures
195
-        exec(CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -no_ssl2 -no_ssl3 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
195
+        exec(CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -no_ssl2 -no_ssl3 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
196 196
         $time_stop = microtime(true);
197 197
         $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000);
198 198
         $testresults['returncode'] = $result;
Please login to merge, or discard this patch.
devices/apple_mobileconfig/MobileconfigSuperclass.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
       <key>PayloadDescription</key>
99 99
          <string>$tagline</string>
100 100
       <key>PayloadDisplayName</key>
101
-         <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</string>
101
+         <string>".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</string>
102 102
       <key>PayloadIdentifier</key>
103
-         <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
103
+         <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
104 104
       <key>PayloadOrganization</key>
105
-         <string>" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8') . ( $this->attributes['internal:profile_count'][0] > 1 ? " (" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8') . ")" : "") . "</string>
105
+         <string>".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8').($this->attributes['internal:profile_count'][0] > 1 ? " (".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8').")" : "")."</string>
106 106
       <key>PayloadType</key>
107 107
          <string>Configuration</string>
108 108
       <key>PayloadUUID</key>
109
-         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
109
+         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
110 110
       <key>PayloadVersion</key>
111 111
          <integer>1</integer>";
112 112
         \core\common\Entity::outOfThePotatoes();
@@ -138,16 +138,16 @@  discard block
 block discarded – undo
138 138
     {
139 139
         \core\common\Entity::intoThePotatoes();
140 140
         if (isset($this->attributes['support:info_file'])) {
141
-            return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
141
+            return MobileconfigSuperclass::BUFFER_CONSENT_PRE.htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8').MobileconfigSuperclass::BUFFER_CONSENT_POST;
142 142
         }
143 143
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
144 144
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
145 145
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
146
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
146
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
147 147
                 \core\common\Entity::outOfThePotatoes();
148 148
                 return $retval;
149 149
             }
150
-            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . _("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.") . MobileconfigSuperclass::BUFFER_CONSENT_POST;
150
+            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE._("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.").MobileconfigSuperclass::BUFFER_CONSENT_POST;
151 151
             \core\common\Entity::outOfThePotatoes();
152 152
             return $retval;
153 153
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         // also escape htmlspecialchars
172 172
         // not all names and profiles have a name, so be prepared
173 173
 
174
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
174
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
175 175
 
176 176
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
177 177
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         file_put_contents('installer_profile', $outputXml);
215 215
 
216
-        $fileName = $this->installerBasename . '.mobileconfig';
216
+        $fileName = $this->installerBasename.'.mobileconfig';
217 217
 
218 218
         if (!$this->sign) {
219 219
             rename("installer_profile", $fileName);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             return $fileName;
222 222
         }
223 223
         // still here? Then we are signing.
224
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
224
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
225 225
         if ($signing === FALSE) {
226 226
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
227 227
         }
@@ -240,19 +240,19 @@  discard block
 block discarded – undo
240 240
         \core\common\Entity::intoThePotatoes();
241 241
         $ssidCount = count($this->attributes['internal:SSID']);
242 242
         $certCount = count($this->attributes['internal:CAs'][0]);
243
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
243
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
244 244
         $out .= "<p>";
245 245
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
246 246
         $out .= "<ul>";
247
-        $out .= "<li>" . _("to install the profile") . "</li>";
248
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
247
+        $out .= "<li>"._("to install the profile")."</li>";
248
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
249 249
         if ($certCount > 1) {
250
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
250
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
251 251
         }
252 252
         $out .= "</li>";
253
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
253
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
254 254
         if ($ssidCount > 1) {
255
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
255
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
256 256
         }
257 257
         $out .= "</li>";
258 258
         $out .= "</ul>";
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $retval .= "                <key>RoamingConsortiumOIs</key>
306 306
                 <array>";
307 307
 
308
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
308
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
309 309
 
310 310
         $retval .= "</array>";
311 311
         // this is an undocumented value found on the net. Does it do something useful?
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                   <dict>
347 347
                       <key>AcceptEAPTypes</key>
348 348
                          <array>
349
-                            <integer>" . $eapType['OUTER'] . "</integer>
349
+                            <integer>" . $eapType['OUTER']."</integer>
350 350
                          </array>
351 351
                       <key>EAPFASTProvisionPAC</key>
352 352
                             <true />
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 ";
360 360
         if ($realm !== NULL) {
361 361
             $retval .= "<key>OuterIdentity</key>
362
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
362
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
363 363
 ";
364 364
         }
365 365
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
         $retval .= "
384 384
                          </array>";
385 385
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
386
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
386
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
387 387
         }
388 388
         $retval .= "
389 389
                       <key>TTLSInnerAuthentication</key>
390
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
390
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
391 391
                    </dict>";
392 392
         return $retval;
393 393
     }
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
             // characters are still reversed, invert on use!
408 408
             $buffer .= "<string>Manual</string>
409 409
                   <key>ProxyServer</key>
410
-                  <string>" . strrev($serverAndPort[1]) . "</string>
410
+                  <string>" . strrev($serverAndPort[1])."</string>
411 411
                   <key>ProxyServerPort</key>
412
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
412
+                  <integer>" . strrev($serverAndPort[0])."</integer>
413 413
                   <key>ProxyPACFallbackAllowed</key>
414 414
                   <false/>";
415 415
         } else {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                     throw new Exception("SSID must be a string!");
439 439
                 }
440 440
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
441
-                $payloadIdentifier = "wifi." . $this->serial;
441
+                $payloadIdentifier = "wifi.".$this->serial;
442 442
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
443 443
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
444 444
                 $encryptionTypeString = "WPA";
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 $payloadIdentifier = "hs20.$toBeConfigured";
469 469
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
470 470
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
471
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
471
+                    $knownOiName = $this->instName." "._("Roaming Partner");
472 472
                 }
473 473
                 $payloadShortName = $knownOiName;
474 474
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
                <key>PayloadDisplayName</key>
491 491
                   <string>$payloadShortName</string>
492 492
                <key>PayloadIdentifier</key>
493
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
493
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
494 494
                <key>PayloadOrganization</key>
495
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
495
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
496 496
                <key>PayloadType</key>
497
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
497
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
498 498
         $retval .= $this->proxySettings();
499 499
         $retval .= $setupModesString;
500 500
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
         }
507 507
         $retval .= "
508 508
                <key>PayloadUUID</key>
509
-                  <string>" . \core\common\Entity::uuid() . "</string>
509
+                  <string>" . \core\common\Entity::uuid()."</string>
510 510
                <key>PayloadVersion</key>
511 511
                   <integer>1</integer>
512 512
                   $wifiNetworkIdentification</dict>";
@@ -536,15 +536,15 @@  discard block
 block discarded – undo
536 536
 	<key>IsHotspot</key>
537 537
 	<false/>
538 538
 	<key>PayloadDescription</key>
539
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
539
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
540 540
 	<key>PayloadDisplayName</key>
541
-	<string>" . _("Disabled WiFi network") . "</string>
541
+	<string>" . _("Disabled WiFi network")."</string>
542 542
 	<key>PayloadIdentifier</key>
543
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
543
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
544 544
 	<key>PayloadType</key>
545 545
 	<string>com.apple.wifi.managed</string>
546 546
 	<key>PayloadUUID</key>
547
-	<string>" . \core\common\Entity::uuid() . "</string>
547
+	<string>".\core\common\Entity::uuid()."</string>
548 548
 	<key>PayloadVersion</key>
549 549
 	<real>1</real>";
550 550
         $retval .= $this->proxySettings();
@@ -623,12 +623,12 @@  discard block
 block discarded – undo
623 623
         $mimeBlob = base64_encode($binaryBlob);
624 624
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
625 625
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
626
-        $retArray = ["block" => "<dict>" .
626
+        $retArray = ["block" => "<dict>".
627 627
             // we don't include the import password. It's displayed on screen, and should be input by the user.
628 628
             // <key>Password</key>
629 629
             //   <string>" . $this->clientCert['password'] . "</string>
630 630
             "<key>PayloadCertificateFileName</key>
631
-                     <string>" . $this->massagedConsortium . ".pfx</string>
631
+                     <string>" . $this->massagedConsortium.".pfx</string>
632 632
                   <key>PayloadContent</key>
633 633
                      <data>
634 634
 $mimeFormatted
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                   <key>PayloadDescription</key>
637 637
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
638 638
                   <key>PayloadDisplayName</key>
639
-                     <string>" . _("eduroam user certificate") . "</string>
639
+                     <string>"._("eduroam user certificate")."</string>
640 640
                   <key>PayloadIdentifier</key>
641 641
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
642 642
                   <key>PayloadType</key>
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                   <key>PayloadVersion</key>
647 647
                      <integer>1</integer>
648 648
                 </dict>",
649
-            "UUID" => $payloadUUID,];
649
+            "UUID" => $payloadUUID, ];
650 650
         \core\common\Entity::outOfThePotatoes();
651 651
         return $retArray;
652 652
     }
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         }
666 666
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
667 667
         return "<key>RemovalDate</key>
668
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
668
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
669 669
     }
670 670
 
671 671
     private $CAsAccountedFor = [];
@@ -689,27 +689,27 @@  discard block
 block discarded – undo
689 689
             $stream = "
690 690
             <dict>
691 691
                <key>PayloadCertificateFileName</key>
692
-               <string>" . $ca['uuid'] . ".der</string>
692
+               <string>" . $ca['uuid'].".der</string>
693 693
                <key>PayloadContent</key>
694 694
                <data>
695
-" . $trimmedPem . "</data>
695
+" . $trimmedPem."</data>
696 696
                <key>PayloadDescription</key>
697
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
697
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
698 698
                <key>PayloadDisplayName</key>
699 699
                <string>" . 
700 700
                     /// example: "Identity Provider CA #1 (Root)"
701
-                    sprintf(_("%s CA #%d (%s)" ), 
701
+                    sprintf(_("%s CA #%d (%s)"), 
702 702
                             \core\common\Entity::$nomenclature_inst, 
703
-                            count($this->CAsAccountedFor)+1, 
704
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
703
+                            count($this->CAsAccountedFor) + 1, 
704
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
705 705
               "</string>
706 706
                <key>PayloadIdentifier</key>
707
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
708 708
                <key>PayloadOrganization</key>
709
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
709
+               <string>".$this->massagedConsortium.".1x-config.org</string>
710 710
                <key>PayloadType</key>
711 711
                <string>com.apple.security.root</string>
712
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
712
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
713 713
                <key>PayloadVersion</key>
714 714
                <integer>1</integer>
715 715
             </dict>";
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 use \Exception;
37 37
 
38
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
38
+require_once dirname(dirname(__DIR__))."/config/_config.php";
39 39
 
40 40
 /**
41 41
  * Test suite to verify that an EAP setup is actually working as advertised in
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             }
169 169
         }
170 170
 
171
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
171
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
172 172
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
173 173
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
174 174
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
259 259
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
260 260
             }
261
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
261
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
262 262
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
263 263
             }
264 264
         }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) {
285 285
             $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
286 286
         }
287
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
287
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
288 288
         if ($intermediateCa['basicconstraints_set'] == 0) {
289 289
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
290 290
         }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     {
334 334
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
335 335
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
336
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
336
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
337 337
         if ($clientcert === FALSE) {
338 338
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
339 339
         }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
343 343
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
344 344
         }
345
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
345
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
346 346
     }
347 347
 
348 348
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
364 364
         }
365 365
         // first and second sub-match is the full URL... check it
366
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
366
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
367 367
         if ($crlcontent === FALSE) {
368 368
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
369 369
         }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
         // $pem = chunk_split(base64_encode($crlcontent), 64, "\n");
379 379
         // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php
380
-        $proc = CONFIG['PATHS']['openssl'] . " crl -inform der";
380
+        $proc = CONFIG['PATHS']['openssl']." crl -inform der";
381 381
         $descriptorspec = [
382 382
             0 => ["pipe", "r"],
383 383
             1 => ["pipe", "w"],
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         $origLength = strlen($hex);
417 417
         for ($i = 1; $i < $origLength; $i++) {
418 418
             if ($i % 2 == 1 && $i != strlen($hex)) {
419
-                $spaced .= $hex[$i] . " ";
419
+                $spaced .= $hex[$i]." ";
420 420
             } else {
421 421
                 $spaced .= $hex[$i];
422 422
             }
@@ -540,19 +540,19 @@  discard block
 block discarded – undo
540 540
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
541 541
         $config = '
542 542
 network={
543
-  ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing"
543
+  ssid="' . CONFIG['APPEARANCE']['productname'].' testing"
544 544
   key_mgmt=WPA-EAP
545 545
   proto=WPA2
546 546
   pairwise=CCMP
547 547
   group=CCMP
548 548
   ';
549 549
 // phase 1
550
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
550
+        $config .= 'eap='.$eapText['OUTER']."\n";
551 551
         $logConfig = $config;
552 552
 // phase 2 if applicable; all inner methods have passwords
553 553
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
554
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
555
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
554
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
555
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
556 556
         }
557 557
 // all methods set a password, except EAP-TLS
558 558
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -568,11 +568,11 @@  discard block
 block discarded – undo
568 568
         }
569 569
 
570 570
 // inner identity
571
-        $config .= '  identity="' . $inner . "\"\n";
572
-        $logConfig .= '  identity="' . $inner . "\"\n";
571
+        $config .= '  identity="'.$inner."\"\n";
572
+        $logConfig .= '  identity="'.$inner."\"\n";
573 573
 // outer identity, may be equal
574
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
575
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
574
+        $config .= '  anonymous_identity="'.$outer."\"\n";
575
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
576 576
 // done
577 577
         $config .= "}";
578 578
         $logConfig .= "}";
@@ -635,13 +635,13 @@  discard block
 block discarded – undo
635 635
      */
636 636
     private function eapolTestConfig($probeindex, $opName, $frag)
637 637
     {
638
-        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] .
639
-                " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] .
640
-                " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] .
641
-                " -o serverchain.pem" .
642
-                " -c ./udp_login_test.conf" .
643
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
644
-                " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " ";
638
+        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'].
639
+                " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'].
640
+                " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'].
641
+                " -o serverchain.pem".
642
+                " -c ./udp_login_test.conf".
643
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
644
+                " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." ";
645 645
         if ($opName) {
646 646
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
647 647
         }
@@ -671,10 +671,10 @@  discard block
 block discarded – undo
671 671
      */
672 672
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs)
673 673
     {
674
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
674
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
675 675
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
676 676
         }
677
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
677
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
678 678
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
679 679
         }
680 680
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -688,15 +688,15 @@  discard block
 block discarded – undo
688 688
             }
689 689
             if ($decoded['ca'] == 1) {
690 690
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
691
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
692
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
691
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
692
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
693 693
                     $catRoots[] = $decoded['pem'];
694 694
                 } else { // save the intermediates to allcerts directory
695
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
695
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
696 696
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
697 697
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
698 698
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
699
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
699
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
700 700
                     }
701 701
                     $catIntermediates[] = $decoded['pem'];
702 702
                 }
@@ -705,26 +705,26 @@  discard block
 block discarded – undo
705 705
         // save all intermediate certificates and CRLs to separate files in 
706 706
         // both root-ca directories
707 707
         foreach ($eapIntermediates as $index => $onePem) {
708
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
709
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
708
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
709
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
710 710
         }
711 711
         foreach ($eapIntermediateCRLs as $index => $onePem) {
712
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
713
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
712
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
713
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
714 714
         }
715 715
 
716 716
         $checkstring = "";
717 717
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
718 718
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
719 719
             $checkstring = "-crl_check_all";
720
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
721
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
720
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
721
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
722 722
         }
723 723
 
724 724
 
725 725
 // now c_rehash the root CA directory ...
726
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
727
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
726
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
727
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
728 728
         return $checkstring;
729 729
     }
730 730
 
@@ -756,12 +756,12 @@  discard block
 block discarded – undo
756 756
 // the error log will complain if we run this test against an empty file of certs
757 757
 // so test if there's something PEMy in the file at all
758 758
         if (filesize("$tmpDir/serverchain.pem") > 10) {
759
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
760
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
761
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
762
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
763
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
764
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
759
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
760
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
761
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
762
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
763
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
764
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
765 765
         }
766 766
 
767 767
 
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
         // we are UNHAPPY if no names match!
829 829
         $happiness = "UNHAPPY";
830 830
         foreach ($this->expectedServerNames as $expectedName) {
831
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
831
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
832 832
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
833 833
                 $this->loggerInstance->debug(4, "Totally happy!");
834 834
                 $happiness = "TOTALLY";
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
874 874
         // the config intentionally does not include CA checking. We do this
875 875
         // ourselves after getting the chain with -o.
876
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
876
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
877 877
 
878 878
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
879 879
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
880
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
880
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
881 881
         $time_start = microtime(true);
882 882
         $pflow = [];
883 883
         exec($cmdline, $pflow);
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
922 922
             array_pop($packetflow);
923 923
         }
924
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
924
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
925 925
         $packetcount = array_count_values($packetflow);
926 926
         $testresults['packetcount'] = $packetcount;
927 927
         $testresults['packetflow'] = $packetflow;
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
     private function wasModernTlsNegotiated(&$testresults, $packetflow_orig)
953 953
     {
954 954
         $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION);
955
-        $this->loggerInstance->debug(4,"TLS version found is: $negotiatedTlsVersion"."\n");
955
+        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n");
956 956
         if ($negotiatedTlsVersion == FALSE) {
957 957
             $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION;
958 958
         } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) {
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 
1013 1013
         $x509 = new \core\common\X509();
1014 1014
 // $eap_certarray holds all certs received in EAP conversation
1015
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
1015
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
1016 1016
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
1017 1017
             $eapCertArray = $x509->splitCertificate($incomingData);
1018 1018
         } else {
@@ -1042,10 +1042,10 @@  discard block
 block discarded – undo
1042 1042
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
1043 1043
                     $servercert[] = $cert;
1044 1044
                     if (count($servercert) == 1) {
1045
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
1045
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
1046 1046
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
1047 1047
                         }
1048
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
1048
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
1049 1049
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
1050 1050
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
1051 1051
                     }
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
         chdir($tmpDir);
1127 1127
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1128 1128
         if ($clientcertdata !== NULL) {
1129
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1129
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1130 1130
         }
1131 1131
         $testresults = [];
1132 1132
         // initialise the sub-array for cleaner parsing
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
                     'issuer' => $this->printDN($certdata['issuer']),
1228 1228
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1229 1229
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1230
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1230
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1231 1231
                     'sha1' => $certdata['sha1'],
1232 1232
                     'extensions' => $certdata['extensions']
1233 1233
                 ];
Please login to merge, or discard this patch.