@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function htmlHeadCode() { |
48 | 48 | $cat = new \core\CAT(); |
49 | 49 | \core\common\Entity::intoThePotatoes(); |
50 | - $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=" . \config\Master::APPEARANCE['google_maps_api_key'] . "'></script> |
|
50 | + $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=".\config\Master::APPEARANCE['google_maps_api_key']."'></script> |
|
51 | 51 | <script type='text/javascript'> |
52 | 52 | // some global variables; |
53 | 53 | var center_lat=49.6114885608729; |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | * |
104 | 104 | */ |
105 | 105 | function locator_magic() { |
106 | - geocoder.geocode({'address':\"" . preg_replace("/\"/", """, $this->instName) . "\", 'region':\"" . strtolower($this->fedName) . "\"}, |
|
106 | + geocoder.geocode({'address':\"" . preg_replace("/\"/", """, $this->instName)."\", 'region':\"".strtolower($this->fedName)."\"}, |
|
107 | 107 | function(r,status) { |
108 | 108 | if(status != google.maps.GeocoderStatus.OK) { |
109 | - locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)] . "\"); |
|
109 | + locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]."\"); |
|
110 | 110 | } else { |
111 | 111 | var i; |
112 | 112 | for(i = 0; i < r.length; i++) { |
113 | 113 | Addr = getAddressElements(r[i].address_components); |
114 | - if(Addr.country == \"" . strtoupper($this->fedName) . "\") |
|
114 | + if(Addr.country == \"" . strtoupper($this->fedName)."\") |
|
115 | 115 | break; |
116 | 116 | } |
117 | - if(Addr.country != \"" . strtoupper($this->fedName) . "\") |
|
118 | - locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)] . "\"); |
|
117 | + if(Addr.country != \"" . strtoupper($this->fedName)."\") |
|
118 | + locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]."\"); |
|
119 | 119 | else { |
120 | 120 | addMarker(r[i].geometry.location,15,null); |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function markerClicked(m) { |
130 | 130 | info_window.close(); |
131 | - var t = \"" . _("This is location ") . "\"+m.info; |
|
131 | + var t = \"" . _("This is location ")."\"+m.info; |
|
132 | 132 | info_window.setContent(t); |
133 | 133 | info_window.setPosition(m.getPosition()); |
134 | 134 | info_window.open(map,m); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | function getAddressLocation() { |
208 | 208 | var city = $('#address').val(); |
209 | 209 | if(city == '') { |
210 | - alert(\"" . _("nothing entered in the address field") . "\"); |
|
210 | + alert(\"" . _("nothing entered in the address field")."\"); |
|
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | geocoder.geocode( { 'address': city}, function(results, status) { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * trigger geolocation |
228 | 228 | */ |
229 | 229 | function locateMe() { |
230 | - $('#address').val(\"" . _("locating") . "\"); |
|
230 | + $('#address').val(\"" . _("locating")."\"); |
|
231 | 231 | navigator.geolocation.getCurrentPosition(locate_succes,locate_fail,{maximumAge:3600000, timeout:5000}); |
232 | 232 | } |
233 | 233 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | if ($this->readOnly) { |
346 | 346 | return "<div id='map' class='googlemap'></div>"; |
347 | 347 | } else { |
348 | - return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<div id='map' class='googlemap'></div>" . $this->htmlPostEdit(FALSE); |
|
348 | + return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<div id='map' class='googlemap'></div>".$this->htmlPostEdit(FALSE); |
|
349 | 349 | } |
350 | 350 | } |
351 | 351 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | // quiesce warnings about unused variable |
361 | 361 | sprintf("%s", $coords); |
362 | 362 | \core\common\Entity::intoThePotatoes(); |
363 | - $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>"; |
|
363 | + $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>"; |
|
364 | 364 | \core\common\Entity::outOfThePotatoes(); |
365 | 365 | return $retval; |
366 | 366 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | * @return string |
372 | 372 | */ |
373 | 373 | public function bodyTagCode() { |
374 | - return "onload='load(" . ($this->readOnly ? "0" : "1") . ")'"; |
|
374 | + return "onload='load(".($this->readOnly ? "0" : "1").")'"; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | /** |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | */ |
382 | 382 | private function findLocationHtml() { |
383 | 383 | \core\common\Entity::intoThePotatoes(); |
384 | - $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>"; |
|
384 | + $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>"; |
|
385 | 385 | \core\common\Entity::outOfThePotatoes(); |
386 | 386 | return $retval; |
387 | 387 | } |
@@ -85,7 +85,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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::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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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>"; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | const DOWNLOAD_REDIRECT_CONTINUE = 1054; |
49 | 49 | const SB_GO_AWAY = 1060; |
50 | 50 | const SB_FRONTPAGE_BIGDOWNLOADBUTTON = 1061; |
51 | -const SB_FRONTPAGE_ROLLER_CUSTOMBUILT= 1062; |
|
51 | +const SB_FRONTPAGE_ROLLER_CUSTOMBUILT = 1062; |
|
52 | 52 | |
53 | 53 | |
54 | 54 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads"); |
88 | 88 | $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), \config\ConfAssistant::CONSORTIUM['display_name']); |
89 | 89 | $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), \config\Master::APPEARANCE['productname']); |
90 | - $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),\config\ConfAssistant::CONSORTIUM['display_name']); |
|
90 | + $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
91 | 91 | $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), \config\ConfAssistant::CONSORTIUM['display_name']); |
92 | 92 | $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = _("Custom built for your organisation"); |
93 | 93 | $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']); |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $langsArray = []; |
41 | 41 | foreach (\config\Master::LANGUAGES as $lang => $value) { |
42 | 42 | if ($lang == $selectedLang) { |
43 | - $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("' . $lang . '")', 'class'=>'selected-lang']; |
|
43 | + $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("'.$lang.'")', 'class'=>'selected-lang']; |
|
44 | 44 | } else { |
45 | - $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("' . $lang . '")']; |
|
45 | + $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("'.$lang.'")']; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | $this->menu = [['id' => 'start', |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | $iD = $menuItem['id'] ?? $id; |
102 | 102 | $catInfo = NULL; |
103 | 103 | if (!empty($menuItem['catInfo'])) { |
104 | - $catInfo = 'javascript:infoCAT("' . $iD . '", "' . $menuItem['catInfo'][0] . '","' . $menuItem['catInfo'][1] . '")'; |
|
104 | + $catInfo = 'javascript:infoCAT("'.$iD.'", "'.$menuItem['catInfo'][0].'","'.$menuItem['catInfo'][1].'")'; |
|
105 | 105 | } |
106 | 106 | if (!empty($menuItem['link']) && substr($menuItem['link'], 0, 1) === '/') { |
107 | - $menuItem['link'] = \core\CAT::getRootUrlPath() . $menuItem['link']; |
|
107 | + $menuItem['link'] = \core\CAT::getRootUrlPath().$menuItem['link']; |
|
108 | 108 | } |
109 | 109 | $link = $catInfo ?? $menuItem['link'] ?? ''; |
110 | - $class = empty($menuItem['class']) ? '' : ' class="' . $menuItem['class'] . '"'; |
|
110 | + $class = empty($menuItem['class']) ? '' : ' class="'.$menuItem['class'].'"'; |
|
111 | 111 | $submenu = $menuItem['submenu'] ?? []; |
112 | 112 | $out .= $this->printMenuItem($menuItem['text'], $link, $class); |
113 | 113 | $out .= $this->printMenu($submenu, $iD); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($itemLink === '') { |
132 | 132 | return("<li><span>$itemText</span>"); |
133 | 133 | } |
134 | - return "<li><a href='" . $itemLink . "'" . $itemClass . '>' . $itemText . "</a>"; |
|
134 | + return "<li><a href='".$itemLink."'".$itemClass.'>'.$itemText."</a>"; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | |
17 | 17 | class CertificationAuthorityEduPki extends EntityWithDBProperties implements CertificationAuthorityInterface { |
18 | 18 | |
19 | - private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
20 | - private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
21 | - private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
19 | + private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
20 | + private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
21 | + private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
22 | 22 | private const EDUPKI_RA_ID = 700; |
23 | 23 | private const EDUPKI_CERT_PROFILE = "User SOAP"; |
24 | 24 | private const EDUPKI_RA_PKEY_PASSPHRASE = "..."; |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | parent::__construct(); |
34 | 34 | |
35 | 35 | if (stat(CertificationAuthorityEduPki::LOCATION_RA_CERT) === FALSE) { |
36 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPki::LOCATION_RA_CERT); |
|
36 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPki::LOCATION_RA_CERT); |
|
37 | 37 | } |
38 | 38 | if (stat(CertificationAuthorityEduPki::LOCATION_RA_KEY) === FALSE) { |
39 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPki::LOCATION_RA_KEY); |
|
39 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPki::LOCATION_RA_KEY); |
|
40 | 40 | } |
41 | 41 | if (stat(CertificationAuthorityEduPki::LOCATION_WEBROOT) === FALSE) { |
42 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPki::LOCATION_WEBROOT); |
|
42 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPki::LOCATION_WEBROOT); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | // initialise connection to eduPKI CA / eduroam RA and send the request to them |
69 | 69 | try { |
70 | 70 | $altArray = [# Array mit den Subject Alternative Names |
71 | - "email:" . $csr["USERNAME"] |
|
71 | + "email:".$csr["USERNAME"] |
|
72 | 72 | ]; |
73 | 73 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
74 | 74 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
75 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPki::EDUPKI_RA_ID . "\n"); |
|
76 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n"); |
|
75 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPki::EDUPKI_RA_ID."\n"); |
|
76 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n"); |
|
77 | 77 | $this->loggerInstance->debug(5, "PARAM_3: "); |
78 | 78 | $this->loggerInstance->debug(5, $altArray); |
79 | - $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE . "\n"); |
|
80 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
81 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
82 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERNAME"] . "\n"); |
|
83 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
79 | + $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE."\n"); |
|
80 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
81 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
82 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERNAME"]."\n"); |
|
83 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
84 | 84 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
85 | 85 | $soapNewRequest = $soapPub->newRequest( |
86 | 86 | CertificationAuthorityEduPki::EDUPKI_RA_ID, # RA-ID |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | } catch (Exception $e) { |
103 | 103 | // PHP 7.1 can do this much better |
104 | 104 | if (is_soap_fault($e)) { |
105 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
105 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
106 | 106 | $e->faultstring |
107 | 107 | }\n"); |
108 | 108 | } |
109 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
109 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
110 | 110 | } |
111 | 111 | try { |
112 | 112 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | $soapReqnum, [ |
119 | 119 | "RaID" => CertificationAuthorityEduPki::EDUPKI_RA_ID, |
120 | 120 | "Role" => CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE, |
121 | - "Subject" => "DC=eduroam,DC=test,DC=test,C=" . $csr["FED"] . ",O=" . \config\ConfAssistant::CONSORTIUM['name'] . ",OU=" . $csr["FED"] . ",CN=" . $csr['USERNAME'] . ",emailAddress=" . $csr['USERNAME'], |
|
122 | - "SubjectAltNames" => ["email:" . $csr["USERNAME"]], |
|
121 | + "Subject" => "DC=eduroam,DC=test,DC=test,C=".$csr["FED"].",O=".\config\ConfAssistant::CONSORTIUM['name'].",OU=".$csr["FED"].",CN=".$csr['USERNAME'].",emailAddress=".$csr['USERNAME'], |
|
122 | + "SubjectAltNames" => ["email:".$csr["USERNAME"]], |
|
123 | 123 | "NotBefore" => (new \DateTime())->format('c'), |
124 | 124 | "NotAfter" => $expiry->format('c'), |
125 | 125 | ] |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
139 | 139 | // rather than just using the string. Grr. |
140 | 140 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
141 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
141 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
142 | 142 | // retrieve our RA cert from filesystem |
143 | 143 | // the RA certificates are not needed right now because we |
144 | 144 | // have resorted to S/MIME signatures with openssl command-line |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
151 | 151 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
152 | 152 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
153 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
153 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
154 | 154 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
155 | 155 | $output = []; |
156 | 156 | $return = 999; |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | throw new Exception("Non-zero return value from openssl smime!"); |
160 | 160 | } |
161 | 161 | // and get the signature blob back from the filesystem |
162 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
162 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
163 | 163 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
164 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
165 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
166 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
164 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
165 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
166 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
167 | 167 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
168 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
169 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
168 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
169 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
170 | 170 | if ($soapIssueCert === FALSE) { |
171 | 171 | throw new Exception("The locally approved request was NOT processed by the CA."); |
172 | 172 | } |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | throw new Exception("CAInfo has no root certificate for us!"); |
204 | 204 | } |
205 | 205 | } catch (SoapFault $e) { |
206 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
206 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
207 | 207 | } catch (Exception $e) { |
208 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
208 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
209 | 209 | } |
210 | 210 | return [ |
211 | 211 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -237,12 +237,12 @@ discard block |
||
237 | 237 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
238 | 238 | // rather than just using the string. Grr. |
239 | 239 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
240 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
240 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
241 | 241 | // retrieve our RA cert from filesystem |
242 | 242 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
243 | 243 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
244 | 244 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
245 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPki::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPki::LOCATION_RA_CERT; |
|
245 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPki::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPki::LOCATION_RA_CERT; |
|
246 | 246 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
247 | 247 | $output = []; |
248 | 248 | $return = 999; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | throw new Exception("Non-zero return value from openssl smime!"); |
252 | 252 | } |
253 | 253 | // and get the signature blob back from the filesystem |
254 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
254 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
255 | 255 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
256 | 256 | if ($soapIssueRev === FALSE) { |
257 | 257 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -259,9 +259,9 @@ discard block |
||
259 | 259 | } catch (Exception $e) { |
260 | 260 | // PHP 7.1 can do this much better |
261 | 261 | if (is_soap_fault($e)) { |
262 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
262 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
263 | 263 | } |
264 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
264 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | * @return string the integer as string in an XML fragment |
359 | 359 | */ |
360 | 360 | public function soapToXmlInteger($x) { |
361 | - return '<' . $x[0] . '>' |
|
361 | + return '<'.$x[0].'>' |
|
362 | 362 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
363 | - . '</' . $x[0] . '>'; |
|
363 | + . '</'.$x[0].'>'; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | /** |
@@ -378,9 +378,9 @@ discard block |
||
378 | 378 | // dump private key into directory |
379 | 379 | $outstring = ""; |
380 | 380 | openssl_pkey_export($privateKey, $outstring); |
381 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
381 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
382 | 382 | // PHP can only do one DC in the Subject. But we need three. |
383 | - $execCmd = \config\Master::PATHS['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username"; |
|
383 | + $execCmd = \config\Master::PATHS['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username"; |
|
384 | 384 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
385 | 385 | $output = []; |
386 | 386 | $return = 999; |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | common\Entity::intoThePotatoes(); |
155 | 155 | $mail = \core\common\OutsideComm::mailHandle(); |
156 | 156 | // who to whom? |
157 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
158 | - $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname'] . " " . _("Feedback")); |
|
157 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
158 | + $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname']." "._("Feedback")); |
|
159 | 159 | $mail->addAddress($mailaddr[0]["value"]); |
160 | 160 | // what do we want to say? |
161 | 161 | $mail->Subject = $subject; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | $lookFor .= "$name"; |
220 | 220 | } |
221 | - $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
221 | + $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
222 | 222 | if ($finding === 0 || $finding === FALSE) { |
223 | 223 | return FALSE; |
224 | 224 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $matchedProviders[] = $idp; |
237 | 237 | $name = $idp; |
238 | 238 | if ($skipCurl == 0) { |
239 | - $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
239 | + $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
240 | 240 | $ch = curl_init($url); |
241 | 241 | if ($ch === FALSE) { |
242 | 242 | $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } |
253 | 253 | curl_close($ch); |
254 | 254 | } |
255 | - $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name; |
|
255 | + $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name; |
|
256 | 256 | } |
257 | 257 | break; |
258 | 258 | case $providerStrings[1]: |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status']; |
143 | 143 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']]; |
144 | 144 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected']; |
145 | - $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private']; |
|
145 | + $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private']; |
|
146 | 146 | if (!isset($this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k])) { |
147 | 147 | $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k] = []; |
148 | 148 | } |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | // but code analysers want this more explicit, so here is this extra |
187 | 187 | // call to escapeshellarg() |
188 | 188 | $escapedHost = escapeshellarg($host); |
189 | - $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1\n"); |
|
189 | + $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1\n"); |
|
190 | 190 | $time_start = microtime(true); |
191 | 191 | $opensslbabble = []; |
192 | 192 | $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures |
193 | - exec(\config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1", $opensslbabble, $result); |
|
193 | + exec(\config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1", $opensslbabble, $result); |
|
194 | 194 | $time_stop = microtime(true); |
195 | 195 | $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000); |
196 | 196 | $testresults['returncode'] = $result; |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | $this->possibleFailureReasons = $_SESSION["SUSPECTS"] ?? []; // if we know nothing, don't talk to anyone |
105 | 105 | $this->additionalFindings = $_SESSION["EVIDENCE"] ?? []; |
106 | 106 | |
107 | - $this->subjectPrefix = _("[eduroam Diagnostics]") . " "; |
|
107 | + $this->subjectPrefix = _("[eduroam Diagnostics]")." "; |
|
108 | 108 | $this->finalGreeting = "\n" |
109 | 109 | . _("(This service is in an early stage. We apologise if this is a false alert. If this is the case, please send an email report to [email protected], forwarding the entire message (including the 'SUSPECTS' and 'EVIDENCE' data at the end), and explain why this is a false positive.)") |
110 | 110 | . "\n" |
111 | - . _("Yours sincerely,") . "\n" |
|
111 | + . _("Yours sincerely,")."\n" |
|
112 | 112 | . "\n" |
113 | 113 | . _("Ed U. Roam, the eduroam diagnostics algorithm"); |
114 | 114 | |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | "bcc" => [], |
120 | 120 | "reply-to" => [Logopath::EDUROAM_OT], |
121 | 121 | "subject" => _("[POLICYVIOLATION NATIONAL] IdP with no entry in eduroam database"), |
122 | - "body" => _("Dear NRO administrator,") . "\n" |
|
122 | + "body" => _("Dear NRO administrator,")."\n" |
|
123 | 123 | . "\n" |
124 | - . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) . "\n" |
|
124 | + . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar"))."\n" |
|
125 | 125 | . "\n" |
126 | - . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.") . "\n" |
|
126 | + . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.")."\n" |
|
127 | 127 | . "\n" |
128 | - . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.") . "\n" |
|
128 | + . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.")."\n" |
|
129 | 129 | . "\n" |
130 | 130 | . "Please stop the policy violation ASAP by listing the IdP which is associated to this realm.", |
131 | 131 | ], |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | $handle = \core\common\OutsideComm::mailHandle(); |
281 | 281 | // let's identify outselves |
282 | - $handle->FromName = \config\Master::APPEARANCE['productname'] . " Real-Time Diagnostics System"; |
|
282 | + $handle->FromName = \config\Master::APPEARANCE['productname']." Real-Time Diagnostics System"; |
|
283 | 283 | // add recipients |
284 | 284 | foreach (Logopath::CATEGORYBINDING as $arrayName => $functionName) { |
285 | 285 | foreach ($theMail[$arrayName] as $onePrincipal) { |
@@ -120,7 +120,7 @@ discard block |
||
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 |
||
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 |
||
234 | 234 | $matchArray = []; |
235 | 235 | preg_match('/([^ ]+) ?/', $config[$pathToCheck], $matchArray); |
236 | 236 | $exe = $matchArray[1]; |
237 | - $the_path = exec("which " . $config[$pathToCheck]); |
|
237 | + $the_path = exec("which ".$config[$pathToCheck]); |
|
238 | 238 | if ($the_path == $exe) { |
239 | 239 | $exec_is = "EXPLICIT"; |
240 | 240 | } else { |
@@ -253,9 +253,9 @@ discard block |
||
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 |
||
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::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::PATHS['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>"); |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
@@ -291,7 +291,7 @@ discard block |
||
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 |
||
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 |
||
364 | 364 | * @return void |
365 | 365 | */ |
366 | 366 | private function testLogdir() { |
367 | - if (fopen(\config\Master::PATHS['logdir'] . "/debug.log", "a") == FALSE) { |
|
368 | - $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::PATHS['logdir'] . "</strong> are not writable!"); |
|
367 | + if (fopen(\config\Master::PATHS['logdir']."/debug.log", "a") == FALSE) { |
|
368 | + $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::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 |
||
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 |
||
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 |
||
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 |
||
615 | 615 | $locales = shell_exec("locale -a"); |
616 | 616 | $allthere = ""; |
617 | 617 | foreach (\config\Master::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 |
||
630 | 630 | ["SETTING" => \config\Master::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::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::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::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::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::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::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::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::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::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::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 |
||
696 | 696 | |
697 | 697 | foreach (\config\Diagnostics::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 |
||
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 |
||
835 | 835 | $mail->isHTML(FALSE); |
836 | 836 | $mail->CharSet = 'UTF-8'; |
837 | 837 | $mail->From = \config\Master::APPEARANCE['from-mail']; |
838 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System"; |
|
838 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System"; |
|
839 | 839 | $mail->addAddress(\config\Master::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::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::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 | } |