df
This commit is contained in:
parent
c06658e027
commit
0430fa69e5
|
|
@ -1,117 +1,271 @@
|
|||
<?php $this->titre = "INTER SANTE - "._("Paramètres changement de mot de passe")
|
||||
|
||||
//var_dump($societeuser['activerOtp']);
|
||||
|
||||
<?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="page-content">
|
||||
<div class="header-section mb-4">
|
||||
<div class="d-flex align-items-center bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
|
||||
<div class="icon-shape bg-primary-ghost text-primary rounded-circle me-3" style="width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="fas fa-user-shield fs-4"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= _("Sécurité & Authentification") ?></h4>
|
||||
<p class="text-muted small mb-0"><?= _("Paramétez les accès des utilisateurs aux divers portails") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="form-horizontal" action="Paramreinitmotpass/changerpass" method="post" style='font-size:10pt;'>
|
||||
<fieldset>
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-5">
|
||||
<div class="card border-0 shadow-sm mb-4" style="border-radius: var(--radius-md);">
|
||||
<div class="card-header bg-white border-0 py-3">
|
||||
<h6 class="mb-0 fw-bold text-primary">
|
||||
<i class="fas fa-key me-2"></i><?= _("Réinitialisation du mot de passe") ?>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="formChangerPass" action="Paramreinitmotpass/changerpass" method="post">
|
||||
<input type="hidden" id="nomForm" name="nomForm" value="modifierseuilalerte">
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-bold required"><?= _("Ancien mot de passe") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control border-2" id="ancmdp" name="ancmdp" required autofocus>
|
||||
<button class="btn btn-outline-secondary border-2 border-start-0 toggle-password" type="button" data-target="#ancmdp">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<legend> <?= _("Mot de passe à utiliser en cas de réinitialisation") ?> </legend>
|
||||
|
||||
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="45%" class="required"><?= _("Veuillez saisir ancien mot de passe") ?> </td>
|
||||
<td align="center" width="5%">:</td>
|
||||
<td><INPUT style='font-size:10pt;' class="form-control" TYPE="password" id="ancmdp" NAME="ancmdp" required AUTOCOMPLETE="OFF" autofocus></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="required"> <?= _("Veuillez saisir nouveau mot de passe") ?> </td>
|
||||
<td align="center">:</td>
|
||||
<td><INPUT style='font-size:10pt;' onBlur="controle_longeur_passe(this);" class="form-control" TYPE="password" id="nvmdp" NAME="nvmdp" required AUTOCOMPLETE="OFF"></td>
|
||||
</tr>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-bold required"><?= _("Nouveau mot de passe") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control border-2" id="nvmdp" name="nvmdp" required>
|
||||
<button class="btn btn-outline-secondary border-2 border-start-0 toggle-password" type="button" data-target="#nvmdp">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td class="required"> <?= _("Veuillez confirmer nouveau mot de passe") ?> </td>
|
||||
<td align="center">:</td>
|
||||
<td><INPUT style='font-size:10pt;' onBlur="ChangerPass();" class="form-control" TYPE="password" id="cfnvmdp" NAME="cfnvmdp" required AUTOCOMPLETE="OFF"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input style='font-size:10pt;' class = "form-control btn btn-primary" type="submit" value="<?= _("Enregistrer") ?>" /></td>
|
||||
<td></td>
|
||||
<td><a style='font-size:10pt;' class="form-control btn btn-warning" href="Parametresgeneraux/"> <?=_("Annuler") ?> </a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="mb-4">
|
||||
<label class="form-label small fw-bold required"><?= _("Confirmer nouveau mot de passe") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control border-2" id="cfnvmdp" name="cfnvmdp" required>
|
||||
<button class="btn btn-outline-secondary border-2 border-start-0 toggle-password" type="button" data-target="#cfnvmdp">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($msgErreur)): ?>
|
||||
<div class="alert alert-danger" style="height:30px; padding:5px;" >
|
||||
<H4><?= $msgErreur ?></H4>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($msgErreur)): ?>
|
||||
<div class="alert alert-danger py-2 border-0 shadow-xs mb-3">
|
||||
<i class="fas fa-exclamation-circle me-2"></i> <?= $msgErreur ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-6">
|
||||
<button type="submit" id="btnSubmitPass" class="btn btn-primary w-100 fw-bold shadow-sm py-2" disabled>
|
||||
<i class="fas fa-save me-2"></i><?= _("Enregistrer") ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a class="btn btn-light border w-100 fw-bold py-2" href="Paramreinitmotpass/">
|
||||
<?= _("Annuler") ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<legend> <?= _("Complexité des mots de passe") ?> </legend>
|
||||
<div class="card border-0 shadow-sm border-start border-info border-4" style="border-radius: var(--radius-md);">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>
|
||||
<h6 class="mb-1 fw-bold"><?= _("Double Authentification") ?></h6>
|
||||
<p class="text-muted small mb-0"><?= _("Sécurité renforcée par OTP") ?></p>
|
||||
</div>
|
||||
<select class="form-select w-auto fw-bold" id="activerOtp" name="activerOtp" onChange="maj_authentification_otp();">
|
||||
<?php liste_options($activerOtpouinon, $this->nettoyer($societeuser['activerOtp']), true); ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_complexite_pass">
|
||||
<div class="col-lg-7">
|
||||
<div class="card border-0 shadow-sm h-100" style="border-radius: var(--radius-md);">
|
||||
<div class="card-header bg-white border-0 py-3">
|
||||
<h6 class="mb-0 fw-bold text-dark">
|
||||
<i class="fas fa-shield-alt me-2 text-warning"></i><?= _("Complexité des mots de passe") ?>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card-body bg-light-subtle">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="div_expression_non_actif" class="col-6" >
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
if (typeof jQuery === 'undefined') return;
|
||||
|
||||
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='text-align:center'> <?= _("Expressions Non Actives") ?> </th>
|
||||
<th style='text-align:center'> => </th>
|
||||
</tr>
|
||||
</thead>
|
||||
// 1. GESTION AFFICHAGE MOT DE PASSE
|
||||
$('.toggle-password').off('click').on('click', function() {
|
||||
const target = $(this).attr('data-target');
|
||||
const $input = $(target);
|
||||
const $icon = $(this).find('i');
|
||||
if ($input.attr('type') === 'password') {
|
||||
$input.attr('type', 'text');
|
||||
$icon.removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
} else {
|
||||
$input.attr('type', 'password');
|
||||
$icon.removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
}
|
||||
});
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($expressionsinactives as $expressionsinactive):
|
||||
$idExpression = $expressionsinactive['code'];
|
||||
?>
|
||||
<tr valign="top">
|
||||
<td align='center'><?= $this->nettoyer($expressionsinactive['libelle']) ?></td>
|
||||
<td align='center'> <input type="button" value="=>" onClick="javascript:ajouter_une_expression_complexite_pass('<?=$idExpression?>', '1');" ></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
// 2. VALIDATION EN TEMPS RÉEL
|
||||
const $nvmdp = $('#nvmdp');
|
||||
const $cfnvmdp = $('#cfnvmdp');
|
||||
const $btn = $('#btnSubmitPass');
|
||||
|
||||
<div id="div_expression_actif" class="col-6" >
|
||||
function checkPass() {
|
||||
const p1 = $nvmdp.val();
|
||||
const p2 = $cfnvmdp.val();
|
||||
if (p2.length > 0) {
|
||||
if (p1 === p2 && p1.length >= 4) { // Longueur mini par défaut
|
||||
$cfnvmdp.addClass('is-valid').removeClass('is-invalid');
|
||||
$btn.prop('disabled', false);
|
||||
} else {
|
||||
$cfnvmdp.addClass('is-invalid').removeClass('is-valid');
|
||||
$btn.prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
$cfnvmdp.removeClass('is-valid is-invalid');
|
||||
$btn.prop('disabled', true);
|
||||
}
|
||||
}
|
||||
$nvmdp.on('keyup input', checkPass);
|
||||
$cfnvmdp.on('keyup input', checkPass);
|
||||
|
||||
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='text-align:center'> <= </th>
|
||||
<th style='text-align:center'> <?= _("Expressions Actives") ?> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
// 3. INTERCEPTION DU FORMULAIRE
|
||||
const form = document.getElementById('formChangerPass');
|
||||
if (form) {
|
||||
form.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
confirm_ebene("Confirmez-vous le changement de mot de passe ?", "Confirm password change?")
|
||||
.then((isConfirmed) => { if (isConfirmed) form.submit(); });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($expressionsactives as $expressionsactive):
|
||||
$idExpression = $expressionsactive['code'];
|
||||
?>
|
||||
<tr valign="top">
|
||||
<td align='center'> <input type="button" value="<=" onClick="javascript:ajouter_une_expression_complexite_pass('<?=$idExpression?>', '0');" ></td>
|
||||
<td align='center'><?= $this->nettoyer($expressionsactive['libelle']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
// 4. FONCTION OTP
|
||||
function maj_authentification_otp() {
|
||||
const activerOtp = $("#activerOtp").val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
<legend> <?= _("Double authentification par OTP (One Time PassWord)") ?> </legend>
|
||||
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="45%"><?= _("Activer la double authentification par OTP") ?> </td>
|
||||
<td align="center" width="5%">?</td>
|
||||
<td>
|
||||
<select class="form-select" id="activerOtp" NAME="activerOtp" style='font-size:10pt; text-align:center;' onChange="javascript:maj_authentification_otp();">
|
||||
<?php liste_options($activerOtpouinon, $this->nettoyer($societeuser['activerOtp']), true); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
$.ajax({
|
||||
url: racineWeb + "Paramreinitmotpass/maj_otp/",
|
||||
type: 'POST',
|
||||
data: { activerOtp: activerOtp },
|
||||
success: function() {
|
||||
let msg = (codeLangue === "en_US") ? "OTP Security updated" : "Sécurité OTP mise à jour";
|
||||
toastr.success(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.bg-primary-ghost { background: rgba(33, 46, 83, 0.08) !important; }
|
||||
.bg-info-ghost { background: rgba(0, 184, 212, 0.08) !important; }
|
||||
.btn-xs { padding: 0.25rem 0.45rem; font-size: 0.7rem; }
|
||||
.required:after { content: " *"; color: #dc3545; }
|
||||
.input-group .btn-outline-secondary { border-color: #dee2e6; color: #adb5bd; }
|
||||
.input-group .btn-outline-secondary:hover { background: transparent; color: #212e53; border-color: #212e53; }
|
||||
.scroll-custom::-webkit-scrollbar { width: 4px; }
|
||||
.scroll-custom::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }
|
||||
.list-group-item { transition: all 0.2s; }
|
||||
.list-group-item:hover { background-color: #f8f9fa; }
|
||||
|
||||
/* Style de base pour toutes les icônes de sécurité */
|
||||
.security-icon {
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Transformation spécifique pour simuler une icône de minuscule */
|
||||
/* On cible l'icône de la ligne contenant le texte "minuscule" */
|
||||
.list-group-item:contains("minuscule") i,
|
||||
.list-group-item:has(span:contains("minuscule")) i {
|
||||
font-size: 0.85em; /* Plus petit */
|
||||
transform: translateY(1px);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* Alternative plus simple : ajouter une classe manuelle dans la boucle */
|
||||
.icon-lowercase {
|
||||
font-size: 0.8em !important;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
.icon-uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= _("Gestion des seuils de consommation") ?></h4>
|
||||
<p class="text-muted small mb-0"><?= _("Consultez par les produits santé des garants") ?></p>
|
||||
<p class="text-muted small mb-0"><?= _("Consultez les seuils par les produits santé des garants") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user