newdesigngestionnaire/Vue/Paramreinitmotpass/majcomplexitepassword.php
2026-03-06 14:09:56 +00:00

56 lines
2.8 KiB
PHP
Executable File

<?php
function getSecurityIcon($libelle) {
$l = strtolower($libelle);
// Majuscules : Icône "A" classique
if (strpos($l, 'majuscule') !== false) return 'fa-font';
// Minuscules : Icône "a" (bascule sur une version plus petite ou spécifique)
if (strpos($l, 'minuscule') !== false) return 'fa-font';
// Chiffres
if (strpos($l, 'chiffre') !== false || strpos($l, 'numérique') !== false) return 'fa-hashtag';
// Caractères spéciaux
if (strpos($l, 'spécial') !== false || strpos($l, 'caractère') !== false) return 'fa-at';
// Longueur
if (strpos($l, 'longueur') !== false || strpos($l, 'caractères') !== false) return 'fa-ruler-horizontal';
return 'fa-shield-alt';
}
?>
<div id="div_complexite_pass" class="row g-3">
<div class="col-md-6" id="div_expression_non_actif">
<div class="border rounded bg-white p-3 h-100 shadow-xs">
<p class="small fw-bold text-muted text-center border-bottom pb-2 mb-3"><?= _("Expressions Non Actives") ?></p>
<div class="list-group list-group-flush scroll-custom" style="max-height: 400px; overflow-y: auto;">
<?php foreach ($expressionsinactives as $exp): $icon = getSecurityIcon($exp['libelle']); ?>
<div class="list-group-item d-flex justify-content-between align-items-center border-0 px-0 py-2">
<div class="d-flex align-items-center">
<i class="fas <?= $icon ?> text-muted me-2" style="width: 20px; text-align: center; opacity: 0.5;"></i>
<span class="small text-dark"><?= $this->nettoyer($exp['libelle']) ?></span>
</div>
<button class="btn btn-outline-primary btn-xs rounded-circle" onClick="ajouter_une_expression_complexite_pass('<?= $exp['code'] ?>', '1');">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<div class="col-md-6" id="div_expression_actif">
<div class="border rounded bg-white p-3 h-100 border-warning shadow-xs">
<p class="small fw-bold text-warning text-center border-bottom pb-2 mb-3"><?= _("Expressions Actives") ?></p>
<div class="list-group list-group-flush">
<?php foreach ($expressionsactives as $exp): $icon = getSecurityIcon($exp['libelle']); ?>
<div class="list-group-item d-flex justify-content-between align-items-center border-0 px-0 py-2">
<button class="btn btn-outline-danger btn-xs rounded-circle" onClick="ajouter_une_expression_complexite_pass('<?= $exp['code'] ?>', '0');">
<i class="fas fa-chevron-left"></i>
</button>
<div class="d-flex align-items-center">
<span class="small fw-bold text-dark me-2"><?= $this->nettoyer($exp['libelle']) ?></span>
<i class="fas <?= $icon ?> text-warning" style="width: 20px; text-align: center;"></i>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>