Test Failed
Push — master ( cecf98...79e737 )
by Stefan
07:37
created
web/lib/admin/OptionDisplay.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @return string HTML code <table>
86 86
      */
87 87
     public function prefilledOptionTable(string $attributePrefix) {
88
-        $retval = "<table id='expandable_$attributePrefix" . "_options'>";
88
+        $retval = "<table id='expandable_$attributePrefix"."_options'>";
89 89
 
90 90
         $prepopulate = [];
91 91
         foreach ($this->listOfOptions as $existingAttribute) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 $prepopulate[] = $existingAttribute;
94 94
             }
95 95
         }
96
-        if (is_array($prepopulate) && ( count($prepopulate) > 0 || $attributePrefix == "device-specific" || $attributePrefix == "eap-specific" )) { // editing... fill with values
96
+        if (is_array($prepopulate) && (count($prepopulate) > 0 || $attributePrefix == "device-specific" || $attributePrefix == "eap-specific")) { // editing... fill with values
97 97
             $retval .= $this->addOptionEdit($attributePrefix, $prepopulate);
98 98
         } else {
99 99
             $retval .= $this->addOptionNew($attributePrefix);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
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
         return $retval;
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         if (!isset($descriptions[$input])) {
198 198
             return "";
199 199
         }
200
-        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>";
200
+        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>";
201 201
     }
202 202
 
203 203
     /**
@@ -210,18 +210,18 @@  discard block
 block discarded – undo
210 210
      */
211 211
     private function selectElement($rowid, $list) {
212 212
         $jsmagic = "onchange='
213
-                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
213
+                               if (/#ML#/.test(document.getElementById(\"option-S" . $rowid."-select\").value)) {
214 214
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
215 215
                                    } else {
216 216
                                    document.getElementById(\"S$rowid-input-langselect\").style.display = \"none\";
217 217
                                    }";
218 218
         foreach (array_keys(OptionDisplay::HTML_DATATYPE_TEXTS) as $key) {
219
-            $jsmagic .= "if (/#" . $key . "#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
220
-                                  document.getElementById(\"S$rowid-input-file\").style.display = \"" . ($key == \core\Options::TYPECODE_FILE ? "block" : "none") . "\";
221
-                                  document.getElementById(\"S$rowid-input-text\").style.display = \"" . ($key == \core\Options::TYPECODE_TEXT ? "block" : "none") . "\";
222
-                                  document.getElementById(\"S$rowid-input-string\").style.display = \"" . ($key == \core\Options::TYPECODE_STRING ? "block" : "none") . "\";
223
-                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"" . ($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none") . "\";
224
-                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"" . ($key == \core\Options::TYPECODE_INTEGER ? "block" : "none") . "\";
219
+            $jsmagic .= "if (/#".$key."#/.test(document.getElementById(\"option-S".$rowid."-select\").value)) {
220
+                                  document.getElementById(\"S$rowid-input-file\").style.display = \"".($key == \core\Options::TYPECODE_FILE ? "block" : "none")."\";
221
+                                  document.getElementById(\"S$rowid-input-text\").style.display = \"".($key == \core\Options::TYPECODE_TEXT ? "block" : "none")."\";
222
+                                  document.getElementById(\"S$rowid-input-string\").style.display = \"".($key == \core\Options::TYPECODE_STRING ? "block" : "none")."\";
223
+                                  document.getElementById(\"S$rowid-input-boolean\").style.display = \"".($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none")."\";
224
+                                  document.getElementById(\"S$rowid-input-integer\").style.display = \"".($key == \core\Options::TYPECODE_INTEGER ? "block" : "none")."\";
225 225
                              }
226 226
                              ";
227 227
             // hide all tooltips (each is a <span>, and there are no other <span>s)
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                 $value = array_shift($list);
253 253
                 $listtype = $optioninfo->optionType($value);
254 254
                 $retval .= $uiElements->displayName($value);
255
-                $retval .= "<input type='hidden' name='option[S$rowid]' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#'/>";
255
+                $retval .= "<input type='hidden' name='option[S$rowid]' value='$value#".$listtype["type"]."#".$listtype["flag"]."#'/>";
256 256
                 $activelisttype = $listtype;
257 257
                 $tooltips = $this->tooltip($rowid, $value, TRUE);
258 258
                 break;
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 $retval .= "<select id='option-S$rowid-select' name='option[S$rowid]' $jsmagic>";
261 261
                 foreach ($list as $value) {
262 262
                     $listtype = $optioninfo->optionType($value);
263
-                    $retval .= "<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ";
263
+                    $retval .= "<option id='option-S$rowid-v-$value' value='$value#".$listtype["type"]."#".$listtype["flag"]."#' ";
264 264
                     if ($iterator == $this->optionIterator) {
265 265
                         $retval .= "selected='selected'";
266 266
                         $activelisttype = $listtype;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                     } else {
269 269
                         $tooltips .= $this->tooltip($rowid, $value, FALSE);
270 270
                     }
271
-                    $retval .= ">" . $uiElements->displayName($value) . "</option>";
271
+                    $retval .= ">".$uiElements->displayName($value)."</option>";
272 272
                     $iterator++;
273 273
                 }
274 274
 
@@ -293,9 +293,9 @@  discard block
 block discarded – undo
293 293
      */
294 294
     private function selectLanguage($rowid, $makeVisible) {
295 295
         \core\common\Entity::intoThePotatoes();
296
-        $retval = "<select style='display:" . ($makeVisible ? "block" : "none") . "' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect'>
297
-            <option value='' name='select_language' selected>" . _("select language") . "</option>
298
-            <option value='C' name='all_languages'>" . _("default/other languages") . "</option>";
296
+        $retval = "<select style='display:".($makeVisible ? "block" : "none")."' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect'>
297
+            <option value='' name='select_language' selected>" . _("select language")."</option>
298
+            <option value='C' name='all_languages'>" . _("default/other languages")."</option>";
299 299
         foreach (\config\Master::CONFIG['LANGUAGES'] as $langindex => $possibleLang) {
300 300
             $thislang = $possibleLang['display'];
301 301
             $retval .= "<option value='$langindex' name='$langindex'>$thislang</option>";
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
     private function inputFields($rowid, $activetype) {
324 324
         $retval = "";
325 325
         foreach (OptionDisplay::HTML_DATATYPE_TEXTS as $key => $type) {
326
-            $retval .= "<" . $type['html'] . " style='display:" . ($activetype['type'] == $key ? "block" : "none") . "' name='value[S$rowid-$key]' id='S" . $rowid . "-input-" . $key . "'" . $type['tail'] . ">";
326
+            $retval .= "<".$type['html']." style='display:".($activetype['type'] == $key ? "block" : "none")."' name='value[S$rowid-$key]' id='S".$rowid."-input-".$key."'".$type['tail'].">";
327 327
         }
328 328
         return $retval;
329 329
     }
@@ -338,11 +338,11 @@  discard block
 block discarded – undo
338 338
     private function noPrefillText(int $rowid, array $list) {
339 339
         // first column: the <select> element with the names of options and their field-toggling JS magic
340 340
         $selectorInfo = $this->selectElement($rowid, $list);
341
-        $retval = "<td>" . $selectorInfo["TEXT"] . "</td>";
341
+        $retval = "<td>".$selectorInfo["TEXT"]."</td>";
342 342
         // second column: the <select> element for language selection - only visible if the active option is multi-lang
343
-        $retval .= "<td>" . $this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML") . "</td>";
343
+        $retval .= "<td>".$this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML")."</td>";
344 344
         // third column: the actual input fields; the data type of the active option is visible, all others hidden
345
-        $retval .= "<td>" . $this->inputFields($rowid, $selectorInfo['ACTIVE']) . "</td>";
345
+        $retval .= "<td>".$this->inputFields($rowid, $selectorInfo['ACTIVE'])."</td>";
346 346
         return $retval;
347 347
     }
348 348
 
@@ -365,20 +365,20 @@  discard block
 block discarded – undo
365 365
         $retval .= "<td>";
366 366
         $uiElements = new UIElements();
367 367
         $listtype = $optioninfo->optionType($optionName);
368
-        $retval .= "<span style='display:flex;'>" . $uiElements->displayName($optionName);
369
-        $retval .= $this->tooltip($rowid, $optionName, TRUE) . "</span>";
370
-        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ></td>";
368
+        $retval .= "<span style='display:flex;'>".$uiElements->displayName($optionName);
369
+        $retval .= $this->tooltip($rowid, $optionName, TRUE)."</span>";
370
+        $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#".$listtype["type"]."#".$listtype["flag"]."#' ></td>";
371 371
 
372 372
         // language tag if any
373 373
         $retval .= "<td>";
374 374
         if ($listtype["flag"] == "ML") {
375 375
 
376
-            $language = "(" . strtoupper($optionLang) . ")";
376
+            $language = "(".strtoupper($optionLang).")";
377 377
             if ($optionLang == 'C') {
378 378
                 $language = _("(default/other languages)");
379 379
             }
380 380
             $retval .= $language;
381
-            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect' value='" . $optionLang . "' style='display:block'>";
381
+            $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect' value='".$optionLang."' style='display:block'>";
382 382
         }
383 383
         $retval .= "</td>";
384 384
 // attribute content
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
             case \core\Options::TYPECODE_COORDINATES:
389 389
                 $this->allLocationCount = $this->allLocationCount + 1;
390 390
                 // display of the locations varies by map provider
391
-                $classname = "\web\lib\admin\Map" . \config\ConfAssistant::MAPPROVIDER['PROVIDER'];
391
+                $classname = "\web\lib\admin\Map".\config\ConfAssistant::MAPPROVIDER['PROVIDER'];
392 392
                 $link = $classname::optionListDisplayCode($optionValue, $this->allLocationCount);
393
-                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-" . \core\Options::TYPECODE_TEXT . "]' id='S$rowid-input-text' value='$optionValue'>$link";
393
+                $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-".\core\Options::TYPECODE_TEXT."]' id='S$rowid-input-text' value='$optionValue'>$link";
394 394
                 break;
395 395
             case \core\Options::TYPECODE_FILE:
396
-                $retval .= "<input readonly type='text' name='value[S$rowid-" . \core\Options::TYPECODE_STRING . "]' id='S" . $rowid . "-input-string' style='display:none' value='" . urlencode($optionValue) . "'>";
396
+                $retval .= "<input readonly type='text' name='value[S$rowid-".\core\Options::TYPECODE_STRING."]' id='S".$rowid."-input-string' style='display:none' value='".urlencode($optionValue)."'>";
397 397
                 $uiElements = new UIElements();
398 398
                 switch ($optionName) {
399 399
                     case "eap:ca_file":
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
                 if ($listtype['type'] == \core\Options::TYPECODE_BOOLEAN) {// only modify in this one case
424 424
                     $displayedVariant = ($optionValue == "on" ? _("on") : _("off"));
425 425
                 }
426
-                $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'>";
426
+                $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'>";
427 427
                 break;
428 428
             default:
429 429
                 // this should never happen!
@@ -468,10 +468,10 @@  discard block
 block discarded – undo
468 468
        <td>
469 469
           <button type='button' class='delete' onclick='";
470 470
         if ($prefillValue !== NULL && $item == "general:geo_coordinates") {
471
-            $funcname = "Map" . \config\ConfAssistant::MAPPROVIDER['PROVIDER'] . 'DeleteCoord';
472
-            $retval .= 'if (typeof ' . $funcname . ' === "function") { ' . $funcname . '(' . $this->allLocationCount . '); } ';
471
+            $funcname = "Map".\config\ConfAssistant::MAPPROVIDER['PROVIDER'].'DeleteCoord';
472
+            $retval .= 'if (typeof '.$funcname.' === "function") { '.$funcname.'('.$this->allLocationCount.'); } ';
473 473
         }
474
-        $retval .= 'deleteOption("option-S' . $rowid . '")';
474
+        $retval .= 'deleteOption("option-S'.$rowid.'")';
475 475
         $retval .= "'>-</button>
476 476
        </td>
477 477
     </tr>";
Please login to merge, or discard this patch.
web/skins/modern/accountstatus/accountstatus.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     var sbPage = 1;
34 34
 <?php
35 35
 $profile_list_size = 1;
36
-require_once dirname(__DIR__) . '/Divs.php';
36
+require_once dirname(__DIR__).'/Divs.php';
37 37
 $divs = new \web\skins\modern\Divs($Gui);
38 38
 
39 39
 $visibility = 'sb';
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 $Gui->loggerInstance->debug(4, $operatingSystem);
45 45
 $uiElements = new web\lib\admin\UIElements();
46 46
 if ($operatingSystem) {
47
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
47
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
48 48
 }
49
-require dirname(__DIR__) . '/user/js/cat_js.php';
49
+require dirname(__DIR__).'/user/js/cat_js.php';
50 50
 ?>
51 51
     var lang = "<?php echo($Gui->languageInstance->getLang()) ?>";
52 52
 </script>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                         <?php
77 77
                         switch ($statusInfo['errorcode']) {
78 78
                             case "GENERATOR_CONSUMED":
79
-                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE) . "<p>";
79
+                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE)."<p>";
80 80
                                 break;
81 81
                             case NULL:
82 82
                             default:
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                                     echo " ";
100 100
                                     echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts);
101 101
                                 }
102
-                                echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>";
102
+                                echo " <span id='detailtext'>"._("I want to see the details.")."</span>";
103 103
                                 echo "<table id='cert_details'></table>";
104 104
                             }
105 105
                         }
@@ -108,60 +108,60 @@  discard block
 block discarded – undo
108 108
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal
109 109
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED:
110 110
                                 if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case.
111
-                                    echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>";
111
+                                    echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>";
112 112
                                 }
113 113
                                 if (!$statusInfo["OS"]) {
114
-                                    echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>";
114
+                                    echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>";
115 115
                                     break;
116 116
                                 }
117 117
 
118 118
                                 $dev = new \core\DeviceFactory($statusInfo['OS']['device']);
119 119
                                 $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]);
120 120
                                 if ($dev->device->selectedEap == []) {
121
-                                    echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>";
121
+                                    echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>";
122 122
                                     break;
123 123
                                 }
124
-                                $message = $dev->device->options['message'] ?? '' ;
124
+                                $message = $dev->device->options['message'] ?? '';
125 125
 
126 126
                                 $sbMessage = $dev->device->options['sb_message'] ?? '';
127 127
                                 if ($message != '' && $sbMessage != '') {
128
-                                    $message = $message . "<p>" . $sbMessage;
128
+                                    $message = $message."<p>".$sbMessage;
129 129
                                 } else {
130
-                                    $message = $message . $sbMessage;
130
+                                    $message = $message.$sbMessage;
131 131
                                 }
132 132
                          
133
-                                echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
133
+                                echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
134 134
 //                       echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
135 135
                                 echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
136
-                                echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
137
-                                echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>";
136
+                                echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
137
+                                echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>";
138 138
 
139 139
                                 $importPassword = \core\common\Entity::randomString(4, "0123456789");
140 140
                                 $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL);
141 141
                                 
142
-                                echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>";
142
+                                echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>";
143 143
                                 $_SESSION['individualtoken'] = $cleanToken;
144 144
                                 $_SESSION['importpassword'] = $importPassword;
145
-                                echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>";
145
+                                echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>";
146 146
                                 echo "<input type='hidden' name='generatedfor' value='silverbullet'/>";
147
-                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</span></button>";
147
+                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name'])."</span></button>";
148 148
                                 echo "<div class='device_info' id='info_g_sb'></div>";
149 149
                                 break;
150 150
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
151 151
                                 echo "<h2>Invitation link expired</h2>";
152
-                                echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry) . "</p>";
152
+                                echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry)."</p>";
153 153
                                 echo "<p>Below is all the information about your account's other login details, if any.</p>";
154 154
 // do NOT break, display full account info instead (this was a previously valid token after all)
155 155
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED:
156 156
                                 // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones.
157 157
                                 break;
158 158
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID:
159
-                                echo "<h2>" . _("Account information not found") . "</h2>";
160
-                                echo "<p>" . sprintf(_("The invitation link you followed does not map to any invititation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),\config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
159
+                                echo "<h2>"._("Account information not found")."</h2>";
160
+                                echo "<p>".sprintf(_("The invitation link you followed does not map to any invititation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
161 161
                         }
162 162
                         if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) {
163
-                            echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>";
164
-                            echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>";
163
+                            echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>";
164
+                            echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>";
165 165
                         }
166 166
                         ?>
167 167
                     </div>
@@ -181,18 +181,18 @@  discard block
 block discarded – undo
181 181
     $attributes = $statusInfo['attributes'];
182 182
     $supportInfo = '';
183 183
     if (!empty($attributes['local_url'])) {
184
-        $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>';
184
+        $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>';
185 185
     }
186 186
     if (!empty($attributes['local_email'])) {
187
-        $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>';
187
+        $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>';
188 188
     }
189 189
     if (!empty($attributes['local_phone'])) {
190
-        $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>';
190
+        $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>';
191 191
     }
192 192
     if ($supportInfo != '') {
193
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>";
193
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>";
194 194
     } else {
195
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>";
195
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>";
196 196
     }
197 197
     ?>
198 198
     <script>
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             var logo = <?php echo $statusInfo['idp_logo']; ?>;
202 202
             var idpId = <?php echo $statusInfo['idp_id']; ?>;
203 203
             <?php
204
-                if($message != '') {
204
+                if ($message != '') {
205 205
                     echo "message = \"$message\";\n";
206 206
                 }
207 207
             ?>
Please login to merge, or discard this patch.
web/admin/edit_silverbullet.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 /*
21 21
  * Class autoloader invocation, should be included prior to any other code at the entry points to the application
22 22
  */
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $auth->authenticate();
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $fed = new \core\Federation($inst->federation);
54 54
     $allowSb = $fed->getAttributes("fed:silverbullet");
55 55
     if (count($allowSb) == 0) {
56
-        throw new Exception("We were told to create a new SB profile, but this " . \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . " does not allow SB at all!");
56
+        throw new Exception("We were told to create a new SB profile, but this ".\config\ConfAssistant::CONSORTIUM['nomenclature_federation']." does not allow SB at all!");
57 57
     }
58 58
     // okay, new SB profiles are allowed. 
59 59
     // but is there a support:email attribute on inst level?
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     // Create one.
65 65
     $newProfile = $inst->newProfile(core\AbstractProfile::PROFILETYPE_SILVERBULLET);
66 66
     // and modify the REQUEST_URI to add the new profile ID
67
-    $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . "&profile_id=" . $newProfile->identifier;
67
+    $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI']."&profile_id=".$newProfile->identifier;
68 68
     $_GET['profile_id'] = $newProfile->identifier;
69 69
     $profile = $newProfile;
70 70
 } else {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                         break;
133 133
                     }
134 134
                     $properName = $validator->syntaxConformUser($elements[0]);
135
-                    $properDate = new DateTime($elements[1] . " 00:00:00");
135
+                    $properDate = new DateTime($elements[1]." 00:00:00");
136 136
                     $numberOfActivations = $elements[2] ?? 1;
137 137
                     $number = $validator->integer($numberOfActivations);
138 138
                     if ($number === FALSE) { // invalid input received, default to sane
@@ -225,18 +225,18 @@  discard block
 block discarded – undo
225 225
                     // warn and ask for confirmation unless already confirmed
226 226
                     if (!isset($_POST['insecureconfirm']) || $_POST['insecureconfirm'] != "CONFIRM") {
227 227
                         echo $deco->pageheader(_("Insecure mail domain!"), "ADMIN-IDP-USERS");
228
-                        echo "<p>" . sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail) . "</p>";
229
-                        echo "<p>" . _("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.") . "</p>";
230
-                        echo "<p>" . _("Do you want the system to send this mail anyway?") . "</p>";
228
+                        echo "<p>".sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail)."</p>";
229
+                        echo "<p>"._("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.")."</p>";
230
+                        echo "<p>"._("Do you want the system to send this mail anyway?")."</p>";
231 231
                         echo $formtext;
232
-                        echo "<button type='submit' class='delete'>" . _("DO NOT SEND") . "</button>";
232
+                        echo "<button type='submit' class='delete'>"._("DO NOT SEND")."</button>";
233 233
                         echo "</form>";
234 234
                         echo $formtext;
235
-                        echo "<input type='hidden' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'</>";
235
+                        echo "<input type='hidden' name='command' value='".\web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'</>";
236 236
                         echo "<input type='hidden' name='address' value='$properEmail'</>";
237
-                        echo "<input type='hidden' name='token' value='" . $invitationObject->invitationTokenString . "'</>";
237
+                        echo "<input type='hidden' name='token' value='".$invitationObject->invitationTokenString."'</>";
238 238
                         echo "<input type='hidden' name='insecureconfirm' value='CONFIRM'/>";
239
-                        echo "<button type='submit'>" . _("Send anyway.") . "</button>";
239
+                        echo "<button type='submit'>"._("Send anyway.")."</button>";
240 240
                         echo "</form>";
241 241
                         echo $deco->footer();
242 242
                         exit;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 $allUsers = $profile->listAllUsers();
287 287
 $activeUsers = $profile->listActiveUsers();
288 288
 
289
-echo $deco->defaultPagePrelude(sprintf(_('Managing %s users'), \core\ProfileSilverbullet::PRODUCTNAME ));
289
+echo $deco->defaultPagePrelude(sprintf(_('Managing %s users'), \core\ProfileSilverbullet::PRODUCTNAME));
290 290
 
291 291
 ?>
292 292
 <script src='js/option_expand.js' type='text/javascript'></script>
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     echo $deco->productHeader("ADMIN-IDP-USERS");
325 325
     ?>
326 326
     <img src='../resources/images/icons/loading51.gif' id='spin' alt='loading...' style='position:absolute;left: 50%; top: 50%; transform: translate(-100px, -50px); display:none; z-index: 100;'>
327
-    <?php echo $uiElements->instLevelInfoBoxes($inst);?>
327
+    <?php echo $uiElements->instLevelInfoBoxes($inst); ?>
328 328
     <div class='infobox'>
329 329
         <h2><?php echo sprintf(_('Current %s users'), \core\ProfileSilverbullet::PRODUCTNAME); ?></h2>
330 330
         <table>
@@ -424,23 +424,23 @@  discard block
 block discarded – undo
424 424
                                 ?>
425 425
 
426 426
                                 <div class="sb-certificate-summary ca-summary" <?php echo $style; ?>>
427
-                                    <div class="sb-certificate-details"><?php echo _("Device:") . " " . $display; ?>
428
-                                        <br><?php echo _("Serial Number:") . "&nbsp;" . gmp_strval($oneCert->serial, 16); ?>
429
-                                        <br><?php echo _("CN:") . "&nbsp;" . explode('@', $oneCert->username)[0] . "@…"; ?>
430
-                                        <br><?php echo _("Expiry:") . "&nbsp;" . $oneCert->expiry; ?>
431
-                                        <br><?php echo _("Issued:") . "&nbsp;" . $oneCert->issued; ?>
427
+                                    <div class="sb-certificate-details"><?php echo _("Device:")." ".$display; ?>
428
+                                        <br><?php echo _("Serial Number:")."&nbsp;".gmp_strval($oneCert->serial, 16); ?>
429
+                                        <br><?php echo _("CN:")."&nbsp;".explode('@', $oneCert->username)[0]."@…"; ?>
430
+                                        <br><?php echo _("Expiry:")."&nbsp;".$oneCert->expiry; ?>
431
+                                        <br><?php echo _("Issued:")."&nbsp;".$oneCert->issued; ?>
432 432
                                     </div>
433 433
                                     <div style="text-align:right;padding-top: 5px; <?php echo $buttonStyle; ?>">
434 434
                                         <?php
435 435
                                         if ($buttonText == "") {
436 436
                                             echo "$formtext"
437
-                                            . "<input type='hidden' name='certSerial' value='" . $oneCert->serial . "'/>"
438
-                                            . "<input type='hidden' name='certAlgo' value='" . $oneCert->ca_type . "'/>"
437
+                                            . "<input type='hidden' name='certSerial' value='".$oneCert->serial."'/>"
438
+                                            . "<input type='hidden' name='certAlgo' value='".$oneCert->ca_type."'/>"
439 439
                                             . "<button type='submit' "
440 440
                                                     . "name='command' "
441
-                                                    . "value='" . \web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL . "' "
441
+                                                    . "value='".\web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL."' "
442 442
                                                     . "class='delete' "
443
-                                                    . "onclick='return confirm(\"" . sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name']) . "\")'>"
443
+                                                    . "onclick='return confirm(\"".sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name'])."\")'>"
444 444
                                                     . _("Revoke") 
445 445
                                                     . "</button>"
446 446
                                             . "</form>";
@@ -466,38 +466,38 @@  discard block
 block discarded – undo
466 466
                                     $tokenHtmlBuffer .= "<tr class='sb-certificate-row'><td></td>";
467 467
                                     $jsEncodedBody = str_replace('\n', '%0D%0A', str_replace('"', '', json_encode($invitationObject->invitationMailBody())));
468 468
                                     $tokenHtmlBuffer .= "<td>";
469
-                                    $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"),"<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='" . $invitationObject->link() . "' name='token' class='identifiedtokenarea-" . $invitationObject->identifier . "'>(…)<br/>");
469
+                                    $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"), "<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='".$invitationObject->link()."' name='token' class='identifiedtokenarea-".$invitationObject->identifier."'>(…)<br/>");
470 470
                                     $tokenHtmlBuffer .= "<table>
471 471
                                     <tr><td style='vertical-align:bottom;'>"._("E-Mail:")."</td><td>
472 472
                                     $formtext
473
-                                <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
473
+                                <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/>
474 474
                                 <input type='text' name='address' id='address-$invitationObject->identifier'/>
475
-                                <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=" . $invitationObject->invitationMailSubject() . "&amp;body=$jsEncodedBody\"; return false;'>" . _("Local mail client") . "</button>
476
-                                <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'>"._("Send with CAT")."</button>
475
+                                <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=".$invitationObject->invitationMailSubject()."&amp;body=$jsEncodedBody\"; return false;'>"._("Local mail client")."</button>
476
+                                <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'>"._("Send with CAT")."</button>
477 477
                                     </form>
478 478
                                     </td></tr>
479 479
                                     <tr><td style='vertical-align:bottom;'>"._("SMS:")."</td><td>
480 480
                                     $formtext
481
-                                    <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
481
+                                    <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/>
482 482
                                     <input type='text' name='smsnumber' />
483
-				<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS . "'>" . _("Send in SMS...") . "</button>
483
+				<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS."'>"._("Send in SMS...")."</button>
484 484
                                     </form>
485 485
 				</td></tr>
486 486
                                     <tr><td style='vertical-align:bottom;'>"._("Manual:")."</td><td>
487
-				<button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier . ");'>" . _("Copy to Clipboard") . "</button>
487
+				<button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier.");'>"._("Copy to Clipboard")."</button>
488 488
                                     <form style='display:inline-block;' method='post' action='inc/displayQRcode.inc.php' onsubmit='popupQRWindow(this); return false;' accept-charset='UTF-8'>
489
-                                    <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
490
-                                      <button type='submit'>" . _("Display QR code") . "</button>
489
+                                    <input type='hidden' value='" . $invitationObject->invitationTokenString."' name='token'><br/>
490
+                                      <button type='submit'>" . _("Display QR code")."</button>
491 491
                                   </form>
492 492
                                         </td></tr>
493 493
                                         
494 494
                                 </table>
495 495
                                 </td>";
496
-                                    $tokenHtmlBuffer .= "<td>" . _("Expiry Date:") . " " . $invitationObject->expiry . " UTC<br>" . _("Activations remaining:") . " " . sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal) . "</td>";
496
+                                    $tokenHtmlBuffer .= "<td>"._("Expiry Date:")." ".$invitationObject->expiry." UTC<br>"._("Activations remaining:")." ".sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal)."</td>";
497 497
                                     $tokenHtmlBuffer .= "<td>"
498 498
                                             . $formtext
499
-                                            . "<input type='hidden' name='invitationtoken' value='" . $invitationObject->invitationTokenString . "'/>"
500
-                                            . "<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_REVOKEINVITATION . "' class='delete'>"._("Revoke"). "</button></form>"
499
+                                            . "<input type='hidden' name='invitationtoken' value='".$invitationObject->invitationTokenString."'/>"
500
+                                            . "<button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_REVOKEINVITATION."' class='delete'>"._("Revoke")."</button></form>"
501 501
                                             . "</td></tr>";
502 502
                                     break;
503 503
                                 case core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
                                 <span><input type="text" maxlength="19" class="sb-date-picker" name="userexpiry" value="<?php echo $profile->getUserExpiryDate($oneUserId); ?>">&nbsp;(UTC)</span>
520 520
                             </div>
521 521
                             <input type="hidden" name="userid" value="<?php echo $oneUserId; ?>"/>
522
-                            <button type="submit" name="command" value="<?php echo \web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY ?>"><?php echo _("Update");?></button>
522
+                            <button type="submit" name="command" value="<?php echo \web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY ?>"><?php echo _("Update"); ?></button>
523 523
                             </form>
524 524
                         </td>
525 525
                         <td>
@@ -527,13 +527,13 @@  discard block
 block discarded – undo
527 527
                                 <?php
528 528
                                 if ($hasOnePendingInvite || count($validCerts) > 0) {
529 529
                                     $deletionText = sprintf(_("All of the currently active devices will stop functioning with %s. This cannot be undone. While the user can be re-activated later, they will then need to be re-provisioned with new invitation tokens. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name']);
530
-                                    echo $formtext . "
530
+                                    echo $formtext."
531 531
                                     <input type='hidden' name='userid' value='$oneUserId'/>
532 532
                                     <button type='submit' "
533 533
                                             . "name='command' "
534
-                                            . "value='" . \web\lib\common\FormElements::BUTTON_DEACTIVATEUSER . "' "
534
+                                            . "value='".\web\lib\common\FormElements::BUTTON_DEACTIVATEUSER."' "
535 535
                                             . "class='delete' "
536
-                                            . ( count($validCerts) > 0 ? "onclick='return confirm(\"".$deletionText."\")' " : "" )
536
+                                            . (count($validCerts) > 0 ? "onclick='return confirm(\"".$deletionText."\")' " : "")
537 537
                                             . ">" 
538 538
                                             . _("Deactivate User") 
539 539
                                             . "</button>
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
                                     . ' If all accounts shown as active above are indeed still valid, please check the box below and push "Save".'
573 573
                                     . ' If any of the accounts are stale, please deactivate them by pushing the corresponding button before doing this.'), \config\ConfAssistant::SILVERBULLET['gracetime'] ?? core\ProfileSilverbullet::SB_ACKNOWLEDGEMENT_REQUIRED_DAYS);
574 574
 
575
-                    echo $formtext . "<div style='padding-bottom: 20px;'>"
575
+                    echo $formtext."<div style='padding-bottom: 20px;'>"
576 576
                     . "
577 577
                     <p>$acknowledgeText</p>
578 578
                     <input type='checkbox' name='acknowledge' value='true'>
579
-                    <label>" . sprintf(_("I have verified that all configured users are still eligible for %s."),\config\ConfAssistant::CONSORTIUM['display_name']) . "</label>
579
+                    <label>".sprintf(_("I have verified that all configured users are still eligible for %s."), \config\ConfAssistant::CONSORTIUM['display_name'])."</label>
580 580
                 </div>
581
-                <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY . "'>"._("Save")."</button></form>";
581
+                <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY."'>"._("Save")."</button></form>";
582 582
                 }
583 583
                 ?>
584 584
             </div>
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
     
656 656
     <form action="overview_idp.php?inst_id=<?php echo $inst->identifier; ?>" method="POST">
657 657
         <p>
658
-        <button type='submit' name='submitbutton' value="nomatter"><?php echo sprintf(_("Back to %s page"),$uiElements->nomenclatureInst);?></button>
658
+        <button type='submit' name='submitbutton' value="nomatter"><?php echo sprintf(_("Back to %s page"), $uiElements->nomenclatureInst); ?></button>
659 659
         </p>
660 660
     </form>
661 661
     <?php
Please login to merge, or discard this patch.
core/DeviceConfig.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     protected function setSupportedEapMethods($eapArray) {
84 84
         $this->supportedEapMethods = $eapArray;
85
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
85
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
86 86
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
87 87
     }
88 88
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             throw new Exception("No EAP type available.");
128 128
         }
129 129
         $this->attributes = $this->getProfileAttributes($profile);
130
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
130
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
131 131
 
132 132
 
133 133
         // if we are instantiating a Silverbullet profile AND have been given
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         // create temporary directory, its full path will be saved in $this->FPATH;
152 152
         $tempDir = \core\common\Entity::createTemporaryDirectory($purpose);
153 153
         $this->FPATH = $tempDir['dir'];
154
-        mkdir($tempDir['dir'] . '/tmp');
155
-        chdir($tempDir['dir'] . '/tmp');
154
+        mkdir($tempDir['dir'].'/tmp');
155
+        chdir($tempDir['dir'].'/tmp');
156 156
         $caList = [];
157 157
         $x509 = new \core\common\X509();
158 158
         if (isset($this->attributes['eap:ca_file'])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
         if (isset($this->attributes['general:logo_file'])) {
174 174
             $this->loggerInstance->debug(5, "saving IDP logo\n");
175
-            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp');
175
+            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp');
176 176
         }
177 177
         if (isset($this->attributes['fed:logo_file'])) {
178 178
             $this->loggerInstance->debug(5, "saving FED logo\n");
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']);
189 189
 
190 190
         if ($this->signer && $this->options['sign']) {
191
-            $this->sign = ROOT . '/signer/' . $this->signer;
191
+            $this->sign = ROOT.'/signer/'.$this->signer;
192 192
         }
193 193
         $this->installerBasename = $this->getInstallerBasename();
194 194
         common\Entity::outOfThePotatoes();
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
      * @return string|boolean the filename as found, with path, or FALSE if it does not exist
245 245
      */
246 246
     private function findSourceFile($file) {
247
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
248
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
249
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
250
-            return $this->module_path . '/Files/' . $file;
247
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
248
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
249
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
250
+            return $this->module_path.'/Files/'.$file;
251 251
         } else {
252 252
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
253 253
             return FALSE;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         
321 321
         $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n");
322 322
         ob_start();
323
-        $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n");
323
+        $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n");
324 324
         $source = $this->findSourceFile($source_name);
325 325
         
326 326
         if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         }
329 329
         $output = ob_get_clean();
330 330
         if ($encoding !== 0) {
331
-            $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output);
331
+            $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output);
332 332
             if ($outputClean) {
333 333
                 $output = $outputClean;
334 334
             }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
             return $sourceString;
369 369
         }
370 370
         if (\config\ConfAssistant::NSIS_VERSION < 3) {
371
-            $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $sourceString);
371
+            $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $sourceString);
372 372
         } else {
373 373
             $output_c = $sourceString;
374 374
         }
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
      */
463 463
     private function getInstallerBasename() {
464 464
         
465
-        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId();
465
+        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
466 466
         if (isset($this->attributes['profile:customsuffix'][1])) { 
467 467
             // this string will end up as a filename on a filesystem, so always
468 468
             // take a latin-based language variant if available
469 469
             // and then scrub non-ASCII just in case
470
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
470
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
471 471
         }
472 472
         // Okay, no custom suffix. 
473 473
         // Use the configured inst name and apply shortening heuristics
474 474
         $lang_pointer = \config\Master::CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
475
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n");
475
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n");
476 476
         $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]);
477 477
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
478 478
         $Inst_a = explode('_', $inst);
@@ -487,10 +487,10 @@  discard block
 block discarded – undo
487 487
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
488 488
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
489 489
                 $prof = preg_replace('/_+$/', '', $profTemp);
490
-                return $baseName . $inst . '-' . $prof;
490
+                return $baseName.$inst.'-'.$prof;
491 491
             }
492 492
         }
493
-        return $baseName . $inst;
493
+        return $baseName.$inst;
494 494
     }
495 495
 
496 496
     /**
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
      * @return array
559 559
      */
560 560
     private function getConsortia() {
561
-        if(!isset(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])) {
561
+        if (!isset(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])) {
562 562
             return ([]);
563 563
         }
564 564
         $consortia = \config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'];
565 565
         if (isset($this->attributes['media:consortium_OI'])) {
566 566
             foreach ($this->attributes['media:consortium_OI'] as $new_oi) {
567
-                if(!in_array($new_oi, $consortia)) {
567
+                if (!in_array($new_oi, $consortia)) {
568 568
                     $consortia[] = $new_oi;
569 569
                 }
570 570
             }
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
      * @return array list of filenames and the mime types
591 591
      * @throws Exception
592 592
      */
593
-    private function saveLogoFile($logos,$type) {
593
+    private function saveLogoFile($logos, $type) {
594 594
         $iterator = 0;
595 595
         $returnarray = [];
596 596
         foreach ($logos as $blob) {
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                 $ext = 'unsupported';
604 604
             }
605 605
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
606
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
606
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
607 607
             $fileHandle = fopen($fileName, "w");
608 608
             if (!$fileHandle) {
609 609
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -629,13 +629,13 @@  discard block
 block discarded – undo
629 629
         $mime = $finfo->buffer($blob);
630 630
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
631 631
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
632
-        $fileHandle = fopen('local-info.' . $ext, "w");
632
+        $fileHandle = fopen('local-info.'.$ext, "w");
633 633
         if ($fileHandle === FALSE) {
634 634
             throw new Exception("problem opening the file");
635 635
         }
636 636
         fwrite($fileHandle, $blob);
637 637
         fclose($fileHandle);
638
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
638
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
639 639
     }
640 640
 
641 641
     /**
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
     protected function determineOuterIdString() {
687 687
         $outerId = NULL;
688 688
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
689
-            $outerId = "@" . $this->attributes['internal:realm'][0];
689
+            $outerId = "@".$this->attributes['internal:realm'][0];
690 690
             if (isset($this->attributes['internal:anon_local_value'])) {
691
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
691
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
692 692
             }
693 693
         }
694 694
         return $outerId;
Please login to merge, or discard this patch.
core/common/OutsideComm.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX.");
119 119
             return OutsideComm::MAILDOMAIN_NO_MX;
120 120
         }
121
-        $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE));
121
+        $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE));
122 122
         // create a pool of A and AAAA records for all the MXes
123 123
         $ipAddrs = [];
124 124
         foreach ($mx as $onemx) {
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
                 $ipAddrs[] = $oneipv4['ip'];
129 129
             }
130 130
             foreach ($v6list as $oneipv6) {
131
-                $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]";
131
+                $ipAddrs[] = "[".$oneipv6['ipv6']."]";
132 132
             }
133 133
         }
134 134
         if (count($ipAddrs) == 0) {
135 135
             $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts.");
136 136
             return OutsideComm::MAILDOMAIN_NO_HOST;
137 137
         }
138
-        $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE));
138
+        $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE));
139 139
         // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. 
140 140
         // If at least one does not support STARTTLS or one of the hosts doesn't connect
141 141
         // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         switch (\config\ConfAssistant::SMSSETTINGS['provider']) {
188 188
             case 'Nexmo':
189 189
                 // taken from https://docs.nexmo.com/messaging/sms-api
190
-                $url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
190
+                $url = 'https://rest.nexmo.com/sms/json?'.http_build_query(
191 191
                                 [
192 192
                                     'api_key' => \config\ConfAssistant::SMSSETTINGS['username'],
193 193
                                     'api_secret' => \config\ConfAssistant::SMSSETTINGS['password'],
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
                     $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!');
214 214
                     return OutsideComm::SMS_NOTSENT;
215 215
                 }
216
-                $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.');
216
+                $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.');
217 217
 
218 218
                 $totalFailures = 0;
219 219
                 foreach ($decoded_response['messages'] as $message) {
220 220
                     if ($message['status'] == 0) {
221
-                        $loggerInstance->debug(2, $message['message-id'] . ": Success");
221
+                        $loggerInstance->debug(2, $message['message-id'].": Success");
222 222
                     } else {
223
-                        $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")");
223
+                        $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")");
224 224
                         $totalFailures++;
225 225
                     }
226 226
                 }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             $proto = "https://";
289 289
         }
290 290
         // then, send out the mail
291
-        $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n";
291
+        $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n";
292 292
         // default means we don't have a Reply-To.
293 293
         $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address."));
294 294
 
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
             // see if we are supposed to add a custom message
297 297
             $customtext = $federation->getAttributes('fed:custominvite');
298 298
             if (count($customtext) > 0) {
299
-                $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" .
300
-                        wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n";
299
+                $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------".
300
+                        wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n";
301 301
             }
302 302
             // and add Reply-To already now
303 303
             foreach ($federation->listFederationAdmins() as $fedadmin_id) {
@@ -312,19 +312,19 @@  discard block
 block discarded – undo
312 312
             }
313 313
         }
314 314
 
315
-        $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72) . "\n\n" .
316
-                $proto . $_SERVER['SERVER_NAME'] . \config\Master::CONFIG['PATHS']['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" .
317
-                wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), \config\Master::CONFIG['APPEARANCE']['productname']), 72) . "\n\n" .
318
-                $proto . $_SERVER['SERVER_NAME'] . \config\Master::CONFIG['PATHS']['cat_base_url'] . "admin/\n\n" .
319
-                _("and enter the invitation token") . "\n\n" .
320
-                $newtoken . "\n\n$replyToMessage\n\n" .
321
-                wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72) . "\n\n" .
322
-                wordwrap(sprintf(_("We wish you a lot of fun with the %s."), \config\Master::CONFIG['APPEARANCE']['productname']), 72) . "\n\n" .
315
+        $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72)."\n\n".
316
+                $proto.$_SERVER['SERVER_NAME'].\config\Master::CONFIG['PATHS']['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n".
317
+                wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), \config\Master::CONFIG['APPEARANCE']['productname']), 72)."\n\n".
318
+                $proto.$_SERVER['SERVER_NAME'].\config\Master::CONFIG['PATHS']['cat_base_url']."admin/\n\n".
319
+                _("and enter the invitation token")."\n\n".
320
+                $newtoken."\n\n$replyToMessage\n\n".
321
+                wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72)."\n\n".
322
+                wordwrap(sprintf(_("We wish you a lot of fun with the %s."), \config\Master::CONFIG['APPEARANCE']['productname']), 72)."\n\n".
323 323
                 sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), \config\ConfAssistant::CONSORTIUM['display_name']);
324 324
 
325 325
 
326 326
 // who to whom?
327
-        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname'] . " Invitation System";
327
+        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname']." Invitation System";
328 328
 
329 329
         if (isset(\config\Master::CONFIG['APPEARANCE']['invitation-bcc-mail']) && \config\Master::CONFIG['APPEARANCE']['invitation-bcc-mail'] !== NULL) {
330 330
             $mail->addBCC(\config\Master::CONFIG['APPEARANCE']['invitation-bcc-mail']);
Please login to merge, or discard this patch.
core/ProfileSilverbullet.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 // realm is automatically calculated, then stored in DB
95 95
 
96
-        $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . \config\ConfAssistant::SILVERBULLET['realm_suffix'];
96
+        $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).\config\ConfAssistant::SILVERBULLET['realm_suffix'];
97 97
         $localValueIfAny = "";
98 98
 
99 99
 // but there's some common internal attributes populated directly
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 
111 111
 // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information
112 112
         $silverbulletAttributes = [
113
-            "eap:server_name" => "auth." . strtolower($myFed->tld) . \config\ConfAssistant::SILVERBULLET['server_suffix'],
113
+            "eap:server_name" => "auth.".strtolower($myFed->tld).\config\ConfAssistant::SILVERBULLET['server_suffix'],
114 114
         ];
115 115
         $x509 = new \core\common\X509();
116
-        $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r");
116
+        $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r");
117 117
         if ($caHandle !== FALSE) {
118 118
             $cAFile = fread($caHandle, 16000000);
119 119
             $silverbulletAttributes["eap:ca_file"] = $x509->der2pem(($x509->pem2der($cAFile)));
@@ -133,26 +133,26 @@  discard block
 block discarded – undo
133 133
         $this->loggerInstance->debug(3, "--- END Constructing new Profile object ... ---\n");
134 134
 
135 135
         $this->termsAndConditions = "<h2>Product Definition</h2>
136
-        <p>" . \core\ProfileSilverbullet::PRODUCTNAME . " outsources the technical setup of " . \config\ConfAssistant::CONSORTIUM['display_name'] . " " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . " functions to the " . \config\ConfAssistant::CONSORTIUM['display_name'] . " Operations Team. The system includes</p>
136
+        <p>" . \core\ProfileSilverbullet::PRODUCTNAME." outsources the technical setup of ".\config\ConfAssistant::CONSORTIUM['display_name']." ".\config\ConfAssistant::CONSORTIUM['nomenclature_institution']." functions to the ".\config\ConfAssistant::CONSORTIUM['display_name']." Operations Team. The system includes</p>
137 137
             <ul>
138 138
                 <li>a web-based user management interface where user accounts and access credentials can be created and revoked (there is a limit to the number of active users)</li>
139 139
                 <li>a technical infrastructure ('CA') which issues and revokes credentials</li>
140
-                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . \config\ConfAssistant::CONSORTIUM['display_name'] . "</li>           
140
+                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . \config\ConfAssistant::CONSORTIUM['display_name']."</li>           
141 141
             </ul>
142 142
         <h2>User Account Liability</h2>
143
-        <p>As an " . \config\ConfAssistant::CONSORTIUM['display_name'] . " " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . " administrator using this system, you are authorized to create user accounts according to your local " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . " policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
143
+        <p>As an " . \config\ConfAssistant::CONSORTIUM['display_name']." ".\config\ConfAssistant::CONSORTIUM['nomenclature_institution']." administrator using this system, you are authorized to create user accounts according to your local ".\config\ConfAssistant::CONSORTIUM['nomenclature_institution']." policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
144 144
         $this->termsAndConditions .= "<p>Your responsibilities include that you</p>
145 145
         <ul>
146
-            <li>only issue accounts to members of your " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . ", as defined by your local policy.</li>
146
+            <li>only issue accounts to members of your " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'].", as defined by your local policy.</li>
147 147
             <li>must make sure that all accounts that you issue can be linked by you to actual human end users</li>
148
-            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . "</li>
148
+            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution']."</li>
149 149
             <li>will act upon notifications about possible network abuse by your users and will appropriately sanction them</li>
150 150
         </ul>
151 151
         <p>";
152
-        $this->termsAndConditions .= "Failure to comply with these requirements may make your " . \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . " act on your behalf, which you authorise, and will ultimately lead to the deletion of your " . \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . " (and all the users you create inside) in this system.";
152
+        $this->termsAndConditions .= "Failure to comply with these requirements may make your ".\config\ConfAssistant::CONSORTIUM['nomenclature_federation']." act on your behalf, which you authorise, and will ultimately lead to the deletion of your ".\config\ConfAssistant::CONSORTIUM['nomenclature_institution']." (and all the users you create inside) in this system.";
153 153
         $this->termsAndConditions .= "</p>
154 154
         <h2>Privacy</h2>
155
-        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME . ", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
155
+        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME.", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
156 156
         <ul>
157 157
             <li>You are the only one who needs to be able to make a link to the human behind the usernames you create. The usernames you create in the system have to be rich enough to allow you to make that identification step. Also consider situations when you are unavailable or leave the organisation and someone else needs to perform the matching to an individual.</li>
158 158
             <li>The identifiers we create in the credentials are not linked to the usernames you add to the system; they are randomly generated pseudonyms.</li>
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      * @return \core\AbstractProfile[] list of Profiles of this IdP
130 130
      */
131 131
     public function listProfiles(bool $activeOnly = FALSE) {
132
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
132
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
133 133
         $allProfiles = $this->databaseHandle->exec($query);
134 134
         $returnarray = [];
135 135
         // SELECT -> resource, not boolean
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $returnarray[] = $oneProfile;
140 140
         }
141 141
 
142
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
142
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
143 143
         return $returnarray;
144 144
     }
145 145
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @return \core\AbstractDeployment[] list of deployments of this IdP
151 151
      */
152 152
     public function listDeployments(bool $activeOnly = FALSE) {
153
-        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier" . ($activeOnly ? " AND status = " . AbstractDeployment::ACTIVE : "");
153
+        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier".($activeOnly ? " AND status = ".AbstractDeployment::ACTIVE : "");
154 154
         $allDeployments = $this->databaseHandle->exec($query);
155 155
         $returnarray = [];
156 156
         // SELECT -> resource, not boolean
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $returnarray[] = new DeploymentManaged($this, $deploymentQuery->deployment_id);
159 159
         }
160 160
 
161
-        $this->loggerInstance->debug(4, "listDeployments: " . print_r($returnarray, true));
161
+        $this->loggerInstance->debug(4, "listDeployments: ".print_r($returnarray, true));
162 162
         return $returnarray;
163 163
     }
164 164
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
293 293
                     $theProfile = new ProfileSilverbullet($identifier, $this);
294 294
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
295
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
295
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
296 296
                     return $theProfile;
297 297
                 default:
298 298
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      */
429 429
     public function getExternalDBId() {
430 430
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
431
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
431
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
432 432
             // SELECT -> it's a resource, not a boolean
433 433
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
434 434
                 return FALSE;
Please login to merge, or discard this patch.
core/SanityTests.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $this->test_result = [];
121 121
         $this->test_result['global'] = 0;
122 122
         // parse the schema file to find out the number of expected rows...
123
-        $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql");
123
+        $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql");
124 124
         $this->profileOptionCount = 0;
125 125
         $passedTheWindmill = FALSE;
126 126
         foreach ($schema as $schemaLine) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     public function runTest($test) {
147 147
         $this->out[$test] = [];
148 148
         $this->name = $test;
149
-        $m_name = 'test' . $test;
149
+        $m_name = 'test'.$test;
150 150
         $this->test_result[$test] = 0;
151 151
         if (!method_exists($this, $m_name)) {
152 152
             $this->storeTestResult(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>.");
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                 $matchArray = [];
235 235
                 preg_match('/([^ ]+) ?/', $config['PATHS'][$pathToCheck], $matchArray);
236 236
                 $exe = $matchArray[1];
237
-                $the_path = exec("which " . $config['PATHS'][$pathToCheck]);
237
+                $the_path = exec("which ".$config['PATHS'][$pathToCheck]);
238 238
                 if ($the_path == $exe) {
239 239
                     $exec_is = "EXPLICIT";
240 240
                 } else {
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
      */
254 254
     private function testPhp() {
255 255
         if (version_compare(phpversion(), $this->needversionPHP, '>=')) {
256
-            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . ".");
256
+            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion().".");
257 257
         } else {
258
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have " . phpversion() . ".");
258
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have ".phpversion().".");
259 259
         }
260 260
     }
261 261
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             $this->storeTestResult(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly");
272 272
         } else {
273 273
             $rootFromScript = $m[1] === '' ? '/' : $m[1];
274
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . \config\Master::CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>");
274
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".\config\Master::CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>");
275 275
         }
276 276
     }
277 277
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         if (count($probeReturns) == 0) {
292 292
             $this->storeTestResult(common\Entity::L_OK, "All configured RADIUS/UDP probes are reachable.");
293 293
         } else {
294
-            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ',$probeReturns));
294
+            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ', $probeReturns));
295 295
         }
296 296
     }
297 297
 
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
             $SSPconfig = \SimpleSAML\Configuration::getInstance();
309 309
             $sspVersion = explode('.', $SSPconfig->getVersion());
310 310
             if ((int) $sspVersion[0] >= $this->needversionSSP['major'] && (int) $sspVersion[1] >= $this->needversionSSP['minor']) {
311
-                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion));
311
+                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion));
312 312
             } else {
313
-                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->needversionSSP));
313
+                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->needversionSSP));
314 314
             }
315 315
         }
316 316
     }
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
      * @return void
365 365
      */
366 366
     private function testLogdir() {
367
-        if (fopen(\config\Master::CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) {
368
-            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::CONFIG['PATHS']['logdir'] . "</strong> are not writable!");
367
+        if (fopen(\config\Master::CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) {
368
+            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::CONFIG['PATHS']['logdir']."</strong> are not writable!");
369 369
         } else {
370 370
             $this->storeTestResult(\core\common\Entity::L_OK, "Log directory is writable.");
371 371
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     private function testOpenssl() {
490 490
         $A = $this->getExecPath('openssl');
491 491
         if ($A['exec'] != "") {
492
-            $t = exec($A['exec'] . ' version');
492
+            $t = exec($A['exec'].' version');
493 493
             if ($A['exec_is'] == "EXPLICIT") {
494 494
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config.");
495 495
             } else {
@@ -516,14 +516,14 @@  discard block
 block discarded – undo
516 516
         }
517 517
         $A = $this->getExecPath('makensis');
518 518
         if ($A['exec'] != "") {
519
-            $t = exec($A['exec'] . ' -VERSION');
519
+            $t = exec($A['exec'].' -VERSION');
520 520
             if ($A['exec_is'] == "EXPLICIT") {
521 521
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config.");
522 522
             } else {
523 523
                 $this->storeTestResult(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config.");
524 524
             }
525 525
             $outputArray = [];
526
-            exec($A['exec'] . ' -HELP', $outputArray);
526
+            exec($A['exec'].' -HELP', $outputArray);
527 527
             $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray));
528 528
             if ($t1 == 1 && \config\ConfAssistant::NSIS_VERSION == 2) {
529 529
                 $this->storeTestResult(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!");
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
         $NSIS_Module_status = [];
553 553
         foreach ($this->NSISModules as $module) {
554 554
             unset($out);
555
-            exec(\config\ConfAssistant::PATHS['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
555
+            exec(\config\ConfAssistant::PATHS['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
556 556
             if ($retval > 0) {
557 557
                 $NSIS_Module_status[$module] = 0;
558 558
             } else {
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
         $locales = shell_exec("locale -a");
616 616
         $allthere = "";
617 617
         foreach (\config\Master::CONFIG['LANGUAGES'] as $onelanguage) {
618
-            if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) {
619
-                $allthere .= $onelanguage['locale'] . " ";
618
+            if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) {
619
+                $allthere .= $onelanguage['locale']." ";
620 620
             }
621 621
         }
622 622
         if ($allthere == "") {
@@ -630,47 +630,47 @@  discard block
 block discarded – undo
630 630
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['from-mail'],
631 631
             "DEFVALUE" => "[email protected]",
632 632
             "COMPLAINTSTRING" => "APPEARANCE/from-mail ",
633
-            "REQUIRED" => FALSE,],
633
+            "REQUIRED" => FALSE, ],
634 634
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['url'],
635 635
             "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!",
636 636
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ",
637
-            "REQUIRED" => FALSE,],
637
+            "REQUIRED" => FALSE, ],
638 638
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['display'],
639 639
             "DEFVALUE" => "[email protected]",
640 640
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ",
641
-            "REQUIRED" => FALSE,],
641
+            "REQUIRED" => FALSE, ],
642 642
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['developer-mail'],
643 643
             "DEFVALUE" => "[email protected]",
644 644
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ",
645
-            "REQUIRED" => FALSE,],
645
+            "REQUIRED" => FALSE, ],
646 646
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['abuse-mail'],
647 647
             "DEFVALUE" => "[email protected]",
648 648
             "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ",
649
-            "REQUIRED" => FALSE,],
649
+            "REQUIRED" => FALSE, ],
650 650
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['MOTD'],
651 651
             "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!",
652 652
             "COMPLAINTSTRING" => "APPEARANCE/MOTD ",
653
-            "REQUIRED" => FALSE,],
653
+            "REQUIRED" => FALSE, ],
654 654
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['webcert_CRLDP'],
655 655
             "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'],
656 656
             "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ",
657
-            "REQUIRED" => TRUE,],
657
+            "REQUIRED" => TRUE, ],
658 658
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['webcert_OCSP'],
659 659
             "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'],
660 660
             "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ",
661
-            "REQUIRED" => TRUE,],
661
+            "REQUIRED" => TRUE, ],
662 662
         ["SETTING" => \config\Master::CONFIG['DB']['INST']['host'],
663 663
             "DEFVALUE" => "db.host.example",
664 664
             "COMPLAINTSTRING" => "DB/INST ",
665
-            "REQUIRED" => TRUE,],
665
+            "REQUIRED" => TRUE, ],
666 666
         ["SETTING" => \config\Master::CONFIG['DB']['INST']['host'],
667 667
             "DEFVALUE" => "db.host.example",
668 668
             "COMPLAINTSTRING" => "DB/USER ",
669
-            "REQUIRED" => TRUE,],
669
+            "REQUIRED" => TRUE, ],
670 670
         ["SETTING" => \config\Master::CONFIG['DB']['EXTERNAL']['host'],
671 671
             "DEFVALUE" => "customerdb.otherhost.example",
672 672
             "COMPLAINTSTRING" => "DB/EXTERNAL ",
673
-            "REQUIRED" => FALSE,],
673
+            "REQUIRED" => FALSE, ],
674 674
     ];
675 675
 
676 676
     /**
@@ -696,11 +696,11 @@  discard block
 block discarded – undo
696 696
 
697 697
         foreach (\config\Diagnostics::CONFIG['RADIUSTESTS']['TLS-clientcerts'] as $cadata) {
698 698
             foreach ($cadata['certificates'] as $cert_files) {
699
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) {
700
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " ";
699
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) {
700
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['public']." ";
701 701
                 }
702
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) {
703
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " ";
702
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) {
703
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['private']." ";
704 704
                 }
705 705
             }
706 706
         }
@@ -790,14 +790,14 @@  discard block
 block discarded – undo
790 790
         if ($global_no_cache) {
791 791
             foreach ($Devs as $dev => $D) {
792 792
                 if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) {
793
-                    $no_cache_dev .= $dev . " ";
793
+                    $no_cache_dev .= $dev." ";
794 794
                     $no_cache_dev_count++;
795 795
                 }
796 796
             }
797 797
         } else {
798 798
             foreach ($Devs as $dev => $D) {
799 799
                 if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) {
800
-                    $no_cache_dev .= $dev . " ";
800
+                    $no_cache_dev .= $dev." ";
801 801
                     $no_cache_dev_count++;
802 802
                 }
803 803
             }
@@ -835,13 +835,13 @@  discard block
 block discarded – undo
835 835
         $mail->isHTML(FALSE);
836 836
         $mail->CharSet = 'UTF-8';
837 837
         $mail->From = \config\Master::CONFIG['APPEARANCE']['from-mail'];
838
-        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname'] . " Invitation System";
838
+        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname']." Invitation System";
839 839
         $mail->addAddress(\config\Master::CONFIG['APPEARANCE']['abuse-mail']);
840 840
         $mail->Subject = "testing CAT configuration mail";
841 841
         $mail->Body = "Testing CAT mailing\n";
842 842
         $sent = $mail->send();
843 843
         if ($sent) {
844
-            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . \config\Master::CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced.");
844
+            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".\config\Master::CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced.");
845 845
         } else {
846 846
             $this->storeTestResult(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS");
847 847
         }
Please login to merge, or discard this patch.
devices/ms/WindowsCommon.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         if (isset(self::LANGS[$this->languageInstance->getLang()])) {
135 135
             $language = self::LANGS[$this->languageInstance->getLang()];
136 136
             $this->lang = $language['nsis'];
137
-            $this->codePage = 'cp' . $language['cp'];
137
+            $this->codePage = 'cp'.$language['cp'];
138 138
         } else {
139 139
             $this->lang = 'English';
140 140
             $this->codePage = 'cp1252';
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
         $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']);
156 156
         $out .= "<p>";
157 157
         if ($ssidCount > $configCount) {
158
-            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " ";
159
-            $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>';
158
+            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." ";
159
+            $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>';
160 160
             $out .= "<p>";
161 161
         }
162 162
 // TODO - change this below
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
             $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
173 173
             if ($ssidCount > 1) {
174 174
                 $out .= "<p>";
175
-                $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " ";
176
-                $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>';
175
+                $out .= _("You will be required to enter the same credentials for each of the configured networks:")." ";
176
+                $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>';
177 177
             }
178 178
         }
179 179
         return $out;
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
         $logoCount = count($logosToPlace);
246 246
         if ($logoCount > 0) {
247 247
             $voffset = $freeTop;
248
-            $freeSpace = (int)round($this->background['freeHeight'] / ($logoCount + 1));
248
+            $freeSpace = (int) round($this->background['freeHeight'] / ($logoCount + 1));
249 249
             foreach ($logosToPlace as $logo) {
250 250
                 $voffset += $freeSpace;
251 251
                 $logoSize = $logo->getImageGeometry();
252
-                $hoffset = (int)round(($bgImageSize['width'] - $logoSize['width']) / 2);
252
+                $hoffset = (int) round(($bgImageSize['width'] - $logoSize['width']) / 2);
253 253
                 $bgImage->compositeImage($logo, $logo->getImageCompose(), $hoffset, $voffset);
254 254
                 $voffset += $logoSize['height'];
255 255
                 }
@@ -270,13 +270,13 @@  discard block
 block discarded – undo
270 270
      * @return string path to signed installer
271 271
      */
272 272
     protected function signInstaller() {
273
-        $fileName = $this->installerBasename . '.exe';
273
+        $fileName = $this->installerBasename.'.exe';
274 274
         if (!$this->sign) {
275 275
             rename("installer.exe", $fileName);
276 276
             return $fileName;
277 277
         }
278 278
         // are actually signing
279
-        $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null");
279
+        $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null");
280 280
         if ($outputFromSigning === FALSE) {
281 281
             $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n");
282 282
         }
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
      */
291 291
     protected function compileNSIS() {
292 292
         if (\config\ConfAssistant::NSIS_VERSION >= 3) {
293
-            $makensis = \config\ConfAssistant::PATHS['makensis'] . " -INPUTCHARSET UTF8";
293
+            $makensis = \config\ConfAssistant::PATHS['makensis']." -INPUTCHARSET UTF8";
294 294
         } else {
295 295
             $makensis = \config\ConfAssistant::PATHS['makensis'];
296 296
         }
297 297
         $lcAll = getenv("LC_ALL");
298 298
         putenv("LC_ALL=en_US.UTF-8");
299
-        $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1';
299
+        $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1';
300 300
         system($command);
301
-        putenv("LC_ALL=" . $lcAll);
301
+        putenv("LC_ALL=".$lcAll);
302 302
         $this->loggerInstance->debug(4, "compileNSIS:$command\n");
303 303
     }
304 304
 
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
             'email' => 'SUPPORT',
315 315
             'url' => 'URL',
316 316
         ];
317
-        $s = "support_" . $type . "_substitute";
317
+        $s = "support_".$type."_substitute";
318 318
         $substitute = $this->translateString($this->$s, $this->codePage);
319
-        $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' .  $type][0] : $substitute;
320
-        return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n";
319
+        $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute;
320
+        return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n";
321 321
     }
322 322
     
323 323
     /**
@@ -327,20 +327,20 @@  discard block
 block discarded – undo
327 327
      * @return string
328 328
      */
329 329
     protected function writeNsisDefines($attr) {
330
-        $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION;
330
+        $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION;
331 331
         if ($attr['internal:profile_count'][0] > 1) {
332
-            $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '"
332
+            $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'"
333 333
 ';
334 334
         }
335
-        $fcontents .=  '
336
-Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
337
-!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
338
-!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '"
335
+        $fcontents .= '
336
+Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'"
337
+!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'"
338
+!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'"
339 339
 !define INSTALLER_NAME "installer.exe"
340
-!define LANG "' . $this->lang . '"
341
-!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '"
340
+!define LANG "' . $this->lang.'"
341
+!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']).'"
342 342
 ;--------------------------------
343
-!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
343
+!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'"
344 344
 ';
345 345
         $fcontents .= $this->getSupport($attr, 'email');
346 346
         $fcontents .= $this->getSupport($attr, 'url');                
@@ -348,18 +348,18 @@  discard block
 block discarded – undo
348 348
             $fcontents .= '!define WIRED
349 349
         ';
350 350
         }
351
-        $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '"
351
+        $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'"
352 352
 ';
353 353
         if (!empty($attr['internal:realm'][0])) {
354
-            $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '"
354
+            $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'"
355 355
 ';
356 356
         }
357
-        if(!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
358
-            $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '"
357
+        if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
358
+            $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'"
359 359
 ';
360 360
         }
361
-        if(!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
362
-            $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '"
361
+        if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
362
+            $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'"
363 363
 ';
364 364
         }
365 365
         $fcontents .= $this->msInfoFile($attr);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             $out .= '!define EXTERNAL_INFO "';
381 381
 //  $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n");
382 382
             if ($attr['internal:info_file'][0]['mime'] == 'rtf') {
383
-                $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name'];
383
+                $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name'];
384 384
             } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') {
385 385
                 $infoFile = file_get_contents($attr['internal:info_file'][0]['name']);
386 386
                 if ($infoFile === FALSE) {
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
                 if (\config\ConfAssistant::NSIS_VERSION >= 3) {
390 390
                     $infoFileConverted = $infoFile;
391 391
                 } else {
392
-                    $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile);
392
+                    $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile);
393 393
                 }
394 394
                 if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) {
395 395
                     file_put_contents('info_f.txt', $infoFileConverted);
396 396
                     $out = '!define LICENSE_FILE " info_f.txt';
397 397
                 }
398 398
             } else {
399
-                $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name'];
399
+                $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name'];
400 400
             }
401 401
 
402 402
             $out .= "\"\n";
Please login to merge, or discard this patch.