77 lines
4.2 KiB
PHP
Executable File
77 lines
4.2 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 class="row g-3">
|
|
<div id="div_expression_non_actif" class="col-md-6">
|
|
<div class="card border-0 shadow-xs h-100" style="border-radius: var(--radius-md); background: #fdfdfd;">
|
|
<div class="card-header bg-white border-0 py-3 text-center">
|
|
<h6 class="mb-0 fw-bold text-muted text-uppercase small">
|
|
<i class="fas fa-list-check me-2"></i><?= _("Expressions Non Actives") ?>
|
|
</h6>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="list-group list-group-flush border-top" style="max-height: 400px; overflow-y: auto;">
|
|
<?php foreach ($expressionsinactives as $exp):
|
|
$idExpression = $exp['code'];
|
|
$icon = getSecurityIcon($exp['libelle']);
|
|
?>
|
|
<div class="list-group-item d-flex justify-content-between align-items-center py-3 border-light">
|
|
<div class="d-flex align-items-center ps-2">
|
|
<i class="fas <?= $icon ?> text-muted me-3" style="width: 20px; text-align: center;"></i>
|
|
<span class="text-dark fw-medium" style="font-size: 9.5pt;"><?= $this->nettoyer($exp['libelle']) ?></span>
|
|
</div>
|
|
<button type="button" class="btn btn-primary btn-xs rounded-circle shadow-sm"
|
|
onClick="javascript:ajouter_une_expression_complexite_pass('<?=$idExpression?>', '1');">
|
|
<i class="fas fa-arrow-right"></i>
|
|
</button>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="div_expression_actif" class="col-md-6">
|
|
<div class="card border-0 shadow-sm h-100 border-start border-warning border-4" style="border-radius: var(--radius-md);">
|
|
<div class="card-header bg-white border-0 py-3 text-center">
|
|
<h6 class="mb-0 fw-bold text-warning text-uppercase small">
|
|
<i class="fas fa-lock-keyhole me-2"></i><?= _("Expressions Actives") ?>
|
|
</h6>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="list-group list-group-flush border-top">
|
|
<?php foreach ($expressionsactives as $exp):
|
|
$idExpression = $exp['code'];
|
|
$icon = getSecurityIcon($exp['libelle']);
|
|
?>
|
|
<div class="list-group-item d-flex justify-content-between align-items-center py-3 border-light bg-warning-ghost">
|
|
<button type="button" class="btn btn-outline-danger btn-xs rounded-circle shadow-sm"
|
|
onClick="javascript:ajouter_une_expression_complexite_pass('<?=$idExpression?>', '0');">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</button>
|
|
<div class="d-flex align-items-center pe-2">
|
|
<span class="text-dark fw-bold me-3" style="font-size: 9.5pt;"><?= $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>
|
|
</div>
|