|
@@ -149,7 +149,7 @@ discard block |
|
|
block discarded – undo |
|
149
|
149
|
'display' => sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP), |
|
150
|
150
|
'help' => _("Set of default CAs to add to new IdPs on signup")], |
|
151
|
151
|
"fed:openroaming" => [ |
|
152
|
|
- 'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant), |
|
|
152
|
+ 'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant), |
|
153
|
153
|
'help' => _("Allow IdP to set OpenRoaming support for its users.")], |
|
154
|
154
|
"fed:openroaming_customtarget" => ['display' => _("OpenRoaming: Custom NAPTR Target"), 'help' => "If you want your IdPs to use your own OpenRoaming → eduroam proxy then you can configure the hostname here; the realm check feature for IdPs will then warn them if the OpenRoaming destination server is not yours. This attribute does not need to be set, and the realm checks default to checking for the OpenRoaming → eduroam proxy operated by eduroam OT."], |
|
155
|
155
|
"fed:autoregister-synced" => [ |
|
@@ -209,7 +209,7 @@ discard block |
|
|
block discarded – undo |
|
209
|
209
|
|
|
210
|
210
|
foreach ($optionlist as $option) { |
|
211
|
211
|
$type = $optioninfo->optionType($option['name']); |
|
212
|
|
- if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") { |
|
|
212
|
+ if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") { |
|
213
|
213
|
// all non-multilang attribs get this assignment ... |
|
214
|
214
|
$language = ""; |
|
215
|
215
|
$content = $option['value']; |
|
@@ -227,19 +227,19 @@ discard block |
|
|
block discarded – undo |
|
227
|
227
|
$locationMarkers[] = $coords; |
|
228
|
228
|
break; |
|
229
|
229
|
case "file": |
|
230
|
|
- $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>"; |
|
|
230
|
+ $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>"; |
|
231
|
231
|
switch ($option['name']) { |
|
232
|
232
|
case "general:logo_file": |
|
233
|
233
|
case "fed:logo_file": |
|
234
|
|
- $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
|
234
|
+ $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
235
|
235
|
break; |
|
236
|
236
|
case "eap:ca_file": |
|
237
|
237
|
// fall-through intended: display both the same way |
|
238
|
238
|
case "fed:minted_ca_file": |
|
239
|
|
- $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
|
239
|
+ $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
240
|
240
|
break; |
|
241
|
241
|
case "support:info_file": |
|
242
|
|
- $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']); |
|
|
242
|
+ $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']); |
|
243
|
243
|
break; |
|
244
|
244
|
default: |
|
245
|
245
|
} |
|
@@ -249,10 +249,10 @@ discard block |
|
|
block discarded – undo |
|
249
|
249
|
// do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen |
|
250
|
250
|
break; |
|
251
|
251
|
} |
|
252
|
|
- $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
|
252
|
+ $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>"; |
|
253
|
253
|
break; |
|
254
|
254
|
default: |
|
255
|
|
- $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
|
255
|
+ $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
256
|
256
|
} |
|
257
|
257
|
} |
|
258
|
258
|
} |
|
@@ -261,11 +261,11 @@ discard block |
|
|
block discarded – undo |
|
261
|
261
|
$locationCount = 0; |
|
262
|
262
|
foreach ($locationMarkers as $g) { |
|
263
|
263
|
$locationCount++; |
|
264
|
|
- $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />'; |
|
|
264
|
+ $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />'; |
|
265
|
265
|
} |
|
266
|
266
|
$marker .= '<\/markers>'; // some validator says this should be escaped |
|
267
|
267
|
$jMarker = json_encode($locationMarkers); |
|
268
|
|
- $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>'; |
|
|
268
|
+ $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>'; |
|
269
|
269
|
} |
|
270
|
270
|
\core\common\Entity::outOfThePotatoes(); |
|
271
|
271
|
return $retval; |
|
@@ -281,11 +281,11 @@ discard block |
|
|
block discarded – undo |
|
281
|
281
|
\core\common\Entity::intoThePotatoes(); |
|
282
|
282
|
$idpoptions = $myInst->getAttributes(); |
|
283
|
283
|
$retval = "<div class='infobox'> |
|
284
|
|
- <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2> |
|
|
284
|
+ <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2> |
|
285
|
285
|
<table> |
|
286
|
286
|
<tr> |
|
287
|
287
|
<td> |
|
288
|
|
- " . _("Country:") . " |
|
|
288
|
+ " . _("Country:")." |
|
289
|
289
|
</td> |
|
290
|
290
|
<td> |
|
291
|
291
|
</td> |
|
@@ -295,7 +295,7 @@ discard block |
|
|
block discarded – undo |
|
295
|
295
|
$retval .= $myFed->name; |
|
296
|
296
|
$retval .= "</strong> |
|
297
|
297
|
</td> |
|
298
|
|
- </tr>" . $this->infoblock($idpoptions, "general", "IdP") . " |
|
|
298
|
+ </tr>" . $this->infoblock($idpoptions, "general", "IdP")." |
|
299
|
299
|
</table> |
|
300
|
300
|
</div>"; |
|
301
|
301
|
$blocks = [["support", _("Global Helpdesk Details")]]; |
|
@@ -304,9 +304,9 @@ discard block |
|
|
block discarded – undo |
|
304
|
304
|
} |
|
305
|
305
|
foreach ($blocks as $block) { |
|
306
|
306
|
$retval .= "<div class='infobox'> |
|
307
|
|
- <h2>" . $block[1] . "</h2> |
|
|
307
|
+ <h2>" . $block[1]."</h2> |
|
308
|
308
|
<table>" . |
|
309
|
|
- $this->infoblock($idpoptions, $block[0], "IdP") . |
|
|
309
|
+ $this->infoblock($idpoptions, $block[0], "IdP"). |
|
310
|
310
|
"</table> |
|
311
|
311
|
</div>"; |
|
312
|
312
|
} |
|
@@ -321,12 +321,12 @@ discard block |
|
|
block discarded – undo |
|
321
|
321
|
*/ |
|
322
|
322
|
private function displaySize(int $number) { |
|
323
|
323
|
if ($number > 1024 * 1024) { |
|
324
|
|
- return round($number / 1024 / 1024, 2) . " MiB"; |
|
|
324
|
+ return round($number / 1024 / 1024, 2)." MiB"; |
|
325
|
325
|
} |
|
326
|
326
|
if ($number > 1024) { |
|
327
|
|
- return round($number / 1024, 2) . " KiB"; |
|
|
327
|
+ return round($number / 1024, 2)." KiB"; |
|
328
|
328
|
} |
|
329
|
|
- return $number . " B"; |
|
|
329
|
+ return $number." B"; |
|
330
|
330
|
} |
|
331
|
331
|
|
|
332
|
332
|
/** |
|
@@ -381,7 +381,7 @@ discard block |
|
|
block discarded – undo |
|
381
|
381
|
$caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning']; |
|
382
|
382
|
$rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
|
383
|
383
|
if (is_bool($rawResult)) { // we didn't actually get a CA! |
|
384
|
|
- $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>"; |
|
|
384
|
+ $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>"; |
|
385
|
385
|
\core\common\Entity::outOfThePotatoes(); |
|
386
|
386
|
return $retval; |
|
387
|
387
|
} |
|
@@ -397,8 +397,8 @@ discard block |
|
|
block discarded – undo |
|
397
|
397
|
|
|
398
|
398
|
$details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
|
399
|
399
|
$details['name'] = preg_replace('/\//', "", $details['name']); |
|
400
|
|
- $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
401
|
|
- $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
|
400
|
+ $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
|
401
|
+ $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA")); |
|
402
|
402
|
$innerbgColor = "#0000ff"; |
|
403
|
403
|
$leftBorderColor = "#00ff00"; |
|
404
|
404
|
$message = ""; |
|
@@ -406,35 +406,35 @@ discard block |
|
|
block discarded – undo |
|
406
|
406
|
$leftBorderColor = "red"; |
|
407
|
407
|
$message = _("This is a <strong>SERVER</strong> certificate!"); |
|
408
|
408
|
if (\config\ConfAssistant::CERT_GUIDELINES !== '') { |
|
409
|
|
- $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>"; |
|
|
409
|
+ $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>"; |
|
410
|
410
|
} |
|
411
|
411
|
$message .= "<br/>"; |
|
412
|
|
- $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . $message . $details['name'] . "</div>"; |
|
|
412
|
+ $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>".$message.$details['name']."</div>"; |
|
413
|
413
|
\core\common\Entity::outOfThePotatoes(); |
|
414
|
414
|
return $retval; |
|
415
|
415
|
} |
|
416
|
416
|
$now = time(); |
|
417
|
417
|
if ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_critical'] > $details['full_details']['validTo_time_t']) { |
|
418
|
418
|
$leftBorderColor = "red"; |
|
419
|
|
- $message = _("Certificate expired!") . "<br>"; |
|
420
|
|
- } elseif($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) { |
|
|
419
|
+ $message = _("Certificate expired!")."<br>"; |
|
|
420
|
+ } elseif ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) { |
|
421
|
421
|
if ($leftBorderColor == "#00ff00") { |
|
422
|
422
|
$leftBorderColor = "yellow"; |
|
423
|
423
|
} |
|
424
|
|
- $message = _("Certificate close to expiry!") . "<br/>"; |
|
|
424
|
+ $message = _("Certificate close to expiry!")."<br/>"; |
|
425
|
425
|
} |
|
426
|
426
|
|
|
427
|
427
|
if ($details['root'] == 1 && $details['basicconstraints_set'] == 0) { |
|
428
|
428
|
if ($leftBorderColor == "#00ff00") { |
|
429
|
429
|
$leftBorderColor = "yellow"; |
|
430
|
430
|
} |
|
431
|
|
- $message .= "<div style='max-width: 25em'><strong>" . _("Improper root certificate, required critical CA extension missing, will not reliably install!") . "</strong>"; |
|
|
431
|
+ $message .= "<div style='max-width: 25em'><strong>"._("Improper root certificate, required critical CA extension missing, will not reliably install!")."</strong>"; |
|
432
|
432
|
if (\config\ConfAssistant::CERT_GUIDELINES !== '') { |
|
433
|
|
- $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>"; |
|
|
433
|
+ $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>"; |
|
434
|
434
|
} |
|
435
|
435
|
$message .= "</div><br/>"; |
|
436
|
436
|
} |
|
437
|
|
- $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $message . $details['name'] . "<br>" . $this->displayName('eap:ca_vailduntil') . " " . gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t']) . " UTC</div>"; |
|
|
437
|
+ $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$message.$details['name']."<br>".$this->displayName('eap:ca_vailduntil')." ".gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t'])." UTC</div>"; |
|
438
|
438
|
\core\common\Entity::outOfThePotatoes(); |
|
439
|
439
|
return $retval; |
|
440
|
440
|
} |
|
@@ -447,7 +447,7 @@ discard block |
|
|
block discarded – undo |
|
447
|
447
|
*/ |
|
448
|
448
|
public function previewImageinHTML($imageReference) { |
|
449
|
449
|
\core\common\Entity::intoThePotatoes(); |
|
450
|
|
- $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>"; |
|
|
450
|
+ $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>"; |
|
451
|
451
|
\core\common\Entity::outOfThePotatoes(); |
|
452
|
452
|
return $retval; |
|
453
|
453
|
} |
|
@@ -464,13 +464,13 @@ discard block |
|
|
block discarded – undo |
|
464
|
464
|
$ref = $validator->databaseReference($fileReference); |
|
465
|
465
|
$fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE); |
|
466
|
466
|
if (is_bool($fileBlob)) { // we didn't actually get a file! |
|
467
|
|
- $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>"; |
|
|
467
|
+ $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>"; |
|
468
|
468
|
\core\common\Entity::outOfThePotatoes(); |
|
469
|
469
|
return $retval; |
|
470
|
470
|
} |
|
471
|
471
|
$decodedFileBlob = base64_decode($fileBlob); |
|
472
|
472
|
$fileinfo = new \finfo(); |
|
473
|
|
- $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>"; |
|
|
473
|
+ $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>"; |
|
474
|
474
|
\core\common\Entity::outOfThePotatoes(); |
|
475
|
475
|
return $retval; |
|
476
|
476
|
} |
|
@@ -627,8 +627,8 @@ discard block |
|
|
block discarded – undo |
|
627
|
627
|
return ""; |
|
628
|
628
|
} |
|
629
|
629
|
|
|
630
|
|
- $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
631
|
|
- $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
|
630
|
+ $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png"); |
|
|
631
|
+ $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png"); |
|
632
|
632
|
if ($logogd === FALSE) { // consortium logo is bogus; don't do anything |
|
633
|
633
|
return ""; |
|
634
|
634
|
} |
|
@@ -654,7 +654,7 @@ discard block |
|
|
block discarded – undo |
|
654
|
654
|
imagecolorallocate($whiteimage, 255, 255, 255); |
|
655
|
655
|
// also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected |
|
656
|
656
|
$targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize)); |
|
657
|
|
- $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize)); |
|
|
657
|
+ $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize)); |
|
658
|
658
|
imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
|
659
|
659
|
imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]); |
|
660
|
660
|
ob_start(); |
|
@@ -704,9 +704,9 @@ discard block |
|
|
block discarded – undo |
|
704
|
704
|
$message = "Your configuration appears to be fine."; |
|
705
|
705
|
break; |
|
706
|
706
|
default: |
|
707
|
|
- throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!"); |
|
|
707
|
+ throw new Exception("The result code level ".$test->test_result['global']." is not defined!"); |
|
708
|
708
|
} |
|
709
|
|
- $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>"); |
|
|
709
|
+ $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>"); |
|
710
|
710
|
foreach ($test->out as $testValue) { |
|
711
|
711
|
foreach ($testValue as $o) { |
|
712
|
712
|
$out .= $this->boxFlexible($o['level'], $o['message']); |