@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $deco = new \web\lib\admin\PageDecoration(); |
32 | 32 | $validator = new \web\lib\common\InputValidation(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } else { |
39 | 39 | $link = 'http://'; |
40 | 40 | } |
41 | -$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']; |
|
41 | +$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; |
|
42 | 42 | $link = htmlspecialchars($link); |
43 | 43 | |
44 | 44 | echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureHotspot)); |
@@ -102,21 +102,21 @@ discard block |
||
102 | 102 | <?php |
103 | 103 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) { |
104 | 104 | echo "<tr> |
105 | - <td>" . sprintf(_("Diagnose reachability and connection parameters of %ss"),$uiElements->nomenclatureInst) . "</td> |
|
105 | + <td>" . sprintf(_("Diagnose reachability and connection parameters of %ss"), $uiElements->nomenclatureInst)."</td> |
|
106 | 106 | <td><form method='post' action='../diag/action_realmcheck.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'> |
107 | 107 | <!--<input type='text' name='realm' id='realm'>--> |
108 | 108 | <input type='hidden' name='comefrom' id='comefrom' value='$link'/> |
109 | - <button id='realmcheck' style='cursor:pointer;' type='submit'>" . _("Go!") . "</button> |
|
109 | + <button id='realmcheck' style='cursor:pointer;' type='submit'>"._("Go!")."</button> |
|
110 | 110 | </form> |
111 | 111 | </td> |
112 | 112 | </tr>"; |
113 | 113 | } |
114 | 114 | if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam") { // SW: APPROVED |
115 | 115 | echo "<tr> |
116 | - <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed) . "</td> |
|
116 | + <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed)."</td> |
|
117 | 117 | <td> |
118 | 118 | <form action='https://monitor.eduroam.org/mon_direct.php' accept-charset='UTF-8'> |
119 | - <button style='cursor:pointer;' type='submit'>" . _("Go!") . "</button> |
|
119 | + <button style='cursor:pointer;' type='submit'>" . _("Go!")."</button> |
|
120 | 120 | </form> |
121 | 121 | </td> |
122 | 122 | </tr>"; |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | <?php |
128 | 128 | $hotspotProfiles = $my_inst->listDeployments(); |
129 | 129 | if (count($hotspotProfiles) == 0) { // no profiles yet. |
130 | - echo "<h2>" . sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot) . "</h2>"; |
|
130 | + echo "<h2>".sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot)."</h2>"; |
|
131 | 131 | } |
132 | 132 | if (count($hotspotProfiles) > 0) { // no profiles yet. |
133 | - echo "<h2>" . sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot) . "</h2>"; |
|
133 | + echo "<h2>".sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot)."</h2>"; |
|
134 | 134 | // display an info box with the connection data |
135 | 135 | } |
136 | 136 | |
@@ -149,19 +149,19 @@ discard block |
||
149 | 149 | ?> |
150 | 150 | <div style='display: table-row_id; margin-bottom: 20px;'> |
151 | 151 | <div class='profilebox' style='display: table-cell;'> |
152 | - <h2><?php echo core\DeploymentManaged::PRODUCTNAME . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; ?></h2> |
|
152 | + <h2><?php echo core\DeploymentManaged::PRODUCTNAME." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; ?></h2> |
|
153 | 153 | <table> |
154 | 154 | <tr> |
155 | 155 | <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/> |
156 | 156 | <?php |
157 | 157 | if ($deploymentObject->host1_v4 !== NULL) { |
158 | - echo _("IPv4") . ": " . $deploymentObject->host1_v4; |
|
158 | + echo _("IPv4").": ".$deploymentObject->host1_v4; |
|
159 | 159 | } |
160 | 160 | if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) { |
161 | 161 | echo "<br/>"; |
162 | 162 | } |
163 | 163 | if ($deploymentObject->host1_v6 !== NULL) { |
164 | - echo _("IPv6") . ": " . $deploymentObject->host1_v6; |
|
164 | + echo _("IPv6").": ".$deploymentObject->host1_v6; |
|
165 | 165 | } |
166 | 166 | ?> |
167 | 167 | </td> |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | <td><?php echo $deploymentObject->port1; ?></td> |
170 | 170 | <td> |
171 | 171 | <?php |
172 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
173 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
174 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>"; |
|
172 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
173 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
174 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."'>"; |
|
175 | 175 | ?> |
176 | 176 | </td> |
177 | 177 | </tr> |
@@ -179,22 +179,22 @@ discard block |
||
179 | 179 | <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong> |
180 | 180 | <?php |
181 | 181 | if ($deploymentObject->host2_v4 !== NULL) { |
182 | - echo _("IPv4") . ": " . $deploymentObject->host2_v4; |
|
182 | + echo _("IPv4").": ".$deploymentObject->host2_v4; |
|
183 | 183 | } |
184 | 184 | if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) { |
185 | 185 | echo "<br/>"; |
186 | 186 | } |
187 | 187 | if ($deploymentObject->host2_v6 !== NULL) { |
188 | - echo _("IPv6") . ": " . $deploymentObject->host2_v6; |
|
188 | + echo _("IPv6").": ".$deploymentObject->host2_v6; |
|
189 | 189 | } |
190 | 190 | ?></td> |
191 | 191 | <td><?php echo _("RADIUS port number: ") ?></td> |
192 | 192 | <td><?php echo $deploymentObject->port2; ?></td> |
193 | 193 | <td> |
194 | 194 | <?php |
195 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
196 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
197 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>"; |
|
195 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
196 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
197 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."'>"; |
|
198 | 198 | ?> |
199 | 199 | </td> |
200 | 200 | </tr> |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
246 | 246 | echo '<br>'; |
247 | 247 | if ($res['FAILURE'] == 2) { |
248 | - echo ' <span style="color: red;">' . _("Activation failure.") . '</span>'; |
|
248 | + echo ' <span style="color: red;">'._("Activation failure.").'</span>'; |
|
249 | 249 | } else { |
250 | 250 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
251 | - echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>'; |
|
251 | + echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>'; |
|
252 | 252 | } else { |
253 | - echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>'; |
|
253 | + echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>'; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | } |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | if ($res['FAILURE'] > 0) { |
271 | 271 | echo '<br>'; |
272 | 272 | if ($res['FAILURE'] == 2) { |
273 | - echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>'; |
|
273 | + echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>'; |
|
274 | 274 | } else { |
275 | 275 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
276 | - echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>'; |
|
276 | + echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>'; |
|
277 | 277 | } else { |
278 | - echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>'; |
|
278 | + echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>'; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function prefilledOptionTable(string $attributePrefix, $fed) |
114 | 114 | { |
115 | - $retval = "<table id='expandable_$attributePrefix" . "_options'>"; |
|
115 | + $retval = "<table id='expandable_$attributePrefix"."_options'>"; |
|
116 | 116 | |
117 | 117 | $prepopulate = []; |
118 | 118 | foreach ($this->listOfOptions as $existingAttribute) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $prepopulate[] = $existingAttribute; |
121 | 121 | } |
122 | 122 | } |
123 | - if (is_array($prepopulate) && ( count($prepopulate) > 0 || $attributePrefix == "device-specific" || $attributePrefix == "eap-specific" )) { // editing... fill with values |
|
123 | + if (is_array($prepopulate) && (count($prepopulate) > 0 || $attributePrefix == "device-specific" || $attributePrefix == "eap-specific")) { // editing... fill with values |
|
124 | 124 | $retval .= $this->addOptionEdit($attributePrefix, $prepopulate); |
125 | 125 | } else { |
126 | 126 | $retval .= $this->addOptionNew($attributePrefix, $fed); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $optiontypearray = $optioninfo->optionType($option['name']); |
154 | 154 | $loggerInstance = new \core\common\Logging(); |
155 | 155 | $loggerInstance->debug(5, "About to execute optiontext with PREFILL!\n"); |
156 | - $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-' . $option['level'] . '-' . $option['row_id'] : $option['value']), $option['lang']); |
|
156 | + $retval .= $this->optiontext([$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-'.$option['level'].'-'.$option['row_id'] : $option['value']), $option['lang']); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | return $retval; |
@@ -250,18 +250,18 @@ discard block |
||
250 | 250 | } |
251 | 251 | $descriptions["media:force_proxy"] = sprintf(_("The format of this option is: IPv4|IPv6|hostname:port . Forcing your users through a content filter of your own is a significant invasion of user self-determination. It also has technical issues. Please thoroughly read the discussion at %s before specifying a proxy with this option. This feature is currently experimental and only has an effect in Apple installers."), "https://github.com/GEANT/CAT/issues/96"); |
252 | 252 | $descriptions["managedsp:realmforvlan"] = sprintf(_("If you are also using %s, then your own realm is automatically tagged with the VLAN you choose, there is no need to add it here manually."), \core\ProfileSilverbullet::PRODUCTNAME); |
253 | - $descriptions["media:openroaming"] = sprintf(_("By opting in to OpenRoaming, you agree to be bound by the %s."), "eduroam Ecosystem Broker OpenRoaming Identity Provider Policy") . |
|
254 | - " " . |
|
255 | - sprintf(_("Note that your requirement to inform users about the OpenRoaming End User Terms and Conditions is fulfilled when directing your end users to the %s download portal for installer download. Any other means of providing the installers needs to present this information via its own channel."), \config\Master::APPEARANCE['productname']) . |
|
256 | - " " . |
|
257 | - _("You are also aware that for best technical interoperability, you need to add a DNS entry into the DNS zone of your RADIUS realm.") . |
|
258 | - " " . |
|
253 | + $descriptions["media:openroaming"] = sprintf(_("By opting in to OpenRoaming, you agree to be bound by the %s."), "eduroam Ecosystem Broker OpenRoaming Identity Provider Policy"). |
|
254 | + " ". |
|
255 | + sprintf(_("Note that your requirement to inform users about the OpenRoaming End User Terms and Conditions is fulfilled when directing your end users to the %s download portal for installer download. Any other means of providing the installers needs to present this information via its own channel."), \config\Master::APPEARANCE['productname']). |
|
256 | + " ". |
|
257 | + _("You are also aware that for best technical interoperability, you need to add a DNS entry into the DNS zone of your RADIUS realm."). |
|
258 | + " ". |
|
259 | 259 | _("Read the instructions in the wiki."); |
260 | 260 | \core\common\Entity::outOfThePotatoes(); |
261 | 261 | if (!isset($descriptions[$input])) { |
262 | 262 | return ""; |
263 | 263 | } |
264 | - 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>"; |
|
264 | + 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>"; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -275,19 +275,19 @@ discard block |
||
275 | 275 | private function selectElement($rowid, $list) |
276 | 276 | { |
277 | 277 | $jsmagic = "onchange=' |
278 | - if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) { |
|
278 | + if (/#ML#/.test(document.getElementById(\"option-S" . $rowid."-select\").value)) { |
|
279 | 279 | document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\"; |
280 | 280 | } else { |
281 | 281 | document.getElementById(\"S$rowid-input-langselect\").style.display = \"none\"; |
282 | 282 | }"; |
283 | 283 | foreach (array_keys($this->htmlDatatypeTexts) as $key) { |
284 | - $jsmagic .= "if (/#" . $key . "#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) { |
|
285 | - document.getElementById(\"S$rowid-input-file\").style.display = \"" . ($key == \core\Options::TYPECODE_FILE ? "block" : "none") . "\"; |
|
286 | - document.getElementById(\"S$rowid-input-text\").style.display = \"" . ($key == \core\Options::TYPECODE_TEXT ? "block" : "none") . "\"; |
|
287 | - document.getElementById(\"S$rowid-input-string\").style.display = \"" . ($key == \core\Options::TYPECODE_STRING ? "block" : "none") . "\"; |
|
288 | - document.getElementById(\"S$rowid-input-enum_openroaming\").style.display = \"" . ($key == \core\Options::TYPECODE_ENUM_OPENROAMING ? "block" : "none") . "\"; |
|
289 | - document.getElementById(\"S$rowid-input-boolean\").style.display = \"" . ($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none") . "\"; |
|
290 | - document.getElementById(\"S$rowid-input-integer\").style.display = \"" . ($key == \core\Options::TYPECODE_INTEGER ? "block" : "none") . "\"; |
|
284 | + $jsmagic .= "if (/#".$key."#/.test(document.getElementById(\"option-S".$rowid."-select\").value)) { |
|
285 | + document.getElementById(\"S$rowid-input-file\").style.display = \"".($key == \core\Options::TYPECODE_FILE ? "block" : "none")."\"; |
|
286 | + document.getElementById(\"S$rowid-input-text\").style.display = \"".($key == \core\Options::TYPECODE_TEXT ? "block" : "none")."\"; |
|
287 | + document.getElementById(\"S$rowid-input-string\").style.display = \"".($key == \core\Options::TYPECODE_STRING ? "block" : "none")."\"; |
|
288 | + document.getElementById(\"S$rowid-input-enum_openroaming\").style.display = \"".($key == \core\Options::TYPECODE_ENUM_OPENROAMING ? "block" : "none")."\"; |
|
289 | + document.getElementById(\"S$rowid-input-boolean\").style.display = \"".($key == \core\Options::TYPECODE_BOOLEAN ? "block" : "none")."\"; |
|
290 | + document.getElementById(\"S$rowid-input-integer\").style.display = \"".($key == \core\Options::TYPECODE_INTEGER ? "block" : "none")."\"; |
|
291 | 291 | } |
292 | 292 | "; |
293 | 293 | // hide all tooltips (each is a <span>, and there are no other <span>s) |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $value = array_shift($list); |
319 | 319 | $listtype = $optioninfo->optionType($value); |
320 | 320 | $retval .= $uiElements->displayName($value); |
321 | - $retval .= "<input type='hidden' name='option[S$rowid]' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#'/>"; |
|
321 | + $retval .= "<input type='hidden' name='option[S$rowid]' value='$value#".$listtype["type"]."#".$listtype["flag"]."#'/>"; |
|
322 | 322 | $activelisttype = $listtype; |
323 | 323 | $tooltips = $this->tooltip($rowid, $value, TRUE); |
324 | 324 | break; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $retval .= "<select id='option-S$rowid-select' name='option[S$rowid]' $jsmagic>"; |
327 | 327 | foreach ($list as $value) { |
328 | 328 | $listtype = $optioninfo->optionType($value); |
329 | - $retval .= "<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' "; |
|
329 | + $retval .= "<option id='option-S$rowid-v-$value' value='$value#".$listtype["type"]."#".$listtype["flag"]."#' "; |
|
330 | 330 | if ($iterator == $this->optionIterator) { |
331 | 331 | $retval .= "selected='selected'"; |
332 | 332 | $activelisttype = $listtype; |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | } else { |
335 | 335 | $tooltips .= $this->tooltip($rowid, $value, FALSE); |
336 | 336 | } |
337 | - $retval .= ">" . $uiElements->displayName($value) . "</option>"; |
|
337 | + $retval .= ">".$uiElements->displayName($value)."</option>"; |
|
338 | 338 | $iterator++; |
339 | 339 | } |
340 | 340 | |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | private function selectLanguage($rowid, $makeVisible) |
361 | 361 | { |
362 | 362 | \core\common\Entity::intoThePotatoes(); |
363 | - $retval = "<select style='display:" . ($makeVisible ? "block" : "none") . "' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect'> |
|
364 | - <option value='' name='select_language' selected>" . _("select language") . "</option> |
|
365 | - <option value='C' name='all_languages'>" . _("default/other languages") . "</option>"; |
|
363 | + $retval = "<select style='display:".($makeVisible ? "block" : "none")."' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect'> |
|
364 | + <option value='' name='select_language' selected>" . _("select language")."</option> |
|
365 | + <option value='C' name='all_languages'>" . _("default/other languages")."</option>"; |
|
366 | 366 | foreach (\config\Master::LANGUAGES as $langindex => $possibleLang) { |
367 | 367 | $thislang = $possibleLang['display']; |
368 | 368 | $retval .= "<option value='$langindex' name='$langindex'>$thislang</option>"; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | { |
384 | 384 | $retval = ""; |
385 | 385 | foreach ($this->htmlDatatypeTexts as $key => $type) { |
386 | - $retval .= "<" . $type['html'] . " style='display:" . ($activetype['type'] == $key ? "block" : "none") . "' name='value[S$rowid-$key]' id='S" . $rowid . "-input-" . $key . "'" . $type['tail'] . ">"; |
|
386 | + $retval .= "<".$type['html']." style='display:".($activetype['type'] == $key ? "block" : "none")."' name='value[S$rowid-$key]' id='S".$rowid."-input-".$key."'".$type['tail'].">"; |
|
387 | 387 | } |
388 | 388 | return $retval; |
389 | 389 | } |
@@ -399,11 +399,11 @@ discard block |
||
399 | 399 | { |
400 | 400 | // first column: the <select> element with the names of options and their field-toggling JS magic |
401 | 401 | $selectorInfo = $this->selectElement($rowid, $list); |
402 | - $retval = "<td>" . $selectorInfo["TEXT"] . "</td>"; |
|
402 | + $retval = "<td>".$selectorInfo["TEXT"]."</td>"; |
|
403 | 403 | // second column: the <select> element for language selection - only visible if the active option is multi-lang |
404 | - $retval .= "<td>" . $this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML") . "</td>"; |
|
404 | + $retval .= "<td>".$this->selectLanguage($rowid, $selectorInfo['ACTIVE']['flag'] == "ML")."</td>"; |
|
405 | 405 | // third column: the actual input fields; the data type of the active option is visible, all others hidden |
406 | - $retval .= "<td>" . $this->inputFields($rowid, $selectorInfo['ACTIVE']) . "</td>"; |
|
406 | + $retval .= "<td>".$this->inputFields($rowid, $selectorInfo['ACTIVE'])."</td>"; |
|
407 | 407 | return $retval; |
408 | 408 | } |
409 | 409 | |
@@ -427,20 +427,20 @@ discard block |
||
427 | 427 | $retval .= "<td>"; |
428 | 428 | $uiElements = new UIElements(); |
429 | 429 | $listtype = $optioninfo->optionType($optionName); |
430 | - $retval .= "<span style='display:flex;'>" . $uiElements->displayName($optionName); |
|
431 | - $retval .= $this->tooltip($rowid, $optionName, TRUE) . "</span>"; |
|
432 | - $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#" . $listtype["type"] . "#" . $listtype["flag"] . "#' ></td>"; |
|
430 | + $retval .= "<span style='display:flex;'>".$uiElements->displayName($optionName); |
|
431 | + $retval .= $this->tooltip($rowid, $optionName, TRUE)."</span>"; |
|
432 | + $retval .= "<input type='hidden' id='option-S$rowid-select' name='option[S$rowid]' value='$optionName#".$listtype["type"]."#".$listtype["flag"]."#' ></td>"; |
|
433 | 433 | |
434 | 434 | // language tag if any |
435 | 435 | $retval .= "<td>"; |
436 | 436 | if ($listtype["flag"] == "ML") { |
437 | 437 | |
438 | - $language = "(" . strtoupper($optionLang) . ")"; |
|
438 | + $language = "(".strtoupper($optionLang).")"; |
|
439 | 439 | if ($optionLang == 'C') { |
440 | 440 | $language = _("(default/other languages)"); |
441 | 441 | } |
442 | 442 | $retval .= $language; |
443 | - $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect' value='" . $optionLang . "' style='display:block'>"; |
|
443 | + $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S".$rowid."-input-langselect' value='".$optionLang."' style='display:block'>"; |
|
444 | 444 | } |
445 | 445 | $retval .= "</td>"; |
446 | 446 | // attribute content |
@@ -450,12 +450,12 @@ discard block |
||
450 | 450 | case \core\Options::TYPECODE_COORDINATES: |
451 | 451 | $this->allLocationCount = $this->allLocationCount + 1; |
452 | 452 | // display of the locations varies by map provider |
453 | - $classname = "\web\lib\admin\Map" . \config\ConfAssistant::MAPPROVIDER['PROVIDER']; |
|
453 | + $classname = "\web\lib\admin\Map".\config\ConfAssistant::MAPPROVIDER['PROVIDER']; |
|
454 | 454 | $link = $classname::optionListDisplayCode($optionValue, $this->allLocationCount); |
455 | - $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-" . \core\Options::TYPECODE_TEXT . "]' id='S$rowid-input-text' value='$optionValue'>$link"; |
|
455 | + $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-".\core\Options::TYPECODE_TEXT."]' id='S$rowid-input-text' value='$optionValue'>$link"; |
|
456 | 456 | break; |
457 | 457 | case \core\Options::TYPECODE_FILE: |
458 | - $retval .= "<input readonly type='text' name='value[S$rowid-" . \core\Options::TYPECODE_STRING . "]' id='S" . $rowid . "-input-string' style='display:none' value='" . urlencode($optionValue) . "'>"; |
|
458 | + $retval .= "<input readonly type='text' name='value[S$rowid-".\core\Options::TYPECODE_STRING."]' id='S".$rowid."-input-string' style='display:none' value='".urlencode($optionValue)."'>"; |
|
459 | 459 | $uiElements = new UIElements(); |
460 | 460 | switch ($optionName) { |
461 | 461 | case "eap:ca_file": |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | break; |
478 | 478 | case \core\Options::TYPECODE_ENUM_OPENROAMING: // is a string after all |
479 | 479 | $displayedVariant = $this->enumPrettyPrints[$optionValue]; |
480 | - $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'>"; |
|
480 | + $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'>"; |
|
481 | 481 | break; |
482 | 482 | case \core\Options::TYPECODE_STRING: |
483 | 483 | // fall-thorugh is intentional; mostly identical HTML code for the three types |
@@ -485,11 +485,11 @@ discard block |
||
485 | 485 | // fall-thorugh is intentional; mostly identical HTML code for the three types |
486 | 486 | case \core\Options::TYPECODE_TEXT: |
487 | 487 | $displayedVariant = $optionValue; // for all three types, value tag and actual display are identical |
488 | - $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'>"; |
|
488 | + $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'>"; |
|
489 | 489 | break; |
490 | 490 | case \core\Options::TYPECODE_BOOLEAN: |
491 | 491 | $displayedVariant = ($optionValue == "on" ? _("on") : _("off")); |
492 | - $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'>"; |
|
492 | + $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'>"; |
|
493 | 493 | break; |
494 | 494 | default: |
495 | 495 | // this should never happen! |
@@ -535,10 +535,10 @@ discard block |
||
535 | 535 | <td> |
536 | 536 | <button type='button' class='delete' onclick='"; |
537 | 537 | if ($prefillValue !== NULL && $item == "general:geo_coordinates") { |
538 | - $funcname = "Map" . \config\ConfAssistant::MAPPROVIDER['PROVIDER'] . 'DeleteCoord'; |
|
539 | - $retval .= 'if (typeof ' . $funcname . ' === "function") { ' . $funcname . '(' . $this->allLocationCount . '); } '; |
|
538 | + $funcname = "Map".\config\ConfAssistant::MAPPROVIDER['PROVIDER'].'DeleteCoord'; |
|
539 | + $retval .= 'if (typeof '.$funcname.' === "function") { '.$funcname.'('.$this->allLocationCount.'); } '; |
|
540 | 540 | } |
541 | - $retval .= 'deleteOption("option-S' . $rowid . '")'; |
|
541 | + $retval .= 'deleteOption("option-S'.$rowid.'")'; |
|
542 | 542 | $retval .= "'>-</button> |
543 | 543 | </td> |
544 | 544 | </tr>"; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | sprintf(_("%s: Do not terminate EAP"), \core\ProfileSilverbullet::PRODUCTNAME) => "fed:silverbullet-noterm", |
134 | 134 | sprintf(_("%s: max users per profile"), \core\ProfileSilverbullet::PRODUCTNAME) => "fed:silverbullet-maxusers", |
135 | 135 | sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP) => "fed:minted_ca_file", |
136 | - sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant) => "fed:openroaming", |
|
136 | + sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant) => "fed:openroaming", |
|
137 | 137 | _("OpenRoaming: Custom NAPTR Target") => "fed:openroaming_customtarget", |
138 | 138 | $ssidText => "media:SSID", |
139 | 139 | $passpointOiText => "media:consortium_OI", |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $find = array_keys($displayNames, $input, TRUE); |
146 | 146 | |
147 | 147 | if (count($find) == 0) { // this is an error! throw an Exception |
148 | - throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input)); |
|
148 | + throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input)); |
|
149 | 149 | } |
150 | 150 | \core\common\Entity::outOfThePotatoes(); |
151 | 151 | // none of the strings have HTML in them, only translators can provide own text for it -> no threat, but complained about by the security review |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | foreach ($optionlist as $option) { |
169 | 169 | $type = $optioninfo->optionType($option['name']); |
170 | - if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") { |
|
170 | + if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") { |
|
171 | 171 | // all non-multilang attribs get this assignment ... |
172 | 172 | $language = ""; |
173 | 173 | $content = $option['value']; |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | $locationMarkers[] = $coords; |
186 | 186 | break; |
187 | 187 | case "file": |
188 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>"; |
|
188 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>"; |
|
189 | 189 | switch ($option['name']) { |
190 | 190 | case "general:logo_file": |
191 | 191 | case "fed:logo_file": |
192 | - $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
192 | + $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
193 | 193 | break; |
194 | 194 | case "eap:ca_file": |
195 | 195 | // fall-through intended: display both the same way |
196 | 196 | case "fed:minted_ca_file": |
197 | - $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
197 | + $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
198 | 198 | break; |
199 | 199 | case "support:info_file": |
200 | - $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
200 | + $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
201 | 201 | break; |
202 | 202 | default: |
203 | 203 | } |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen |
208 | 208 | break; |
209 | 209 | } |
210 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
210 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>"; |
|
211 | 211 | break; |
212 | 212 | default: |
213 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
213 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | } |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | $locationCount = 0; |
220 | 220 | foreach ($locationMarkers as $g) { |
221 | 221 | $locationCount++; |
222 | - $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />'; |
|
222 | + $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />'; |
|
223 | 223 | } |
224 | 224 | $marker .= '<\/markers>'; // some validator says this should be escaped |
225 | 225 | $jMarker = json_encode($locationMarkers); |
226 | - $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>'; |
|
226 | + $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>'; |
|
227 | 227 | } |
228 | 228 | \core\common\Entity::outOfThePotatoes(); |
229 | 229 | return $retval; |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | \core\common\Entity::intoThePotatoes(); |
240 | 240 | $idpoptions = $myInst->getAttributes(); |
241 | 241 | $retval = "<div class='infobox'> |
242 | - <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2> |
|
242 | + <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2> |
|
243 | 243 | <table> |
244 | 244 | <tr> |
245 | 245 | <td> |
246 | - " . _("Country:") . " |
|
246 | + " . _("Country:")." |
|
247 | 247 | </td> |
248 | 248 | <td> |
249 | 249 | </td> |
@@ -253,16 +253,16 @@ discard block |
||
253 | 253 | $retval .= $myFed->name; |
254 | 254 | $retval .= "</strong> |
255 | 255 | </td> |
256 | - </tr>" . $this->infoblock($idpoptions, "general", "IdP") . " |
|
256 | + </tr>" . $this->infoblock($idpoptions, "general", "IdP")." |
|
257 | 257 | </table> |
258 | 258 | </div>"; |
259 | 259 | |
260 | 260 | $blocks = [["support", _("Global Helpdesk Details")], ["media", _("Media Properties")]]; |
261 | 261 | foreach ($blocks as $block) { |
262 | 262 | $retval .= "<div class='infobox'> |
263 | - <h2>" . $block[1] . "</h2> |
|
263 | + <h2>" . $block[1]."</h2> |
|
264 | 264 | <table>" . |
265 | - $this->infoblock($idpoptions, $block[0], "IdP") . |
|
265 | + $this->infoblock($idpoptions, $block[0], "IdP"). |
|
266 | 266 | "</table> |
267 | 267 | </div>"; |
268 | 268 | } |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | */ |
278 | 278 | private function displaySize(int $number) { |
279 | 279 | if ($number > 1024 * 1024) { |
280 | - return round($number / 1024 / 1024, 2) . " MiB"; |
|
280 | + return round($number / 1024 / 1024, 2)." MiB"; |
|
281 | 281 | } |
282 | 282 | if ($number > 1024) { |
283 | - return round($number / 1024, 2) . " KiB"; |
|
283 | + return round($number / 1024, 2)." KiB"; |
|
284 | 284 | } |
285 | - return $number . " B"; |
|
285 | + return $number." B"; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $ref = $validator->databaseReference($cAReference); |
337 | 337 | $rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
338 | 338 | if (is_bool($rawResult)) { // we didn't actually get a CA! |
339 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>"; |
|
339 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>"; |
|
340 | 340 | \core\common\Entity::outOfThePotatoes(); |
341 | 341 | return $retval; |
342 | 342 | } |
@@ -352,14 +352,14 @@ discard block |
||
352 | 352 | |
353 | 353 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
354 | 354 | $details['name'] = preg_replace('/\//', "", $details['name']); |
355 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
356 | - $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
355 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
356 | + $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
357 | 357 | if ($details['ca'] == 0 && $details['root'] != 1) { |
358 | - $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
|
358 | + $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>"._("This is a <strong>SERVER</strong> certificate!")."<br/>".$details['name']."</div>"; |
|
359 | 359 | \core\common\Entity::outOfThePotatoes(); |
360 | 360 | return $retval; |
361 | 361 | } |
362 | - $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $details['name'] . "</div>"; |
|
362 | + $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$details['name']."</div>"; |
|
363 | 363 | \core\common\Entity::outOfThePotatoes(); |
364 | 364 | return $retval; |
365 | 365 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function previewImageinHTML($imageReference) { |
374 | 374 | \core\common\Entity::intoThePotatoes(); |
375 | - $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>"; |
|
375 | + $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>"; |
|
376 | 376 | \core\common\Entity::outOfThePotatoes(); |
377 | 377 | return $retval; |
378 | 378 | } |
@@ -389,13 +389,13 @@ discard block |
||
389 | 389 | $ref = $validator->databaseReference($fileReference); |
390 | 390 | $fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
391 | 391 | if (is_bool($fileBlob)) { // we didn't actually get a file! |
392 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>"; |
|
392 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>"; |
|
393 | 393 | \core\common\Entity::outOfThePotatoes(); |
394 | 394 | return $retval; |
395 | 395 | } |
396 | 396 | $decodedFileBlob = base64_decode($fileBlob); |
397 | 397 | $fileinfo = new \finfo(); |
398 | - $retval = "<div class='ca-summary'>" . _("File exists") . " (" . $fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE) . ", " . $this->displaySize(strlen($decodedFileBlob)) . ")<br/><a href='inc/filepreview.php?id=$fileReference'>" . _("Preview") . "</a></div>"; |
|
398 | + $retval = "<div class='ca-summary'>"._("File exists")." (".$fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE).", ".$this->displaySize(strlen($decodedFileBlob)).")<br/><a href='inc/filepreview.php?id=$fileReference'>"._("Preview")."</a></div>"; |
|
399 | 399 | \core\common\Entity::outOfThePotatoes(); |
400 | 400 | return $retval; |
401 | 401 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $retval .= "<tr><td>"; |
424 | 424 | } |
425 | 425 | $finalCaption = ($caption !== NULL ? $caption : $uiMessages[$level]['text']); |
426 | - $retval .= "<img class='icon' src='" . $uiMessages[$level]['icon'] . "' alt='" . $finalCaption . "' title='" . $finalCaption . "'/>"; |
|
426 | + $retval .= "<img class='icon' src='".$uiMessages[$level]['icon']."' alt='".$finalCaption."' title='".$finalCaption."'/>"; |
|
427 | 427 | if (!$omittabletags) { |
428 | 428 | $retval .= "</td><td>"; |
429 | 429 | } |
@@ -505,8 +505,8 @@ discard block |
||
505 | 505 | return ""; |
506 | 506 | } |
507 | 507 | |
508 | - $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
509 | - $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
508 | + $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png"); |
|
509 | + $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png"); |
|
510 | 510 | if ($logogd === FALSE) { // consortium logo is bogus; don't do anything |
511 | 511 | return ""; |
512 | 512 | } |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | imagecolorallocate($whiteimage, 255, 255, 255); |
533 | 533 | // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected |
534 | 534 | $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize)); |
535 | - $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize)); |
|
535 | + $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize)); |
|
536 | 536 | imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
537 | 537 | imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]); |
538 | 538 | ob_start(); |
@@ -582,9 +582,9 @@ discard block |
||
582 | 582 | $message = "Your configuration appears to be fine."; |
583 | 583 | break; |
584 | 584 | default: |
585 | - throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!"); |
|
585 | + throw new Exception("The result code level ".$test->test_result['global']." is not defined!"); |
|
586 | 586 | } |
587 | - $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>"); |
|
587 | + $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>"); |
|
588 | 588 | foreach ($test->out as $testValue) { |
589 | 589 | foreach ($testValue as $o) { |
590 | 590 | $out .= $this->boxFlexible($o['level'], $o['message']); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | 'message_only' => 0, |
424 | 424 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
425 | 425 | "geteduroam", |
426 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>" . _("as local download") . "</a>"), |
|
426 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>"._("as local download")."</a>"), |
|
427 | 427 | |
428 | 428 | 'geteduroam_text' => sprintf(_("Use our app, it will guide you through the setup process:%s" |
429 | 429 | ."(or download it manually %s.)<p>" |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | 'mime' => 'application/eap-config', |
452 | 452 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
453 | 453 | "geteduroam", |
454 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>" . _("as local download") . "</a>"), |
|
454 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>"._("as local download")."</a>"), |
|
455 | 455 | ], |
456 | 456 | ], |
457 | 457 | |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | 'message_only' => 0, |
467 | 467 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
468 | 468 | "eduroamCAT", |
469 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
469 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
470 | 470 | 'geteduroam_text' => sprintf(_("Use our app, it will guide you through the setup process:%s" |
471 | 471 | ."(or download it manually %s.)<p>" |
472 | 472 | . "After installation, open the app, select your home institution and the app will collect required information " |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | 'mime' => 'application/eap-config', |
494 | 494 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
495 | 495 | "eduroamCAT", |
496 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
496 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
497 | 497 | ], |
498 | 498 | ], |
499 | 499 | 'android_pie' => [ |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | 'mime' => 'application/eap-config', |
508 | 508 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
509 | 509 | "eduroamCAT", |
510 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
510 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
511 | 511 | ], |
512 | 512 | ], |
513 | 513 | 'android_oreo' => [ |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | 'mime' => 'application/eap-config', |
522 | 522 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
523 | 523 | "eduroamCAT", |
524 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
524 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
525 | 525 | ], |
526 | 526 | ], |
527 | 527 | 'android_nougat' => [ |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | 'mime' => 'application/eap-config', |
536 | 536 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
537 | 537 | "eduroamCAT", |
538 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
538 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
539 | 539 | ], |
540 | 540 | ], |
541 | 541 | 'android_marshmallow' => [ |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | 'mime' => 'application/eap-config', |
550 | 550 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
551 | 551 | "eduroamCAT", |
552 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
552 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
553 | 553 | ], |
554 | 554 | ], |
555 | 555 | 'android_lollipop' => [ |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | 'mime' => 'application/eap-config', |
564 | 564 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
565 | 565 | "eduroamCAT", |
566 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
566 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
567 | 567 | ], |
568 | 568 | ], |
569 | 569 | 'android_kitkat' => [ |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | 'mime' => 'application/eap-config', |
578 | 578 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
579 | 579 | "eduroamCAT", |
580 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
580 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
581 | 581 | ], |
582 | 582 | ], |
583 | 583 | 'android_43' => [ |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | 'mime' => 'application/eap-config', |
592 | 592 | 'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."), |
593 | 593 | "eduroamCAT", |
594 | - "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
594 | + "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
595 | 595 | ], |
596 | 596 | ], |
597 | 597 |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | $loggerInstance = new \core\common\Logging(); |
82 | 82 | $olddomain = textdomain(NULL); |
83 | 83 | $loggerInstance->debug(4, "set_locale($domain)\n"); |
84 | - $loggerInstance->debug(4, ROOT . "\n"); |
|
84 | + $loggerInstance->debug(4, ROOT."\n"); |
|
85 | 85 | textdomain($domain); |
86 | - bindtextdomain($domain, ROOT . "/translation/"); |
|
86 | + bindtextdomain($domain, ROOT."/translation/"); |
|
87 | 87 | bind_textdomain_codeset($domain, "UTF-8"); |
88 | 88 | return $olddomain; |
89 | 89 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | // check if this language is supported by the CAT config |
138 | 138 | foreach (\config\Master::LANGUAGES as $language => $value) { |
139 | - if (preg_match("/^" . $language . ".*/", $tryLang)) { |
|
139 | + if (preg_match("/^".$language.".*/", $tryLang)) { |
|
140 | 140 | $localeTmp = $value['locale']; |
141 | 141 | $langIndex = $language; // ??? |
142 | 142 | break; |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | $isRtl = \config\Master::LANGUAGES[$langIndex]['rtl']; |
155 | - putenv("LC_ALL=" . $theLocale); |
|
156 | - putenv("LANGUAGE=" . $theLocale); |
|
155 | + putenv("LC_ALL=".$theLocale); |
|
156 | + putenv("LANGUAGE=".$theLocale); |
|
157 | 157 | $_SESSION['language'] = $langIndex; |
158 | 158 | $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n"); |
159 | 159 | $loggerInstance->debug(4, print_r($langConverted, true)); |
160 | - return([$langIndex, $theLocale,$isRtl]); |
|
160 | + return([$langIndex, $theLocale, $isRtl]); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | #private const EDUPKI_ENDPOINT_PUBLIC = "https://pki.edupki.org/edupki-ca/cgi-bin/pub/soap?wsdl=1"; |
28 | 28 | #private const EDUPKI_ENDPOINT_RA = "https://ra.edupki.org/edupki-ca/cgi-bin/ra/soap?wsdl=1"; |
29 | 29 | |
30 | - private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
31 | - private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
32 | - private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
30 | + private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
31 | + private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
32 | + private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
33 | 33 | private const EDUPKI_RA_ID = 700; |
34 | 34 | private const EDUPKI_CERT_PROFILE_BOTH = "Radius Server SOAP"; |
35 | 35 | private const EDUPKI_CERT_PROFILE_IDP = "Radius Server SOAP"; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | parent::__construct(); |
50 | 50 | |
51 | 51 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) { |
52 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
52 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
53 | 53 | } |
54 | 54 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) { |
55 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
55 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
56 | 56 | } |
57 | 57 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) { |
58 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
58 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -122,22 +122,22 @@ discard block |
||
122 | 122 | throw new Exception("Unexpected policies requested."); |
123 | 123 | } |
124 | 124 | $altArray = [# Array mit den Subject Alternative Names |
125 | - "email:" . $csr["USERMAIL"] |
|
125 | + "email:".$csr["USERMAIL"] |
|
126 | 126 | ]; |
127 | 127 | foreach ($csr["ALTNAMES"] as $oneAltName) { |
128 | - $altArray[] = "DNS:" . $oneAltName; |
|
128 | + $altArray[] = "DNS:".$oneAltName; |
|
129 | 129 | } |
130 | 130 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
131 | 131 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
132 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n"); |
|
133 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR_STRING"] . "\n"); |
|
132 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n"); |
|
133 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR_STRING"]."\n"); |
|
134 | 134 | $this->loggerInstance->debug(5, "PARAM_3: "); |
135 | 135 | $this->loggerInstance->debug(5, $altArray); |
136 | - $this->loggerInstance->debug(5, "PARAM_4: " . $profile . "\n"); |
|
137 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
138 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
139 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n"); |
|
140 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
136 | + $this->loggerInstance->debug(5, "PARAM_4: ".$profile."\n"); |
|
137 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
138 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
139 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n"); |
|
140 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
141 | 141 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
142 | 142 | $soapNewRequest = $soapPub->newRequest( |
143 | 143 | CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | } catch (Exception $e) { |
160 | 160 | // PHP 7.1 can do this much better |
161 | 161 | if (is_soap_fault($e)) { |
162 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
162 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
163 | 163 | $e->faultstring |
164 | 164 | }\n"); |
165 | 165 | } |
166 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
166 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
167 | 167 | } |
168 | 168 | try { |
169 | 169 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
196 | 196 | // rather than just using the string. Grr. |
197 | 197 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
198 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
198 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
199 | 199 | // retrieve our RA cert from filesystem |
200 | 200 | // the RA certificates are not needed right now because we |
201 | 201 | // have resorted to S/MIME signatures with openssl command-line |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
208 | 208 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
209 | 209 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
210 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
210 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
211 | 211 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
212 | 212 | $output = []; |
213 | 213 | $return = 999; |
@@ -216,21 +216,21 @@ discard block |
||
216 | 216 | throw new Exception("Non-zero return value from openssl smime!"); |
217 | 217 | } |
218 | 218 | // and get the signature blob back from the filesystem |
219 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
219 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
220 | 220 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
221 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
222 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
223 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
221 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
222 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
223 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
224 | 224 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
225 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
226 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
225 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
226 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
227 | 227 | if ($soapIssueCert === FALSE) { |
228 | 228 | throw new Exception("The locally approved request was NOT processed by the CA."); |
229 | 229 | } |
230 | 230 | } catch (SoapFault $e) { |
231 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
231 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
232 | 232 | } catch (Exception $e) { |
233 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
233 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
234 | 234 | } |
235 | 235 | return $soapReqnum; |
236 | 236 | } |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | throw new Exception("CAInfo has no root certificate for us!"); |
283 | 283 | } |
284 | 284 | } catch (SoapFault $e) { |
285 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
285 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
286 | 286 | } catch (Exception $e) { |
287 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
287 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
288 | 288 | } |
289 | 289 | return [ |
290 | 290 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -317,12 +317,12 @@ discard block |
||
317 | 317 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
318 | 318 | // rather than just using the string. Grr. |
319 | 319 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
320 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
320 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
321 | 321 | // retrieve our RA cert from filesystem |
322 | 322 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
323 | 323 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
324 | 324 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
325 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
325 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
326 | 326 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
327 | 327 | $output = []; |
328 | 328 | $return = 999; |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | throw new Exception("Non-zero return value from openssl smime!"); |
332 | 332 | } |
333 | 333 | // and get the signature blob back from the filesystem |
334 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
334 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
335 | 335 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
336 | 336 | if ($soapIssueRev === FALSE) { |
337 | 337 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | } catch (Exception $e) { |
340 | 340 | // PHP 7.1 can do this much better |
341 | 341 | if (is_soap_fault($e)) { |
342 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
342 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
343 | 343 | } |
344 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
344 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
345 | 345 | } |
346 | 346 | } |
347 | 347 | |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | */ |
442 | 442 | public function soapToXmlInteger($x) |
443 | 443 | { |
444 | - return '<' . $x[0] . '>' |
|
444 | + return '<'.$x[0].'>' |
|
445 | 445 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
446 | - . '</' . $x[0] . '>'; |
|
446 | + . '</'.$x[0].'>'; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | // dump private key into directory |
463 | 463 | $outstring = ""; |
464 | 464 | openssl_pkey_export($privateKey, $outstring); |
465 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
465 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
466 | 466 | // PHP can only do one DC in the Subject. But we need three. |
467 | - $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"; |
|
467 | + $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"; |
|
468 | 468 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
469 | 469 | $output = []; |
470 | 470 | $return = 999; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $returnArray['otherdata'] = $otherData; |
78 | 78 | } |
79 | 79 | header('Content-Type: application/json'); |
80 | - return(json_encode($returnArray, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE | \JSON_THROW_ON_ERROR) . "\n"); |
|
80 | + return(json_encode($returnArray, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE | \JSON_THROW_ON_ERROR)."\n"); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | $Gui->loggerInstance->debug(4, $operatingSystem); |
48 | 48 | $uiElements = new web\lib\admin\UIElements(); |
49 | 49 | if ($operatingSystem) { |
50 | - print "recognisedOS = '" . $operatingSystem['device'] . "';\n"; |
|
50 | + print "recognisedOS = '".$operatingSystem['device']."';\n"; |
|
51 | 51 | } |
52 | -require dirname(__DIR__) . '/user/js/cat_js.php'; |
|
52 | +require dirname(__DIR__).'/user/js/cat_js.php'; |
|
53 | 53 | ?> |
54 | 54 | var lang = "<?php echo($Gui->languageInstance->getLang()) ?>"; |
55 | 55 | </script> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <?php |
80 | 80 | switch ($statusInfo['errorcode']) { |
81 | 81 | case "GENERATOR_CONSUMED": |
82 | - 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 reuse download link"), TRUE) . "<p>"; |
|
82 | + 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 reuse download link"), TRUE)."<p>"; |
|
83 | 83 | break; |
84 | 84 | case NULL: |
85 | 85 | default: |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | echo " "; |
103 | 103 | 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); |
104 | 104 | } |
105 | - echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>"; |
|
105 | + echo " <span id='detailtext'>"._("I want to see the details.")."</span>"; |
|
106 | 106 | echo "<table id='cert_details'></table>"; |
107 | 107 | } |
108 | 108 | } |
@@ -111,60 +111,60 @@ discard block |
||
111 | 111 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal |
112 | 112 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED: |
113 | 113 | if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case. |
114 | - 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>"; |
|
114 | + 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>"; |
|
115 | 115 | } |
116 | 116 | if (!$statusInfo["OS"]) { |
117 | - 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>"; |
|
117 | + 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>"; |
|
118 | 118 | break; |
119 | 119 | } |
120 | 120 | |
121 | 121 | $dev = new \core\DeviceFactory($statusInfo['OS']['device']); |
122 | 122 | $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]); |
123 | 123 | if ($dev->device->selectedEap == []) { |
124 | - 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>"; |
|
124 | + 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>"; |
|
125 | 125 | break; |
126 | 126 | } |
127 | - $message = $dev->device->options['message'] ?? '' ; |
|
127 | + $message = $dev->device->options['message'] ?? ''; |
|
128 | 128 | |
129 | 129 | $sbMessage = $dev->device->options['sb_message'] ?? ''; |
130 | 130 | if ($message != '' && $sbMessage != '') { |
131 | - $message = $message . "<p>" . $sbMessage; |
|
131 | + $message = $message."<p>".$sbMessage; |
|
132 | 132 | } else { |
133 | - $message = $message . $sbMessage; |
|
133 | + $message = $message.$sbMessage; |
|
134 | 134 | } |
135 | 135 | |
136 | - echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
136 | + echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
137 | 137 | // 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']); |
138 | 138 | 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']); |
139 | - 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>"; |
|
140 | - 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>"; |
|
139 | + 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>"; |
|
140 | + 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>"; |
|
141 | 141 | |
142 | 142 | $importPassword = \core\common\Entity::randomString(4, "0123456789"); |
143 | 143 | $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL); |
144 | 144 | |
145 | - echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>"; |
|
145 | + echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>"; |
|
146 | 146 | $_SESSION['individualtoken'] = $cleanToken; |
147 | 147 | $_SESSION['importpassword'] = $importPassword; |
148 | - echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>"; |
|
148 | + echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>"; |
|
149 | 149 | echo "<input type='hidden' name='generatedfor' value='silverbullet'/>"; |
150 | - 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>"; |
|
150 | + 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>"; |
|
151 | 151 | echo "<div class='device_info' id='info_g_sb'></div>"; |
152 | 152 | break; |
153 | 153 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED: |
154 | 154 | echo "<h2>Invitation link expired</h2>"; |
155 | - 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>"; |
|
155 | + 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>"; |
|
156 | 156 | echo "<p>Below is all the information about your account's other login details, if any.</p>"; |
157 | 157 | // do NOT break, display full account info instead (this was a previously valid token after all) |
158 | 158 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED: |
159 | 159 | // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones. |
160 | 160 | break; |
161 | 161 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID: |
162 | - echo "<h2>" . _("Account information not found") . "</h2>"; |
|
163 | - 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']); |
|
162 | + echo "<h2>"._("Account information not found")."</h2>"; |
|
163 | + 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']); |
|
164 | 164 | } |
165 | 165 | if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) { |
166 | - echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>"; |
|
167 | - echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>"; |
|
166 | + echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>"; |
|
167 | + echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>"; |
|
168 | 168 | } |
169 | 169 | ?> |
170 | 170 | </div> |
@@ -184,18 +184,18 @@ discard block |
||
184 | 184 | $attributes = $statusInfo['attributes']; |
185 | 185 | $supportInfo = ''; |
186 | 186 | if (!empty($attributes['local_url'])) { |
187 | - $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>'; |
|
187 | + $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>'; |
|
188 | 188 | } |
189 | 189 | if (!empty($attributes['local_email'])) { |
190 | - $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>'; |
|
190 | + $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>'; |
|
191 | 191 | } |
192 | 192 | if (!empty($attributes['local_phone'])) { |
193 | - $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>'; |
|
193 | + $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>'; |
|
194 | 194 | } |
195 | 195 | if ($supportInfo != '') { |
196 | - $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>"; |
|
196 | + $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>"; |
|
197 | 197 | } else { |
198 | - $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>"; |
|
198 | + $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>"; |
|
199 | 199 | } |
200 | 200 | ?> |
201 | 201 | <script> |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | var logo = <?php echo $statusInfo['idp_logo']; ?>; |
205 | 205 | var idpId = <?php echo $statusInfo['idp_id']; ?>; |
206 | 206 | <?php |
207 | - if($message != '') { |
|
207 | + if ($message != '') { |
|
208 | 208 | echo "message = \"$message\";\n"; |
209 | 209 | } |
210 | 210 | ?> |