mirror of
https://github.com/tips-of-mine/gestion-certificats2.git
synced 2025-06-28 08:08:43 +02:00
![google-labs-jules[bot]](/assets/img/avatar_default.png)
Les boutons "Download Certificate (.pem)" et "Download Private Key (.key)" pour le certificat racine dans la page Dashboard étaient affichés sur des lignes séparées. Cette modification les place sur la même ligne en les regroupant dans un unique élément <p> et ajoute une petite marge à gauche du second bouton pour une meilleure séparation visuelle. Ceci améliore l'interface utilisateur en rendant la section plus compacte et lisible.
95 lines
6.3 KiB
PHP
95 lines
6.3 KiB
PHP
<?php
|
|
// Variables attendues du contrôleur: $translations, $currentLang, $darkModeClass, $username, $userRole
|
|
require_once APP_ROOT_DIR . '/src/Views/shared/header.php';
|
|
?>
|
|
|
|
<div class="container">
|
|
<h1><?= str_replace('{username}', htmlspecialchars($username), htmlspecialchars($translations['welcome'])) ?></h1>
|
|
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/certificates"><?= htmlspecialchars($translations['certificates']) ?></a></li>
|
|
<li><a href="/perimeters"><?= htmlspecialchars($translations['functional_perimeters']) ?></a></li>
|
|
<?php if ($userRole === 'admin'): ?>
|
|
<li><a href="/users"><?= htmlspecialchars($translations['users']) ?></a></li>
|
|
<?php endif; ?>
|
|
<li><a href="/logout" class="button logout-button"><?= htmlspecialchars($translations['logout']) ?></a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<section class="quick-actions">
|
|
<h2><?= htmlspecialchars($translations['quick_actions']) ?></h2>
|
|
<ul>
|
|
<li><a href="/certificates/create" class="button create-button"><?= htmlspecialchars($translations['create_new_certificate']) ?></a></li>
|
|
<li><a href="/perimeters/create" class="button create-button"><?= htmlspecialchars($translations['create_new_perimeter']) ?></a></li>
|
|
<?php if ($userRole === 'admin'): ?>
|
|
<li><a href="/users/create" class="button create-button"><?= htmlspecialchars($translations['new_user']) ?></a></li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</section>
|
|
|
|
<section class="certificates-overview">
|
|
<h2><?= htmlspecialchars($translations['certificates_overview_title'] ?? 'Certificates Overview') ?></h2>
|
|
|
|
<!-- Root Certificate -->
|
|
<h3><?= htmlspecialchars($translations['root_certificate_title'] ?? 'Root Certificate') ?></h3>
|
|
<?php if (isset($structuredCertificates['root']) && $structuredCertificates['root']): ?>
|
|
<div>
|
|
<p><strong><?= htmlspecialchars($translations['name'] ?? 'Name:') ?></strong> <?= htmlspecialchars($structuredCertificates['root']['name']) ?></p>
|
|
<p>
|
|
<a href="/certificates/download?type=root&file=ca.cert.pem" class="button">
|
|
<?= htmlspecialchars($translations['download_certificate_pem'] ?? 'Download Certificate (.pem)') ?>
|
|
</a>
|
|
<a href="/certificates/download?type=root&file=ca.key.pem" class="button" style="margin-left: 10px;">
|
|
<?= htmlspecialchars($translations['download_key_pem'] ?? 'Download Private Key (.key)') ?>
|
|
</a>
|
|
</p>
|
|
</div>
|
|
<?php else: ?>
|
|
<p><?= htmlspecialchars($translations['root_certificate_not_configured'] ?? 'Root certificate is not configured.') ?></p>
|
|
<?php endif; ?>
|
|
|
|
<!-- Intermediate Certificates -->
|
|
<h3><?= htmlspecialchars($translations['intermediate_certificates_title'] ?? 'Intermediate Certificates') ?></h3>
|
|
<?php if (isset($structuredCertificates['intermediates']) && !empty($structuredCertificates['intermediates'])): ?>
|
|
<?php foreach ($structuredCertificates['intermediates'] as $intermediate): ?>
|
|
<div class="intermediate-certificate">
|
|
<h4><?= htmlspecialchars($intermediate['name']) ?> (<?= htmlspecialchars($translations['perimeter'] ?? 'Perimeter:') ?> <?= htmlspecialchars($intermediate['perimeter_name']) ?>)</h4>
|
|
<p>
|
|
<a href="/certificates/download?type=intermediate&perimeter=<?= urlencode($intermediate['perimeter_name']) ?>&file=intermediate.cert.pem" class="button">
|
|
<?= htmlspecialchars($translations['download_certificate_pem'] ?? 'Download Certificate (.pem)') ?>
|
|
</a>
|
|
</p>
|
|
|
|
<h5><?= htmlspecialchars($translations['associated_final_certificates_title'] ?? 'Associated Final Certificates') ?></h5>
|
|
<?php if (isset($intermediate['final_certificates']) && !empty($intermediate['final_certificates'])): ?>
|
|
<ul>
|
|
<?php foreach ($intermediate['final_certificates'] as $finalCert): ?>
|
|
<li>
|
|
<?= htmlspecialchars($finalCert['name']) ?>
|
|
(<?= htmlspecialchars($translations['type'] ?? 'Type:') ?> <?= htmlspecialchars($finalCert['type']) ?>,
|
|
<?= htmlspecialchars($translations['expires'] ?? 'Expires:') ?> <?= htmlspecialchars($finalCert['expiration_date']) ?>,
|
|
<?= htmlspecialchars($translations['revoked'] ?? 'Revoked:') ?> <?= $finalCert['is_revoked'] ? htmlspecialchars($translations['yes'] ?? 'Yes') : htmlspecialchars($translations['no'] ?? 'No') ?>)
|
|
<p>
|
|
<a href="/certificates/download?type=simple&perimeter=<?= urlencode($intermediate['perimeter_name']) ?>&file=<?= urlencode($finalCert['name']) ?>" class="button download-button-small">
|
|
<?= htmlspecialchars($translations['download_certificate_pem'] ?? 'Download Certificate (.pem)') ?>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php else: ?>
|
|
<p><?= htmlspecialchars($translations['no_associated_final_certificates'] ?? 'No final certificates associated with this intermediate.') ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php else: ?>
|
|
<p><?= htmlspecialchars($translations['no_intermediate_certificates_found'] ?? 'No intermediate certificates found.') ?></p>
|
|
<?php endif; ?>
|
|
</section>
|
|
</div>
|
|
|
|
<?php
|
|
require_once APP_ROOT_DIR . '/src/Views/shared/footer.php';
|
|
?>
|