mirror of
https://github.com/tips-of-mine/gestion-certificats2.git
synced 2025-06-28 12:48:42 +02:00
Merge pull request #15 from tips-of-mine/fix/certificate-download-links
Correcting download links for certificates and keys
This commit is contained in:
@ -48,6 +48,23 @@ require_once APP_ROOT_DIR . '/src/Views/shared/header.php';
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<?php
|
||||||
|
// Lien de téléchargement du certificat (.pem)
|
||||||
|
$downloadCertUrl = '';
|
||||||
|
if ($cert['type'] === 'root') {
|
||||||
|
$downloadCertUrl = "/certificates/download?type=root&file=" . htmlspecialchars($cert['name']);
|
||||||
|
} else {
|
||||||
|
$downloadCertUrl = "/certificates/download?type=" . htmlspecialchars($cert['type']) . "&file=" . htmlspecialchars($cert['name']) . "&perimeter=" . htmlspecialchars($perimeterName);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<a href="<?= $downloadCertUrl ?>" class="button-link"><?= htmlspecialchars($translations['download_certificate'] ?? 'Télécharger Certificat') ?></a>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Lien de téléchargement de la clé privée (.key.pem) pour les certificats ROOT (si admin)
|
||||||
|
if ($cert['type'] === 'root' && isset($userRole) && $userRole === 'admin' && $cert['name'] === 'ca.cert.pem'): ?>
|
||||||
|
<a href="/certificates/download?type=root&file=ca.key.pem" class="button-link"><?= htmlspecialchars($translations['download_private_key'] ?? 'Télécharger Clé Privée') ?></a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Les certificats 'simple' ou 'intermediate' non révoqués peuvent être révoqués
|
// Les certificats 'simple' ou 'intermediate' non révoqués peuvent être révoqués
|
||||||
if (!$cert['is_revoked'] && ($cert['type'] === 'simple' || $cert['type'] === 'intermediate')): ?>
|
if (!$cert['is_revoked'] && ($cert['type'] === 'simple' || $cert['type'] === 'intermediate')): ?>
|
||||||
|
Reference in New Issue
Block a user