Passed
Push — release_2_0 ( 42a179...456495 )
by Stefan
07:13
created
web/lib/admin/OptionDisplay.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 use Exception;
26 26
 
27
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
27
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
28 28
 
29 29
 /**
30 30
  * We need to display previously set options in various forms. This class covers
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @return string HTML code <table>
88 88
      */
89 89
     public function prefilledOptionTable(string $attributePrefix) {
90
-        $retval = "<table id='expandable_$attributePrefix" . "_options'>";
90
+        $retval = "<table id='expandable_$attributePrefix"."_options'>";
91 91
 
92 92
         $prepopulate = [];
93 93
         foreach ($this->listOfOptions as $existingAttribute) {
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
         if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" && CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != "LOCAL") {
120 120
             $blackListOnPrefill .= "|fed:silverbullet";
121 121
         }
122
-        if (is_array($prepopulate) && ( count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific")) { // editing... fill with values
122
+        if (is_array($prepopulate) && (count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific")) { // editing... fill with values
123 123
             foreach ($prepopulate as $option) {
124 124
                 if (preg_match("/$class:/", $option['name']) && !preg_match("/($blackListOnPrefill)/", $option['name'])) {
125 125
                     $optiontypearray = $optioninfo->optionType($option['name']);
126 126
                     $loggerInstance = new \core\common\Logging();
127 127
                     $loggerInstance->debug(5, "About to execute optiontext with PREFILL!\n");
128
-                    $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-' . $option['level'] . '-' . $option['row'] : $option['value']), $option['lang']);
128
+                    $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-'.$option['level'].'-'.$option['row'] : $option['value']), $option['lang']);
129 129
                 }
130 130
             }
131 131
         } else { // not editing exist, this in new: add empty list
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         if (!isset($descriptions[$input])) {
188 188
             return "";
189 189
         }
190
-        return "<span class='tooltip' id='S$rowid-tooltip-$input' style='display:" . ($isVisible ? "block" : "none") . "' onclick='alert(\"" . $descriptions[$input] . "\")'><img src='../resources/images/icons/question-mark-icon.png" . "'></span>";
190
+        return "<span class='tooltip' id='S$rowid-tooltip-$input' style='display:".($isVisible ? "block" : "none")."' onclick='alert(\"".$descriptions[$input]."\")'><img src='../resources/images/icons/question-mark-icon.png"."'></span>";
191 191
     }
192 192
 
193 193
     /**
@@ -200,18 +200,18 @@  discard block
 block discarded – undo
200 200
      */
201 201
     private function selectElement($rowid, $list) {
202 202
         $jsmagic = "onchange='
203
-                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
203
+                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid."-select\").value)) {
204 204
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
205 205
                                    } else {
206 206
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"none\";
207 207
                                    }";
208 208
         foreach (array_keys(OptionDisplay::HTML_DATATYPE_TEXTS) as $key) {
209
-            $jsmagic .= "if (/#" . $key . "#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
210
-                                  document.getElementById(\"S$rowid-input-file\").style.display = \"" . ($key == \core\Options::TYPECODE_FILE ? "block" : "none") . "\";
211
-                                  document.getElementById(\"S$rowid-input-text\").style.display = \"" . ($key == \core\Options::TYPECODE_TEXT ? "block" : "none") . "\";
212
-                                  document.getElementById(\"S$rowid-input-string\").style.display = \"" . ($key == \core\Options::TYPECODE_STRING ? "block" : "none") . "\";
213
-                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"" . ($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none") . "\";
214
-                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"" . ($key == \core\Options::TYPECODE_INTEGER ? "block" : "none") . "\";
209
+            $jsmagic .= "if (/#".$key."#/.test(document.getElementById(\"option-S".$rowid."-select\").value)) {
210
+                                  document.getElementById(\"S$rowid-input-file\").style.display = \"".($key == \core\Options::TYPECODE_FILE ? "block" : "none")."\";
211
+                                  document.getElementById(\"S$rowid-input-text\").style.display = \"".($key == \core\Options::TYPECODE_TEXT ? "block" : "none")."\";
212
+                                  document.getElementById(\"S$rowid-input-string\").style.display = \"".($key == \core\Options::TYPECODE_STRING ? "block" : "none")."\";
213
+                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"".($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none")."\";
214
+                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"".($key == \core\Options::TYPECODE_INTEGER ? "block" : "none")."\";
215 215
                              }
216 216
                              ";
217 217
             // hide all tooltips (each is a <span>, and there are no other <span>s)
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $activelisttype = [];
241 241
         foreach ($list as $value) {
242 242
             $listtype = $optioninfo->optionType($value);
243
-            $retval .= "<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ";
243
+            $retval .= "<option id='option-S$rowid-v-$value' value='$value#".$listtype["type"]."#".$listtype["flag"]."#' ";
244 244
             if ($iterator == $this->optionIterator) {
245 245
                 $retval .= "selected='selected'";
246 246
                 $activelisttype = $listtype;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             } else {
249 249
                 $tooltips .= $this->tooltip($rowid, $value, FALSE);
250 250
             }
251
-            $retval .= ">" . $uiElements->displayName($value) . "</option>";
251
+            $retval .= ">".$uiElements->displayName($value)."</option>";
252 252
             $iterator++;
253 253
         }
254 254
         if (count($activelisttype) == 0) {
@@ -271,9 +271,9 @@  discard block
 block discarded – undo
271 271
      */
272 272
     private function selectLanguage($rowid, $makeVisible) {
273 273
         \core\common\Entity::intoThePotatoes();
274
-        $retval = "<select style='display:" . ($makeVisible ? "block" : "none") . "' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect'>
275
-            <option value='' name='select_language' selected>" . _("select language") . "</option>
276
-            <option value='C' name='all_languages'>" . _("default/other languages") . "</option>";
274
+        $retval = "<select style='display:".($makeVisible ? "block" : "none")."' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect'>
275
+            <option value='' name='select_language' selected>" . _("select language")."</option>
276
+            <option value='C' name='all_languages'>" . _("default/other languages")."</option>";
277 277
         foreach (CONFIG['LANGUAGES'] as $langindex => $possibleLang) {
278 278
             $thislang = $possibleLang['display'];
279 279
             $retval .= "<option value='$langindex' name='$langindex'>$thislang</option>";
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     private function inputFields($rowid, $activetype) {
302 302
         $retval = "";
303 303
         foreach (OptionDisplay::HTML_DATATYPE_TEXTS as $key => $type) {
304
-            $retval .= "<" . $type['html'] . " style='display:" . ($activetype['type'] == $key ? "block" : "none") . "' name='value[S$rowid-$key]' id='S" . $rowid . "-input-" . $key . "'" . $type['tail'] . ">";
304
+            $retval .= "<".$type['html']." style='display:".($activetype['type'] == $key ? "block" : "none")."' name='value[S$rowid-$key]' id='S".$rowid."-input-".$key."'".$type['tail'].">";
305 305
         }
306 306
         return $retval;
307 307
     }
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
     private function noPrefillText(int $rowid, array $list) {
317 317
         // first column: the <select> element with the names of options and their field-toggling JS magic
318 318
         $selectorInfo = $this->selectElement($rowid, $list);
319
-        $retval = "<td>" . $selectorInfo["TEXT"] . "</td>";
319
+        $retval = "<td>".$selectorInfo["TEXT"]."</td>";
320 320
         // second column: the <select> element for language selection - only visible if the active option is multi-lang
321
-        $retval .= "<td>" . $this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML") . "</td>";
321
+        $retval .= "<td>".$this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML")."</td>";
322 322
         // third column: the actual input fields; the data type of the active option is visible, all others hidden
323
-        $retval .= "<td>" . $this->inputFields($rowid, $selectorInfo['ACTIVE']) . "</td>";
323
+        $retval .= "<td>".$this->inputFields($rowid, $selectorInfo['ACTIVE'])."</td>";
324 324
         return $retval;
325 325
     }
326 326
 
@@ -343,20 +343,20 @@  discard block
 block discarded – undo
343 343
         $retval .= "<td>";
344 344
         $uiElements = new UIElements();
345 345
         $listtype = $optioninfo->optionType($optionName);
346
-        $retval .= "<span style='display:flex;'>" . $uiElements->displayName($optionName);
347
-        $retval .= $this->tooltip($rowid, $optionName, TRUE) . "</span>";
348
-        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ></td>";
346
+        $retval .= "<span style='display:flex;'>".$uiElements->displayName($optionName);
347
+        $retval .= $this->tooltip($rowid, $optionName, TRUE)."</span>";
348
+        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#".$listtype["type"]."#".$listtype["flag"]."#' ></td>";
349 349
 
350 350
         // language tag if any
351 351
         $retval .= "<td>";
352 352
         if ($listtype["flag"] == "ML") {
353 353
 
354
-            $language = "(" . strtoupper($optionLang) . ")";
354
+            $language = "(".strtoupper($optionLang).")";
355 355
             if ($optionLang == 'C') {
356 356
                 $language = _("(default/other languages)");
357 357
             }
358 358
             $retval .= $language;
359
-            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect' value='" . $optionLang . "' style='display:block'>";
359
+            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect' value='".$optionLang."' style='display:block'>";
360 360
         }
361 361
         $retval .= "</td>";
362 362
 // attribute content
@@ -366,12 +366,12 @@  discard block
 block discarded – undo
366 366
             case \core\Options::TYPECODE_COORDINATES:
367 367
                 $this->allLocationCount = $this->allLocationCount + 1;
368 368
                 // display of the locations varies by map provider
369
-                $classname = "\web\lib\admin\Map" . CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'];
369
+                $classname = "\web\lib\admin\Map".CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'];
370 370
                 $link = $classname::optionListDisplayCode($optionValue, $this->allLocationCount);
371
-                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-" . \core\Options::TYPECODE_TEXT . "]' id='S$rowid-input-text' value='$optionValue'>$link";
371
+                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-".\core\Options::TYPECODE_TEXT."]' id='S$rowid-input-text' value='$optionValue'>$link";
372 372
                 break;
373 373
             case \core\Options::TYPECODE_FILE:
374
-                $retval .= "<input readonly type='text' name='value[S$rowid-" . \core\Options::TYPECODE_STRING . "]' id='S" . $rowid . "-input-string' style='display:none' value='" . urlencode($optionValue) . "'>";
374
+                $retval .= "<input readonly type='text' name='value[S$rowid-".\core\Options::TYPECODE_STRING."]' id='S".$rowid."-input-string' style='display:none' value='".urlencode($optionValue)."'>";
375 375
                 $uiElements = new UIElements();
376 376
                 switch ($optionName) {
377 377
                     case "eap:ca_file":
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                 if ($listtype['type'] == \core\Options::TYPECODE_BOOLEAN) {// only modify in this one case
402 402
                     $displayedVariant = ($optionValue == "on" ? _("on") : _("off"));
403 403
                 }
404
-                $retval .= "<strong>$displayedVariant</strong><input type='hidden' name='value[S$rowid-" . $listtype['type'] . "]' id='S" . $rowid . "-input-" . $listtype["type"] . "' value=\"" . htmlspecialchars($optionValue) . "\" style='display:block'>";
404
+                $retval .= "<strong>$displayedVariant</strong><input type='hidden' name='value[S$rowid-".$listtype['type']."]' id='S".$rowid."-input-".$listtype["type"]."' value=\"".htmlspecialchars($optionValue)."\" style='display:block'>";
405 405
                 break;
406 406
             default:
407 407
                 // this should never happen!
@@ -445,10 +445,10 @@  discard block
 block discarded – undo
445 445
        <td>
446 446
           <button type='button' class='delete' onclick='";
447 447
         if ($prefillValue !== NULL && $item == "general:geo_coordinates") {
448
-            $funcname = "Map" . CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'] . 'DeleteCoord';
449
-            $retval .= 'if (typeof ' . $funcname . ' === "function") { ' . $funcname . '(' . $this->allLocationCount . '); } ';
448
+            $funcname = "Map".CONFIG_CONFASSISTANT['MAPPROVIDER']['PROVIDER'].'DeleteCoord';
449
+            $retval .= 'if (typeof '.$funcname.' === "function") { '.$funcname.'('.$this->allLocationCount.'); } ';
450 450
         }
451
-        $retval .= 'deleteOption("option-S' . $rowid . '")';
451
+        $retval .= 'deleteOption("option-S'.$rowid.'")';
452 452
         $retval .= "'>-</button>
453 453
        </td>
454 454
     </tr>";
Please login to merge, or discard this patch.
web/lib/admin/API.php 1 patch
Spacing   +17 added lines, -17 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(dirname(dirname(__FILE__)))) . "/config/_config.php";
26
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
27 27
 
28 28
 class API {
29 29
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     const ACTIONS = [
85 85
         # inst-level actions
86 86
         API::ACTION_NEWINST_BY_REF => [
87
-            "REQ" => [API::AUXATTRIB_EXTERNALID,],
87
+            "REQ" => [API::AUXATTRIB_EXTERNALID, ],
88 88
             "OPT" => [
89 89
                 'general:geo_coordinates',
90 90
                 'general:logo_file',
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             "OPT" => [API::AUXATTRIB_TARGETMAIL],
145 145
             "RETVAL" => [
146 146
                 ["TOKEN URL", 
147
-                 "EMAIL SENT",              // dependent on TARGETMAIL input
147
+                 "EMAIL SENT", // dependent on TARGETMAIL input
148 148
                  "EMAIL TRANSPORT SECURE"], // dependent on TARGETMAIL input
149 149
             ]
150 150
         ],
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         API::ACTION_ENDUSER_NEW => [
207 207
             "REQ" => [API::AUXATTRIB_CAT_PROFILE_ID, API::AUXATTRIB_SB_USERNAME, API::AUXATTRIB_SB_EXPIRY],
208 208
             "OPT" => [],
209
-            "RETVAL" => [ API::AUXATTRIB_SB_USERNAME, API::AUXATTRIB_SB_USERID ],
209
+            "RETVAL" => [API::AUXATTRIB_SB_USERNAME, API::AUXATTRIB_SB_USERID],
210 210
         ],
211 211
         API::ACTION_ENDUSER_DEACTIVATE => [
212 212
             "REQ" => [API::AUXATTRIB_CAT_PROFILE_ID, API::AUXATTRIB_SB_USERID],
@@ -217,14 +217,14 @@  discard block
 block discarded – undo
217 217
             "REQ" => [API::AUXATTRIB_CAT_PROFILE_ID],
218 218
             "OPT" => [],
219 219
             "RETVAL" => [
220
-                [ API::AUXATTRIB_SB_USERID => API::AUXATTRIB_SB_USERNAME],
220
+                [API::AUXATTRIB_SB_USERID => API::AUXATTRIB_SB_USERNAME],
221 221
             ],
222 222
         ],
223 223
         API::ACTION_ENDUSER_IDENTIFY => [
224 224
             "REQ" => [API::AUXATTRIB_CAT_PROFILE_ID],
225 225
             "OPT" => [API::AUXATTRIB_SB_USERID, API::AUXATTRIB_SB_USERNAME, API::AUXATTRIB_SB_CERTSERIAL],
226 226
             "RETVAL" => [
227
-                [ API::AUXATTRIB_SB_USERID => API::AUXATTRIB_SB_USERNAME],
227
+                [API::AUXATTRIB_SB_USERID => API::AUXATTRIB_SB_USERNAME],
228 228
             ],
229 229
         ],
230 230
 
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
             "RETVAL" => [
235 235
                 API::AUXATTRIB_TOKENURL, 
236 236
                 API::AUXATTRIB_TOKEN, 
237
-                "EMAIL SENT",             // dependent on TARGETMAIL input
237
+                "EMAIL SENT", // dependent on TARGETMAIL input
238 238
                 "EMAIL TRANSPORT SECURE", // dependent on TARGETMAIL input
239
-                "SMS SENT",               // dependent on TARGETSMS input
239
+                "SMS SENT", // dependent on TARGETSMS input
240 240
             ]
241 241
         ],
242 242
         API::ACTION_TOKEN_REVOKE => [
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             "REQ" => [API::AUXATTRIB_CAT_PROFILE_ID, API::AUXATTRIB_SB_USERID],
256 256
             "OPT" => [],
257 257
             "RETVAL" => [
258
-                [ API::AUXATTRIB_SB_CERTSERIAL => ["ISSUED", "EXPIRY", "STATUS", "DEVICE", "CN" ]]
258
+                [API::AUXATTRIB_SB_CERTSERIAL => ["ISSUED", "EXPIRY", "STATUS", "DEVICE", "CN"]]
259 259
             ]
260 260
         ],
261 261
         API::ACTION_CERT_REVOKE => [
@@ -386,8 +386,8 @@  discard block
 block discarded – undo
386 386
 
387 387
                 case \core\Options::TYPECODE_COORDINATES:
388 388
                     $extension = \core\Options::TYPECODE_TEXT;
389
-                    $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#";
390
-                    $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE'];
389
+                    $coercedInline["option"][$basename] = $oneAttrib['NAME']."#";
390
+                    $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE'];
391 391
                     break;
392 392
                 case \core\Options::TYPECODE_TEXT:
393 393
                 // fall-through: they all get the same treatment
@@ -397,19 +397,19 @@  discard block
 block discarded – undo
397 397
                 // fall-through: they all get the same treatment
398 398
                 case \core\Options::TYPECODE_INTEGER:
399 399
                     $extension = $optionInfo['type'];
400
-                    $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#";
401
-                    $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE'];
400
+                    $coercedInline["option"][$basename] = $oneAttrib['NAME']."#";
401
+                    $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE'];
402 402
                     if ($optionInfo['flag'] == "ML") {
403
-                        $coercedInline["value"][$basename . "-lang"] = $oneAttrib['LANG'];
403
+                        $coercedInline["value"][$basename."-lang"] = $oneAttrib['LANG'];
404 404
                     }
405 405
                     break;
406 406
                 case \core\Options::TYPECODE_FILE:
407 407
                     // binary data is expected in base64 encoding. This is true
408 408
                     // also for PEM files!
409 409
                     $extension = $optionInfo['type'];
410
-                    $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#";
411
-                    file_put_contents($dir['dir'] . "/" . $basename . "-" . $extension, base64_decode($oneAttrib['VALUE']));
412
-                    $coercedFile["value"]['tmp_name'][$basename . "-" . $extension] = $dir['dir'] . "/" . $basename . "-" . $extension;
410
+                    $coercedInline["option"][$basename] = $oneAttrib['NAME']."#";
411
+                    file_put_contents($dir['dir']."/".$basename."-".$extension, base64_decode($oneAttrib['VALUE']));
412
+                    $coercedFile["value"]['tmp_name'][$basename."-".$extension] = $dir['dir']."/".$basename."-".$extension;
413 413
                     break;
414 414
                 default:
415 415
                     throw new Exception("We don't seem to know this type code!");
Please login to merge, or discard this patch.
devices/ms/Files/common.inc 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 !define MUI_HEADERIMAGE_BITMAP "cat_150.bmp"
136 136
 !define MUI_COMPONENTSPAGE_SMALLDESC
137 137
 
138
-!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>"
139
-!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi( _("Installation complete"))?>"
140
-!define FAREWELL_TEXT	"<?php WindowsCommon::echo_nsi( _("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(  _("Your system is ready."))?>"
141
-!define FAREWELL_FAIL	"<?php WindowsCommon::echo_nsi( _("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi( _("Please contact \${SUPPORT}."))?>"
138
+!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>"
139
+!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi(_("Installation complete"))?>"
140
+!define FAREWELL_TEXT	"<?php WindowsCommon::echo_nsi(_("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Your system is ready."))?>"
141
+!define FAREWELL_FAIL	"<?php WindowsCommon::echo_nsi(_("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Please contact \${SUPPORT}."))?>"
142 142
 ;--------------------------------
143 143
 ;Languages
144 144
 !insertmacro MUI_LANGUAGE "${LANG}"
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 ;--------------------------------
147 147
 ; License file
148 148
 !ifdef LICENSE_FILE
149
-LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi( _("Accept"))?>"
149
+LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi(_("Accept"))?>"
150 150
 LicenseText "<?php WindowsCommon::echo_nsi(_("If you accept the conditions then select Accept and then click Install to continue."))?>"
151 151
 LicenseData ${LICENSE_FILE}
152 152
 !endif
153 153
 
154 154
 ;-----------------------------------
155 155
 
156
-MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi( _("Finish"))?>"
156
+MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi(_("Finish"))?>"
157 157
 ;----------------------------------
158 158
 ;  FUNCTIONS
159 159
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 !macro install_ca_cert ca_file ca_fingerprint level
188 188
    !insertmacro debug_cat 2 "locating certificate  SHA=${ca_fingerprint} Level=${level}"
189
-   DetailPrint "<?php WindowsCommon::echo_nsi( _("searching for certificate"))?> ${ca_file}"
189
+   DetailPrint "<?php WindowsCommon::echo_nsi(_("searching for certificate"))?> ${ca_file}"
190 190
    File "${ca_file}"
191 191
    nsArray::Set Delete_files "${ca_file}"
192 192
    !insertmacro debug_cat 2 "Testing machine store root"
@@ -248,13 +248,13 @@  discard block
 block discarded – undo
248 248
    ${EndIf}
249 249
    !insertmacro debug_cat 2 "installing certificate $TEMP\${ca_file}"
250 250
    !insertmacro debug_cat 3 "Execute: certutil -addstore -user ${level} $TEMP\${ca_file}"
251
-   DetailPrint "<?php WindowsCommon::echo_nsi( _("installing certificate"))?> ${ca_file}"
251
+   DetailPrint "<?php WindowsCommon::echo_nsi(_("installing certificate"))?> ${ca_file}"
252 252
    nsExec::Exec '"certutil" -addstore -user ${level} "$TEMP"\${ca_file}'
253 253
    Pop $0
254 254
    !insertmacro debug_cat 3 "certutil returned $0"
255 255
    ${If} $0 != 0
256 256
      IfSilent +2
257
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("could not install certificate"))?>  ${ca_file}"
257
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("could not install certificate"))?>  ${ca_file}"
258 258
      !insertmacro debug_cat 1 "could not install certificate ${ca_file}"
259 259
    ${EndIf}
260 260
 no_install_${ca_file}:
@@ -461,26 +461,26 @@  discard block
 block discarded – undo
461 461
   pop $R0
462 462
   ${If} $tkip_count > 0
463 463
     ${If} $aes_count > 1
464
-      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
464
+      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
465 465
     ${Else}
466
-     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
466
+     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
467 467
     ${EndIf}
468 468
   ${Else}
469 469
     StrCpy $R1 ""
470 470
   ${EndIf}
471 471
   ${If} $profile_count > 0
472
-    StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
473
-<?php WindowsCommon::echo_nsi( _("The installer will create the following wireless profiles:"))?>$\r$\n\
472
+    StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
473
+<?php WindowsCommon::echo_nsi(_("The installer will create the following wireless profiles:"))?>$\r$\n\
474 474
 $R0.\
475 475
 $R1$\r$\n$\n\
476
-<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\
476
+<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\
477 477
    EMAIL: ${SUPPORT}$\r$\n\
478 478
    WWW: ${URL}"
479 479
 ${Else}
480
-StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
481
-<?php WindowsCommon::echo_nsi( _("The installer will create the wireless profile:"))?> $R0.\
480
+StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
481
+<?php WindowsCommon::echo_nsi(_("The installer will create the wireless profile:"))?> $R0.\
482 482
 $R1$\r$\n$\n\
483
-<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\
483
+<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\
484 484
    EMAIL: ${SUPPORT}$\r$\n\
485 485
    WWW: ${URL}"
486 486
 ${EndIf}
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
   SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
507 507
 ;TRANSLATION
508 508
   nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 46u -130u -32u "$welcome_message\
509
-$\r$\n$\r$\n<?php WindowsCommon::echo_nsi( _("Installer created with software from the GEANT project."))?>"
509
+$\r$\n$\r$\n<?php WindowsCommon::echo_nsi(_("Installer created with software from the GEANT project."))?>"
510 510
   Pop $TEXT
511 511
 
512 512
   SetCtlColors $DIALOG "" 0xffffff
@@ -619,18 +619,18 @@  discard block
 block discarded – undo
619 619
     ${If} $wireless_result == 1
620 620
       !insertmacro debug_cat 1 "wlan_test.exe did not find wireless configuration service"
621 621
       IfSilent +2
622
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
622
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
623 623
       Call Cleanup
624 624
     ${EndIf}
625 625
     ${If} $wireless_result == 2
626 626
       IfSilent +2
627
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. The installer cannot continue."))?>"
627
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. The installer cannot continue."))?>"
628 628
       Call Cleanup
629 629
     ${EndIf}
630 630
   ${Else}
631 631
     ${If} $wireless_result > 0
632 632
        IfSilent +3
633
-       MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
633
+       MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
634 634
        Call Cleanup
635 635
        wired_yes:
636 636
        Push 1
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
     ${If} $wired == 1
647 647
       ${If} $force_wired == 0
648 648
         IfSilent wired
649
-        MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("Do you want to enable access on wired interfaces?"))?>" IDYES wired
649
+        MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("Do you want to enable access on wired interfaces?"))?>" IDYES wired
650 650
         Push 0
651 651
         Pop $wired
652 652
       ${EndIf}
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 ;================================
688 688
 
689 689
 Function ShowInstfiles
690
-  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Profiles installation"))?>" " "
690
+  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Profiles installation"))?>" " "
691 691
 FunctionEnd
692 692
 ;================================
693 693
 ;  Check if a wireless profile exist and put it on delete list
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 Function FindProfile
708 708
   Pop $R8
709
-  DetailPrint "<?php WindowsCommon::echo_nsi( _("Checking for profile \$R8"))?>"
709
+  DetailPrint "<?php WindowsCommon::echo_nsi(_("Checking for profile \$R8"))?>"
710 710
   !insertmacro debug_cat 2 "Checking for profile $R8"
711 711
   !insertmacro debug_cat 3 "Exec: $Netsh wlan show profiles $R8"
712 712
   nsExec::Exec  '"$Netsh" wlan show profiles "$R8"'
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
   !insertmacro debug_cat 4 "netsh returned $0"
715 715
   ${If} $0 == 0
716 716
     !insertmacro debug_cat 1 "found profile $R8"
717
-    DetailPrint "<?php WindowsCommon::echo_nsi( _("found profile \$R8"))?>"
717
+    DetailPrint "<?php WindowsCommon::echo_nsi(_("found profile \$R8"))?>"
718 718
     Push 0
719 719
   ${Else}
720 720
     !insertmacro debug_cat 1 "profile $R8 not found"
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
     ${If} $Symantec_installed  != 0
810 810
      !insertmacro debug_cat 3 "Symantec problem"
811 811
      IfSilent +2
812
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>"
812
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>"
813 813
     Exec '"explorer" /select,"$EXEDIR\inst_cat.cmd"'
814 814
     Quit
815 815
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 Function PFXCertificateSelect
1098 1098
   !ifndef SILVERBULLET
1099 1099
 ;TRANSLATION
1100
-!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>"
1100
+!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>"
1101 1101
 ;TRANSLATION
1102 1102
     IfSilent +2
1103 1103
   MessageBox MB_OK "<?php WindowsCommon::echo_nsi(_("Preparing to install personal certificate."))?>$\r$\n<?php WindowsCommon::echo_nsi(_("Click OK to continue"))?> "
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
         $certPasswordLength = strlen($certPasswordLabel);
1114 1114
         $certUsernameLabel = WindowsCommon::sprint_nsi(_("Username:"));
1115 1115
         $certUsernameLength = strlen($certUsernameLabel);
1116
-        $labelLength = max($certPasswordLength,$certUsernameLength);
1116
+        $labelLength = max($certPasswordLength, $certUsernameLength);
1117 1117
   ?>
1118 1118
   ${NSD_CreateLabel} 0 0 100% 32u "<?php WindowsCommon::echo_nsi(_("Selected file: \$Cert_file"))?>"
1119 1119
   !else
@@ -1130,11 +1130,11 @@  discard block
 block discarded – undo
1130 1130
   !insertmacro debug_cat 3 "Vista level (Vista without Service pack): $VistaNoSP";
1131 1131
   ${If} $VistaNoSP == 0
1132 1132
     !ifdef PFX_USERNAME
1133
-       !define LABEL_LENGTH "<?php echo($labelLength*3.5)?>u"
1134
-       !define TEXT_START "<?php echo($labelLength*3.5 +5)?>u"
1133
+       !define LABEL_LENGTH "<?php echo($labelLength * 3.5)?>u"
1134
+       !define TEXT_START "<?php echo($labelLength * 3.5 + 5)?>u"
1135 1135
     !else
1136
-       !define LABEL_LENGTH "<?php echo($certPasswordLength*3.5)?>u"
1137
-       !define TEXT_START "<?php echo($certPasswordLength*3.5 +5)?>u"
1136
+       !define LABEL_LENGTH "<?php echo($certPasswordLength * 3.5)?>u"
1137
+       !define TEXT_START "<?php echo($certPasswordLength * 3.5 + 5)?>u"
1138 1138
     !endif
1139 1139
     ${NSD_CreateLabel} 0 35u ${LABEL_LENGTH} 12u "<?php echo $certPasswordLabel?>"
1140 1140
     ${NSD_CreatePassword} ${TEXT_START} 34.5u 120u 12u ""
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
 Section "-start"
1497 1497
 SectionIn RO
1498 1498
 
1499
-!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Installation"))?>" "<?php WindowsCommon::echo_nsi( _("Checking for existing wireless profiles"))?>"
1499
+!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Installation"))?>" "<?php WindowsCommon::echo_nsi(_("Checking for existing wireless profiles"))?>"
1500 1500
 !ifndef PWD
1501 1501
 !include "certs.nsh"
1502 1502
 !endif
Please login to merge, or discard this patch.
web/admin/API.php 1 patch
Spacing   +7 added lines, -7 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
 /**
26 26
  * Checks if the profile is a valid SB profile belonging to the federation
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 $inputRaw = file_get_contents('php://input');
70 70
 $inputDecoded = json_decode($inputRaw, TRUE);
71 71
 if (!is_array($inputDecoded)) {
72
-    $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data." . json_last_error_msg() . $inputRaw);
72
+    $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data.".json_last_error_msg().$inputRaw);
73 73
     exit(1);
74 74
 }
75 75
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             throw new Exception("A required parameter is missing, and this wasn't caught earlier?!");
159 159
         }
160 160
         $newtokens = $mgmt->createTokens(true, [$admin], $idp);
161
-        $URL = "https://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/action_enrollment.php?token=" . array_keys($newtokens)[0];
161
+        $URL = "https://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/action_enrollment.php?token=".array_keys($newtokens)[0];
162 162
         $success = ["TOKEN URL" => $URL, "TOKEN" => array_keys($newtokens)[0]];
163 163
         // done with the essentials - display in response. But if we also have an email address, send it there
164 164
         $email = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_TARGETMAIL);
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         if ($found) {
196 196
             $adminApi->returnSuccess([]);
197 197
         }
198
-        $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP " . $idp->identifier);
198
+        $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP ".$idp->identifier);
199 199
         break;
200 200
     case web\lib\admin\API::ACTION_STATISTICS_FED:
201 201
         $adminApi->returnSuccess($fed->downloadStats("array"));
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
                 $outer = "";
243 243
                 $profile->setAnonymousIDSupport(FALSE);
244 244
             } else {
245
-                $outer = $outer . "@";
245
+                $outer = $outer."@";
246 246
                 $profile->setAnonymousIDSupport(TRUE);
247 247
             }
248
-            $profile->setRealm($outer . $realm);
248
+            $profile->setRealm($outer.$realm);
249 249
         }
250 250
         /* const AUXATTRIB_PROFILE_TESTUSER = 'ATTRIB-PROFILE-TESTUSER'; */
251 251
         $testuser = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_PROFILE_TESTUSER);
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         // extract relevant subset of information from cert objects
474 474
         $certDetails = [];
475 475
         foreach ($certs as $cert) {
476
-            $certDetails[$cert->ca_type . ":" . $cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation];
476
+            $certDetails[$cert->ca_type.":".$cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation];
477 477
         }
478 478
         $adminApi->returnSuccess($certDetails);
479 479
         break;
Please login to merge, or discard this patch.
core/diag/Sociopath.php 1 patch
Spacing   +9 added lines, -9 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
  * This class talks to end users, asking them annoying questions to get to the
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                   "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
76 76
                   "FACTOR_YES" => 0.6, // that's good, and somewhat encouraging
77 77
                   "FACTOR_NO" => 3, // that is almost a smoking gun
78
-                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"),$confAssistantText)],
78
+                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at your home organisation, but can not be used when roaming. %s"), $confAssistantText)],
79 79
             3 => ["AREA" => AbstractTest::INFRA_DEVICE, 
80 80
                   "TXT" => _("Did you recently change the configuration on your device?"), 
81 81
                   "FACTOR_YES" => 3, // that is almost a smoking gun
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                   "TXT" => _("If you use more than one device: do your other devices still work?"),
91 91
                   "FACTOR_YES" => 0.33, // seems that all is okay with the account as such
92 92
                   "FACTOR_NO" => 3, // now that is suspicious indeed
93
-                  "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"),],
93
+                  "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"), ],
94 94
             6 => ["AREA" => AbstractTest::INFRA_SP_80211, 
95 95
                   "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), 
96 96
                   "FACTOR_YES" => 3,
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         $questionDetails = $this->qaArray[$questionNumber];
125 125
         if ($answer === TRUE) {
126 126
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_YES"];
127
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n");
127
+            $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n");
128 128
             $factor = $questionDetails["FACTOR_YES"];
129 129
         } elseif ($answer === FALSE) {
130 130
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_NO"];
131
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n");
131
+            $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n");
132 132
             $factor = $questionDetails["FACTOR_NO"];
133 133
         } else {
134 134
             $factor = 1;
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
         $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions;
139 139
         $_SESSION["SUSPECTS"] = $this->possibleFailureReasons;
140 140
         $_SESSION["EVIDENCE"] = $this->additionalFindings;
141
-        $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']);
142
-        $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']);
141
+        $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']);
142
+        $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']);
143 143
     }
144 144
     
145 145
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         // if both are identical, take any of the questions in the pool of both
159 159
         foreach ($this->qaArray as $questionNumber => $questionDetails) {
160 160
             // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it
161
-            if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) {
161
+            if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) {
162 162
                 return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]);
163 163
             }
164 164
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @return string JSON encoded array with all the info we have
172 172
      */
173 173
     public function getCurrentGuessState() {
174
-        return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]);
174
+        return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]);
175 175
     }
176 176
     
177 177
     /**
Please login to merge, or discard this patch.
web/diag/diag.php 1 patch
Spacing   +2 added lines, -2 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
 $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT);
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $isauth = 0;
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
 }
32 32
 $Gui = new \web\lib\user\Gui();
33 33
 $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? CONFIG['APPEARANCE']['skins'][0]);
34
-require "../skins/" . $skinObject->skin . "/diag/diag.php";
34
+require "../skins/".$skinObject->skin."/diag/diag.php";
35 35
 
36 36
 
Please login to merge, or discard this patch.
web/skins/modern/diag/diag.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function my_nonce($optSalt = '') {
29 29
     $remote = filter_input(INPUT_SERVER, 'REMOTE_ADDR');
30
-    return hash_hmac('sha256', session_id() . $optSalt, date("YmdG") . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote);
30
+    return hash_hmac('sha256', session_id().$optSalt, date("YmdG").'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote);
31 31
 }
32 32
 error_reporting(E_ALL | E_STRICT);
33 33
 $Gui->defaultPagePrelude();
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
 <?php
52 52
 $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT);
53 53
 $profile_list_size = 1;
54
-require_once dirname(__DIR__) . '/Divs.php';
54
+require_once dirname(__DIR__).'/Divs.php';
55 55
 $divs = new Divs($Gui);
56 56
 $visibility = 'index';
57 57
 $operatingSystem = $Gui->detectOS();
58 58
 $Gui->loggerInstance->debug(4, $operatingSystem);
59 59
 $uiElements = new web\lib\admin\UIElements();
60 60
 if ($operatingSystem) {
61
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
61
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
62 62
 }
63
-require dirname(__DIR__) . '/user/js/cat_js.php';
63
+require dirname(__DIR__).'/user/js/cat_js.php';
64 64
 ?>
65 65
 
66 66
 </script>
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
             <?php echo $divs->div_pagetitle(_("Diagnostics site"), ""); ?>
94 94
             <div id="user_info" style='padding-top: 10px;'>
95 95
             <div id='diagnostic_choice'>
96
-                <?php echo _("The diagnostics system will do its best to identify and resolve your problems!") . ' ' . _("Please help the system by answering the questions as precisely as possible.") . "<br/>" . _("Are you a") . ' '; ?>
97
-                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user") . ' ' . _("or"); ?>   
98
-                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator") .'?'; ?>
96
+                <?php echo _("The diagnostics system will do its best to identify and resolve your problems!").' '._("Please help the system by answering the questions as precisely as possible.")."<br/>"._("Are you a").' '; ?>
97
+                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user").' '._("or"); ?>   
98
+                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator").'?'; ?>
99 99
             </div>
100 100
             <div id='diagnostic_enduser' style='display: none;'>
101 101
                 <h2><?php echo _("Tools for End Users"); ?></h2>
@@ -105,24 +105,24 @@  discard block
 block discarded – undo
105 105
                 ?>
106 106
                 </p>
107 107
                 <?php
108
-                    echo '<div id="before_stage_1"><h3>' . _("The system needs some information on your home institution - issuer of your account") . '</h3>';
108
+                    echo '<div id="before_stage_1"><h3>'._("The system needs some information on your home institution - issuer of your account").'</h3>';
109 109
                     echo _("What is the realm part of your user account (the part behind the @ of 'your.username@<b>realm.tld</b>):");
110 110
                 ?>
111 111
                 <input type='text' name='user_realm' id='user_realm' value=''>
112 112
                 <?php
113
-                    echo '<div id="realm_by_select"><br/>' . _("alternatively") . '<br/>';
114
-                    echo _("You can select your home institution from the following list") . '<br/>';
113
+                    echo '<div id="realm_by_select"><br/>'._("alternatively").'<br/>';
114
+                    echo _("You can select your home institution from the following list").'<br/>';
115 115
                     echo '<div id="select_idp_country"><a href="" id="idp_countries_list">';    
116
-                    echo '<span id="realmselect">' . _("Click to select your country/region and organisation") . '</span></a></div>';
116
+                    echo '<span id="realmselect">'._("Click to select your country/region and organisation").'</span></a></div>';
117 117
                 ?>
118 118
                 <div id="select_idp_area" style="display:none;">
119 119
                 </div>
120 120
                 </div>
121 121
                 <div id="position_info">
122 122
                     <?php
123
-                        echo '<h3>' . _("Optionally, to improve tests, you can provide information on your current location") . '</h3>';
123
+                        echo '<h3>'._("Optionally, to improve tests, you can provide information on your current location").'</h3>';
124 124
                         echo '<div id="select_sp_country"><a href="" id="sp_countries_list">';    
125
-                        echo '<span id="spselect">' . _("Click to select a location in which you have an eduroam problem") . '</span></a></div>';
125
+                        echo '<span id="spselect">'._("Click to select a location in which you have an eduroam problem").'</span></a></div>';
126 126
                     ?>
127 127
                     <div id="select_sp_area" style="display:none;">
128 128
                     </div>
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
                             echo 'none';
156 156
                         }
157 157
                         echo ";'>";
158
-                        echo '<h3>' . _("Which problem are you reporting?") . '</h3>';
158
+                        echo '<h3>'._("Which problem are you reporting?").'</h3>';
159 159
                         echo '<input type="radio" name="problem_type" value="1">';
160
-                        echo _("SP contacting IdP due to technical problems or abuse") . '<br>';
160
+                        echo _("SP contacting IdP due to technical problems or abuse").'<br>';
161 161
                         echo '<input type="radio" name="problem_type" value="2">';
162 162
                         echo _("IdP contacting SP due to technical problems");
163 163
                         echo "<div id='idp_contact_area'></div>";
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
                         echo "</div>"; 
167 167
                     } else {
168 168
                         echo "0\">";
169
-                        echo _("This service is for authenticated admins only.") . '<br>';
170
-                        echo "<a href=\"diag.php?admin=1\">" .
171
-                            _("eduroam® admin access is needed") . "</a>";
169
+                        echo _("This service is for authenticated admins only.").'<br>';
170
+                        echo "<a href=\"diag.php?admin=1\">".
171
+                            _("eduroam® admin access is needed")."</a>";
172 172
                     }
173 173
                 ?>
174 174
             </div> 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         if (type === 'idp' || type === 'sp') {
193 193
             shtml = '<table><tbody><tr id="row_'+type+'_country"></tr>';
194 194
             shtml = shtml + '<tr id="row_'+type+'_institution" style="visibility: collapse;">';
195
-            shtml = shtml + '<td>' + <?php echo '"' . _("Select institiution:") . '"'; ?> + '</td><td></td></tr>';
195
+            shtml = shtml + '<td>' + <?php echo '"'._("Select institiution:").'"'; ?> + '</td><td></td></tr>';
196 196
             if (type === 'idp') {
197 197
                 shtml = shtml + '<tr id="row_idp_realm"></tr>';
198 198
             }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         var options = '';
219 219
         var selecthead = '';
220 220
         if (type1 === 'sp' || type1 === 'idp') {
221
-            selecthead = <?php echo '"<td>' . _("Select country or region:") . ' </td>"'; ?>;
221
+            selecthead = <?php echo '"<td>'._("Select country or region:").' </td>"'; ?>;
222 222
             selecthead = selecthead + '<td>\n';
223 223
         }
224 224
         var select = '<select id="' + type1 + '_country" name="' + type1 + '_country" style="margin-left:0px; width:400px;">';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             options = ($('#'+type2+'_country').html());
227 227
             countryAddSelect(selecthead, select + options + '</select>', type1);
228 228
         } else {
229
-            var comment = <?php echo '"<br><br>' . _("Fetching country/region list") . '..."'; ?>;
229
+            var comment = <?php echo '"<br><br>'._("Fetching country/region list").'..."'; ?>;
230 230
             inProgress(1, comment);
231 231
             $.ajax({
232 232
                 url: "findRealm.php",
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         return false;
261 261
     }
262 262
     function testSociopath(realm, answer) {
263
-        var comment = <?php echo '"' . _("Testing realm") . '..."'; ?>; 
263
+        var comment = <?php echo '"'._("Testing realm").'..."'; ?>; 
264 264
         inProgress(1, comment);
265 265
         if ($('#tested_realm').length == 0) {
266 266
             $('<input>').attr({
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
                                 query = '<input type="hidden" id="tested_realm" value="' + realm + '">';
286 286
                             }    
287 287
                             query = query + '<div id="current_query">'+data['TEXT']+'</div>';
288
-                            query = query + '<div><button id="answer_yes">' + <?php echo '"' . _("Yes") . '"'; ?> + '</button>';
289
-                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"' . _("No") . '"'; ?> + '</button>';
290
-                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"' . _("I don't know") . '"'; ?> + '</button></div>';
288
+                            query = query + '<div><button id="answer_yes">' + <?php echo '"'._("Yes").'"'; ?> + '</button>';
289
+                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"'._("No").'"'; ?> + '</button>';
290
+                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"'._("I don't know").'"'; ?> + '</button></div>';
291 291
                             $('#sociopath_queries').html(query);
292 292
                             $('#sociopath_query_area').show();
293 293
                         }
@@ -318,55 +318,55 @@  discard block
 block discarded – undo
318 318
        }); 
319 319
     }
320 320
     function finalVerdict(realm, verdict) {
321
-        var title = <?php echo '"' . _("Diagnostic tests results for selected realm") . '"'; ?>;
321
+        var title = <?php echo '"'._("Diagnostic tests results for selected realm").'"'; ?>;
322 322
         result = '<div class="padding">';
323 323
         result = result + '<div><h3>';
324
-        result = result + <?php echo '"' . _("The result for tested realm:") . ' "'; ?> + realm;
324
+        result = result + <?php echo '"'._("The result for tested realm:").' "'; ?> + realm;
325 325
         result = result + '</h3></p><div style="padding: 5px;"><div style="padding: 0px;">';
326
-        result = result + <?php echo '"' . _("The system identified") . '" '; ?>  + ' ';
326
+        result = result + <?php echo '"'._("The system identified").'" '; ?>  + ' ';
327 327
         result = result + Object.keys(verdict).length + ' ';
328
-        result = result + <?php echo '"' . _("suspected areas which potentially can cause a problem.") . '"'; ?> + '<br>';
329
-        result = result + <?php echo '"' . _("Next to the problem description we show a speculated probability of this event.") . '"'; ?>;
328
+        result = result + <?php echo '"'._("suspected areas which potentially can cause a problem.").'"'; ?> + '<br>';
329
+        result = result + <?php echo '"'._("Next to the problem description we show a speculated probability of this event.").'"'; ?>;
330 330
         result = result + '</div><div style="padding: 5px;"><table>';
331 331
         k = 1;
332 332
         for (key in verdict) {
333 333
             result = result + '<tr><td>' + k + '.</td>';
334 334
             k = k + 1;
335 335
             if (key === 'INFRA_DEVICE') {
336
-                result = result + '<td>' + <?php echo '"' . _("Your device configuration is broken") . '"'; ?> + '</td>';
336
+                result = result + '<td>' + <?php echo '"'._("Your device configuration is broken").'"'; ?> + '</td>';
337 337
             }
338 338
             if (key === 'INFRA_SP_80211') {
339
-                result = result + '<td>' + <?php echo '"' . _("The Wi-Fi network in your vicinity has quality issues") . '"'; ?> + '</td>';
339
+                result = result + '<td>' + <?php echo '"'._("The Wi-Fi network in your vicinity has quality issues").'"'; ?> + '</td>';
340 340
             }
341 341
             if (key === 'INFRA_SP_LAN') {
342
-                result = result + '<td>' + <?php echo '"' . _("The network environment around you is broken") . '"'; ?> + '</td>';
342
+                result = result + '<td>' + <?php echo '"'._("The network environment around you is broken").'"'; ?> + '</td>';
343 343
             }
344 344
             if (key === 'INFRA_SP_RADIUS') {
345
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your service provider is the source of the problem") . '"'; ?> + '</td>';
345
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your service provider is the source of the problem").'"'; ?> + '</td>';
346 346
             }
347 347
             if (key === 'INFRA_IDP_AUTHBACKEND') {
348
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server in your home institution is currently unable to authenticate you") . '"'; ?> + '</td>';
348
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server in your home institution is currently unable to authenticate you").'"'; ?> + '</td>';
349 349
             }
350 350
             if (key === 'INFRA_NRO_SP') {
351
-                result = result + '<td>' + <?php echo '"' . _("The national server in the country/region you are visiting is not functioning correctly") . '"'; ?> + '</td>';
351
+                result = result + '<td>' + <?php echo '"'._("The national server in the country/region you are visiting is not functioning correctly").'"'; ?> + '</td>';
352 352
             }
353 353
             if (key === 'INFRA_LINK_ETLR_NRO_SP') {
354
-                result = result + '<td>' + <?php echo '"' . _("The link between the national server of the country/region you are visiting and the top-level server is broken") . '"'; ?> + '</td>';
354
+                result = result + '<td>' + <?php echo '"'._("The link between the national server of the country/region you are visiting and the top-level server is broken").'"'; ?> + '</td>';
355 355
             }
356 356
             if (key === 'INFRA_LINK_ETLR_NRO_IdP') {
357
-                result = result + '<td>' + <?php echo '"' . _("The link between the national server of your home country/region and the top-level server is broken") . '"'; ?> + '</td>';
357
+                result = result + '<td>' + <?php echo '"'._("The link between the national server of your home country/region and the top-level server is broken").'"'; ?> + '</td>';
358 358
             }
359 359
             if (key === 'INFRA_ETLR') {
360
-                result = result + '<td>' + <?php echo '"' . _("The communication to the top-level server is down") . '"'; ?> + '</td>';
360
+                result = result + '<td>' + <?php echo '"'._("The communication to the top-level server is down").'"'; ?> + '</td>';
361 361
             }
362 362
             if (key === 'INFRA_NRO_IdP') {
363
-                result = result + '<td>' + <?php echo '"' . _("The national server in your home country/region is not functioning properly.") . '"'; ?> + '</td>';
363
+                result = result + '<td>' + <?php echo '"'._("The national server in your home country/region is not functioning properly.").'"'; ?> + '</td>';
364 364
             }
365 365
             if (key === 'INFRA_IdP_RADIUS') {
366
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your home institution is the source of the problem") . '"'; ?> + '</td>';
366
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your home institution is the source of the problem").'"'; ?> + '</td>';
367 367
             }
368 368
             if (key === 'INFRA_NONEXISTENTREALM') {
369
-                result = result + '<td>' + <?php echo '"' . _("This realm does not exist") . '"'; ?> + '</td>';
369
+                result = result + '<td>' + <?php echo '"'._("This realm does not exist").'"'; ?> + '</td>';
370 370
             }
371 371
             result = result + '<td style="padding-left: 5px;">' + (verdict[key] * 100).toFixed(2) + "%</td></tr>";
372 372
         }
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
         return false;
479 479
     });
480 480
     $(document).on('change', '#idp_country, #sp_country, #asp_country' , function() {
481
-        var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>;  
481
+        var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>;  
482 482
         var id = $(this).attr('id');
483 483
         var k = id.indexOf('_');
484 484
         var type = id.substr(0,k);
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                         var shtml = '';
497 497
                         var select = '';
498 498
                         if (type !== 'asp') {
499
-                            shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>;
499
+                            shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>;
500 500
                         }
501 501
                         select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>';
502 502
                         for (var i in institutions) {
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
             $('#start_test_area').hide();
537 537
             return false;
538 538
         }
539
-        var comment = <?php echo '"' . _("Fetching realms list") . '..."'; ?>;
539
+        var comment = <?php echo '"'._("Fetching realms list").'..."'; ?>;
540 540
         inProgress(1, comment);
541 541
         $.ajax({
542 542
             url: "findRealm.php",
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
                     var realms = data.realms;
549 549
                     var realmselect = '';
550 550
                     if (realms.length > 1) {
551
-                        realmselect = <?php echo '"<td>' . _("Check realm(s):") . '</td>"'; ?>;
551
+                        realmselect = <?php echo '"<td>'._("Check realm(s):").'</td>"'; ?>;
552 552
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
553 553
                         for (var i in realms) {
554 554
                             realmselect = realmselect + '<input type="radio" name="realm" ';
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                         }
561 561
                         realmselect = realmselect + '</span></td>';
562 562
                     } else {
563
-                        realmselect = <?php echo '"<td>' . _("Realm:") . '</td>"'; ?>;
563
+                        realmselect = <?php echo '"<td>'._("Realm:").'</td>"'; ?>;
564 564
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
565 565
                         realmselect = realmselect + realms[0] + '</span>';
566 566
                         realmselect = realmselect + '<input type="hidden" name="realm" value="' + realms[0] + '">';
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
             });
616 616
             t = 1;
617 617
         }
618
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
618
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
619 619
         inProgress(1, comment);
620 620
         /*waiting(comment);*/
621 621
         $.ajax({
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
                             }
660 660
                         });
661 661
                         $('#sp_questions > tbody').append('<tr class="error_row"><td>' +
662
-                                <?php echo '"' . _("Realm is not registered with the eduroam database:") . '"'; ?> +
662
+                                <?php echo '"'._("Realm is not registered with the eduroam database:").'"'; ?> +
663 663
                                 '</td><td>' + realm + '</td></tr>');
664 664
                         $('#admin_realm').val('');
665 665
                     }    
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
         testSociopath('', answer);
684 684
     });
685 685
     $('#realmtest').click(function(event){
686
-        var comment = <?php echo '"<br><br>' . _("Running realm tests") . '..."'; ?>;
686
+        var comment = <?php echo '"<br><br>'._("Running realm tests").'..."'; ?>;
687 687
         inProgress(1, comment);
688 688
         $('#start_test_area').hide();
689 689
         if ($('#select_sp_area').is(':hidden')) {
@@ -727,13 +727,13 @@  discard block
 block discarded – undo
727 727
                         reset_footer();
728 728
                         testSociopath(realm, 0);
729 729
                     } else {
730
-                        var title = <?php echo '"' . _("Diagnostics results for selected realms") . '"'; ?>;
731
-                        result = '<div class="padding"><h3>' + <?php echo '"' . _("An unknown problem occured") . '"'; ?>;
730
+                        var title = <?php echo '"'._("Diagnostics results for selected realms").'"'; ?>;
731
+                        result = '<div class="padding"><h3>' + <?php echo '"'._("An unknown problem occured").'"'; ?>;
732 732
                         result = result + '</h3>'
733 733
                         if (r.length == 1) {
734
-                            result = result + <?php echo '"' . _("This test includes checking of the following realm") . '"'; ?>;
734
+                            result = result + <?php echo '"'._("This test includes checking of the following realm").'"'; ?>;
735 735
                         } else {    
736
-                            result = result + <?php echo '"' . _("This test includes checking of the following realms") . '"'; ?>;
736
+                            result = result + <?php echo '"'._("This test includes checking of the following realms").'"'; ?>;
737 737
                         }
738 738
                         result = result + ': '
739 739
                         for (var i=0; i < r.length; i++) {
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
                             result = result + r[i];
744 744
                         }
745 745
                         result = result + '.<br>';
746
-                        result = result + <?php echo '"' . _("You should report this to") . '"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
746
+                        result = result + <?php echo '"'._("You should report this to").'"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
747 747
                         result = result + '</div>';
748 748
                         $('#after_stage_1').hide();
749 749
                         $('#before_stage_1').show();
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
                 });
797 797
             });
798 798
         });
799
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
799
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
800 800
         inProgress(1, comment);
801 801
         $.ajax({
802 802
             url: "findRealm.php",
@@ -867,29 +867,29 @@  discard block
 block discarded – undo
867 867
             success:function(data) {
868 868
                 if (data.status === 1) {
869 869
                     var result = '';
870
-                    var title = <?php echo '"' . _("eduroam admin report submission") . '"'; ?>;
870
+                    var title = <?php echo '"'._("eduroam admin report submission").'"'; ?>;
871 871
                     result = '<div class="padding">';
872 872
                     if (type == 'idp_send') {
873
-                        result = result + '<h3>'+ <?php echo '"' . _("SP contacting IdP due to technical problems or abuse") . '"'; ?> + '</h3>';
873
+                        result = result + '<h3>'+ <?php echo '"'._("SP contacting IdP due to technical problems or abuse").'"'; ?> + '</h3>';
874 874
                         result = result + '<table>';
875
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
876
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
877
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email(s)") . '"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
878
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
879
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
880
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
875
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
876
+                        result = result + '<tr><td>' + <?php echo '"'._("SP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
877
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email(s)").'"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
878
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
879
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
880
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
881 881
                     }
882 882
                     if (type == 'sp_send') {
883
-                        result = result + '<h3>'+ <?php echo '"' . _("IdP contacting SP due to technical problems or abuse") . '"'; ?> + '</h3>';
883
+                        result = result + '<h3>'+ <?php echo '"'._("IdP contacting SP due to technical problems or abuse").'"'; ?> + '</h3>';
884 884
                         result = result + '<table>';
885
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
886
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP's Operator-Name") . '"'; ?> + '</td><td>' + data.opname + '</td></tr>';
887
-                        result = result + '<tr><td>' + <?php echo '"' . _("User's outer ID") . '"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
888
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
889
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
890
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
891
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
892
-                        result = result + '<tr><td>' + <?php echo '"' . _("How to contact the user") . '"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
885
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
886
+                        result = result + '<tr><td>' + <?php echo '"'._("SP's Operator-Name").'"'; ?> + '</td><td>' + data.opname + '</td></tr>';
887
+                        result = result + '<tr><td>' + <?php echo '"'._("User's outer ID").'"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
888
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
889
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
890
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
891
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
892
+                        result = result + '<tr><td>' + <?php echo '"'._("How to contact the user").'"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
893 893
                     }
894 894
                     result = result + '</div>';
895 895
                     showInfo(result, title);
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
         if ($('#mac').val().length > 0) {
907 907
             if ($('#mac').val().length != 17) {
908 908
                 $('#mac').addClass('error_input');
909
-                $('#mac').attr('title', <?php echo '"' . _("MAC address is incomplete") . '"'; ?>);
909
+                $('#mac').attr('title', <?php echo '"'._("MAC address is incomplete").'"'; ?>);
910 910
             } else {
911 911
                 $('#mac').removeClass('error_input'); 
912 912
                 $('#mac').attr('title', '');
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         if ($(this).attr('id') == 'email' &&  $(this).val().length > 0) {
916 916
             if (!isEmail($(this).val())) {
917 917
                 $('#email').addClass('error_input');
918
-                $('#email').attr('title', <?php echo '"' . _("Wrong format of email") . '"'; ?>);
918
+                $('#email').attr('title', <?php echo '"'._("Wrong format of email").'"'; ?>);
919 919
             } else {
920 920
                 $('#email').removeClass('error_input');
921 921
                 $('#email').attr('title', '');
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
         if ($(this).attr('id') == 'outer_id' &&  $(this).val().length > 0) {
925 925
             if (!isEmail($(this).val(), true)) {
926 926
                 $('#outer_id').addClass('error_input');
927
-                $('#outer_id').attr('title', <?php echo '"' . _("Wrong format of outer ID") . '"'; ?>);
927
+                $('#outer_id').attr('title', <?php echo '"'._("Wrong format of outer ID").'"'; ?>);
928 928
             } else {
929 929
                 $('#outer_id').removeClass('error_input');
930 930
                 $('#outer_id').attr('title', '');
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
         if ($(this).attr('id') == 'opname' && $('#opname').val().length > 0) {
934 934
             if (!isOperatorName($(this).val())) {
935 935
                 $('#opname').addClass('error_input');
936
-                $('#opname').attr('title', <?php echo '"' . _("Wrong string given as OperatorName") . '"'; ?>);
936
+                $('#opname').attr('title', <?php echo '"'._("Wrong string given as OperatorName").'"'; ?>);
937 937
                 $('#spmanually').show();
938 938
             } else {
939 939
                 $('#opname').removeClass('error_input');
Please login to merge, or discard this patch.
core/DBConnection.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 use \Exception;
34 34
 
35
-require_once dirname(__DIR__) . "/config/_config.php";
35
+require_once dirname(__DIR__)."/config/_config.php";
36 36
 
37 37
 /**
38 38
  * This class is a singleton for establishing a connection to the database
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
             case "EXTERNAL":
61 61
             case "FRONTEND":
62 62
             case "DIAGNOSTICS":
63
-                if (!isset(self::${"instance" . $theDb})) {
63
+                if (!isset(self::${"instance".$theDb})) {
64 64
                     $class = __CLASS__;
65
-                    self::${"instance" . $theDb} = new $class($database);
66
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
65
+                    self::${"instance".$theDb} = new $class($database);
66
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
67 67
                 }
68
-                return self::${"instance" . $theDb};
68
+                return self::${"instance".$theDb};
69 69
             default:
70
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
70
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
71 71
         }
72 72
     }
73 73
 
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
             }
107 107
         }
108 108
         // log exact query to debug log, if log level is at 5
109
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
109
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
110 110
         if ($types !== NULL) {
111
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
111
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
112 112
         }
113 113
 
114 114
         if ($this->connection->connect_error) {
115
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
115
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
116 116
         }
117 117
         if ($types === NULL) {
118 118
             $result = $this->connection->query($querystring);
119 119
             if ($result === FALSE) {
120
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
120
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
121 121
             }
122 122
         } else {
123 123
             // fancy! prepared statement with dedicated argument list
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             }
131 131
             $prepResult = $statementObject->prepare($querystring);
132 132
             if ($prepResult === FALSE) {
133
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
133
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
134 134
             }
135 135
 
136 136
             // we have a variable number of arguments packed into the ... array
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
             array_unshift($localArray, $types);
143 143
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
144 144
             if ($retval === FALSE) {
145
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
145
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
146 146
             }
147 147
             $result = $statementObject->execute();
148 148
             if ($result === FALSE) {
149
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
149
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
150 150
             }
151 151
             $selectResult = $statementObject->get_result();
152 152
             if ($selectResult !== FALSE) {
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
 
159 159
         // all cases where $result could be FALSE have been caught earlier
160 160
         if ($this->connection->errno) {
161
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
161
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
162 162
         }
163 163
 
164 164
 
165 165
         if ($isMoreThanSelect) {
166
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
166
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
167 167
             if ($types !== NULL) {
168
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
168
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
169 169
             }
170 170
         }
171 171
         return $result;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         $databaseCapitalised = strtoupper($database);
250 250
         $this->connection = new \mysqli(CONFIG['DB'][$databaseCapitalised]['host'], CONFIG['DB'][$databaseCapitalised]['user'], CONFIG['DB'][$databaseCapitalised]['pass'], CONFIG['DB'][$databaseCapitalised]['db']);
251 251
         if ($this->connection->connect_error) {
252
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
252
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
253 253
         }
254 254
 
255 255
         if ($databaseCapitalised == "EXTERNAL" && CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") {
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 use \Exception;
36 36
 
37
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
37
+require_once dirname(dirname(__DIR__))."/config/_config.php";
38 38
 
39 39
 /**
40 40
  * Test suite to verify that an EAP setup is actually working as advertised in
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             }
166 166
         }
167 167
 
168
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
168
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
169 169
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
170 170
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
171 171
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
253 253
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
254 254
             }
255
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
255
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
256 256
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
257 257
             }
258 258
         }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) {
278 278
             $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
279 279
         }
280
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
280
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
281 281
         if ($intermediateCa['basicconstraints_set'] == 0) {
282 282
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
283 283
         }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     public function udpReachability($probeindex, $opnameCheck = TRUE, $frag = TRUE) {
325 325
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
326 326
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
327
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
327
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
328 328
         if ($clientcert === FALSE) {
329 329
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
330 330
         }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
334 334
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
335 335
         }
336
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
336
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
337 337
     }
338 338
 
339 339
     /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
354 354
         }
355 355
         // first and second sub-match is the full URL... check it
356
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
356
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
357 357
         if ($crlcontent === FALSE) {
358 358
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
359 359
         }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         fclose($pipes[1]);
385 385
         fclose($pipes[2]);
386 386
         $retval = proc_close($process);
387
-        if ($retval != 0 || !preg_match("/BEGIN X509 CRL/",$pem)) {
387
+        if ($retval != 0 || !preg_match("/BEGIN X509 CRL/", $pem)) {
388 388
             // this was not a real CRL
389 389
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
390 390
         }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         $origLength = strlen($hex);
407 407
         for ($i = 1; $i < $origLength; $i++) {
408 408
             if ($i % 2 == 1 && $i != strlen($hex)) {
409
-                $spaced .= $hex[$i] . " ";
409
+                $spaced .= $hex[$i]." ";
410 410
             } else {
411 411
                 $spaced .= $hex[$i];
412 412
             }
@@ -489,19 +489,19 @@  discard block
 block discarded – undo
489 489
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
490 490
         $config = '
491 491
 network={
492
-  ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing"
492
+  ssid="' . CONFIG['APPEARANCE']['productname'].' testing"
493 493
   key_mgmt=WPA-EAP
494 494
   proto=WPA2
495 495
   pairwise=CCMP
496 496
   group=CCMP
497 497
   ';
498 498
 // phase 1
499
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
499
+        $config .= 'eap='.$eapText['OUTER']."\n";
500 500
         $logConfig = $config;
501 501
 // phase 2 if applicable; all inner methods have passwords
502 502
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
503
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
504
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
503
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
504
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
505 505
         }
506 506
 // all methods set a password, except EAP-TLS
507 507
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
         }
518 518
 
519 519
 // inner identity
520
-        $config .= '  identity="' . $inner . "\"\n";
521
-        $logConfig .= '  identity="' . $inner . "\"\n";
520
+        $config .= '  identity="'.$inner."\"\n";
521
+        $logConfig .= '  identity="'.$inner."\"\n";
522 522
 // outer identity, may be equal
523
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
524
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
523
+        $config .= '  anonymous_identity="'.$outer."\"\n";
524
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
525 525
 // done
526 526
         $config .= "}";
527 527
         $logConfig .= "}";
@@ -582,13 +582,13 @@  discard block
 block discarded – undo
582 582
      * @return string the command-line for eapol_test
583 583
      */
584 584
     private function eapolTestConfig($probeindex, $opName, $frag) {
585
-        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] .
586
-                " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] .
587
-                " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] .
588
-                " -o serverchain.pem" .
589
-                " -c ./udp_login_test.conf" .
590
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
591
-                " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " ";
585
+        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'].
586
+                " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'].
587
+                " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'].
588
+                " -o serverchain.pem".
589
+                " -c ./udp_login_test.conf".
590
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
591
+                " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." ";
592 592
         if ($opName) {
593 593
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
594 594
         }
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
      * @throws Exception
618 618
      */
619 619
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
620
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
620
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
621 621
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
622 622
         }
623
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
623
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
624 624
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
625 625
         }
626 626
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -634,15 +634,15 @@  discard block
 block discarded – undo
634 634
             }
635 635
             if ($decoded['ca'] == 1) {
636 636
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
637
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
638
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
637
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
638
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
639 639
                     $catRoots[] = $decoded['pem'];
640 640
                 } else { // save the intermediates to allcerts directory
641
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
641
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
642 642
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
643 643
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
644 644
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
645
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
645
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
646 646
                     }
647 647
                     $catIntermediates[] = $decoded['pem'];
648 648
                 }
@@ -651,26 +651,26 @@  discard block
 block discarded – undo
651 651
         // save all intermediate certificates and CRLs to separate files in 
652 652
         // both root-ca directories
653 653
         foreach ($eapIntermediates as $index => $onePem) {
654
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
655
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
654
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
655
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
656 656
         }
657 657
         foreach ($eapIntermediateCRLs as $index => $onePem) {
658
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
659
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
658
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
659
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
660 660
         }
661 661
 
662 662
         $checkstring = "";
663 663
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
664 664
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
665 665
             $checkstring = "-crl_check_all";
666
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
667
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
666
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
667
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
668 668
         }
669 669
 
670 670
 
671 671
 // now c_rehash the root CA directory ...
672
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
673
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
672
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
673
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
674 674
         return $checkstring;
675 675
     }
676 676
 
@@ -701,12 +701,12 @@  discard block
 block discarded – undo
701 701
 // the error log will complain if we run this test against an empty file of certs
702 702
 // so test if there's something PEMy in the file at all
703 703
         if (filesize("$tmpDir/serverchain.pem") > 10) {
704
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
705
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
706
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
707
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
708
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
709
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
704
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
705
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
706
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
707
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
708
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
709
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
710 710
         }
711 711
 
712 712
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
         // we are UNHAPPY if no names match!
773 773
         $happiness = "UNHAPPY";
774 774
         foreach ($this->expectedServerNames as $expectedName) {
775
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
775
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
776 776
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
777 777
                 $this->loggerInstance->debug(4, "Totally happy!");
778 778
                 $happiness = "TOTALLY";
@@ -816,11 +816,11 @@  discard block
 block discarded – undo
816 816
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
817 817
         // the config intentionally does not include CA checking. We do this
818 818
         // ourselves after getting the chain with -o.
819
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
819
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
820 820
 
821 821
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
822 822
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
823
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
823
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
824 824
         $time_start = microtime(true);
825 825
         $pflow = [];
826 826
         exec($cmdline, $pflow);
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
864 864
             array_pop($packetflow);
865 865
         }
866
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
866
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
867 867
         $packetcount = array_count_values($packetflow);
868 868
         $testresults['packetcount'] = $packetcount;
869 869
         $testresults['packetflow'] = $packetflow;
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
         
941 941
         $x509 = new \core\common\X509();
942 942
 // $eap_certarray holds all certs received in EAP conversation
943
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
943
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
944 944
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
945 945
             $eapCertArray = $x509->splitCertificate($incomingData);
946 946
         } else {
@@ -970,10 +970,10 @@  discard block
 block discarded – undo
970 970
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
971 971
                     $servercert[] = $cert;
972 972
                     if (count($servercert) == 1) {
973
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
973
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
974 974
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
975 975
                         }
976
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
976
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
977 977
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
978 978
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
979 979
                     }
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
         chdir($tmpDir);
1054 1054
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1055 1055
         if ($clientcertdata !== NULL) {
1056
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1056
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1057 1057
         }
1058 1058
         $testresults = [];
1059 1059
         // initialise the sub-array for cleaner parsing
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
                     'issuer' => $this->printDN($certdata['issuer']),
1150 1150
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1151 1151
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1152
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1152
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1153 1153
                     'sha1' => $certdata['sha1'],
1154 1154
                     'extensions' => $certdata['extensions']
1155 1155
                 ];
Please login to merge, or discard this patch.