Skip to content

Commit

Permalink
added information on server names for which certificate will be issued
Browse files Browse the repository at this point in the history
  • Loading branch information
majagw committed Apr 5, 2024
1 parent 89c4c64 commit 839ed3f
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions web/admin/action_req_certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* This page edits a federation.
*
* @author Stefan Winter <[email protected]>
* @author Maja Górecka-Wolniewicz <[email protected]>
*/
?>
<?php
Expand Down Expand Up @@ -62,7 +63,6 @@
$user = new \core\User($_SESSION['user']);
$mgmt = new \core\UserManagement();
$isFedAdmin = $user->isFederationAdmin();

// if not, send the user away
if (!$isFedAdmin) {
echo _("You do not have the necessary privileges to request server certificates.");
Expand Down Expand Up @@ -212,16 +212,40 @@
}
?>
</select>

<?php
}
?>
<script>
var instservers = [];
var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>';
<?php
$allIdPs = [];
foreach ($allAuthorizedFeds as $oneFed) {
foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) {
$allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["names"][$langObject->getLang()];
echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n";
}
}
if (count($allIdPs) > 0) {
?>
$(document).on('change', '#INST-list' , function() {
//alert(instservers[$(this).val()]);
$("#INST").prop('checked', true);
$("#certlevel").html("<?php echo _('organizational level'); ?>");
$("#serversinfo").html(instservers[$(this).val()]);
//$("input[name=LEVEL][value=INST]").prop('checked', true);

});
$(document).on('change', '#NRO' , function() {
$("#INST-list").val("notset");
$("#certlevel").html("<?php echo _('NRO level'); ?>");
$("#serversinfo").html(nroservers);
});
</script>
<?php if (count($allIdPs) > 0) {
?>


<br/>
<input type="radio" name="LEVEL" id="INST" value="INST"><?php printf(_("Certificate for %s "), $uiElements->nomenclatureParticipant); ?></input>
<select name="INST-list" id="INST-list">
Expand All @@ -232,6 +256,16 @@
}
?>
</select>
</br>
<h3>
<?php
echo _('According to the above settings you will receive')
?>
<span id='certlevel'><?php echo _('NRO level certificate');?></span>

</span>for server names:
<span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span>
</h3>
<?php
} else {
echo "<div>";
Expand Down

0 comments on commit 839ed3f

Please sign in to comment.