df
This commit is contained in:
parent
0f8bd57d89
commit
e7036bc309
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Societeuser.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
|
@ -22,21 +21,16 @@ require_once 'Modele/Ouinon.php';
|
|||
|
||||
public function index()
|
||||
{
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
//var_dump($societeuser);
|
||||
|
||||
|
||||
$this->genererVue(array('expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser
|
||||
$this->genererVue(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -48,18 +42,45 @@ require_once 'Modele/Ouinon.php';
|
|||
&& $this->requete->existeParametre("nvmdp")
|
||||
&& $this->requete->existeParametre("cfnvmdp"))
|
||||
{
|
||||
$ancmdp = $this->requete->getParametre("ancmdp");
|
||||
$nvmdp = $this->requete->getParametre("nvmdp");
|
||||
$cfnvmdp = $this->requete->getParametre("cfnvmdp");
|
||||
$ancmdp = $this->requete->getParametre("ancmdp");
|
||||
$nvmdp = $this->requete->getParametre("nvmdp");
|
||||
$cfnvmdp = $this->requete->getParametre("cfnvmdp");
|
||||
|
||||
|
||||
if ($nvmdp!=$cfnvmdp)
|
||||
if ($nvmdp != $cfnvmdp)
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Veuillez confirmer le nouveau mot de passe!'), "index");
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
$msgErreur = _('Veuillez confirmer le nouveau mot de passe!');
|
||||
|
||||
$this->genererVue(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser,
|
||||
'msgErreur' => $msgErreur),
|
||||
"index"
|
||||
);
|
||||
}
|
||||
else if ($nvmdp==$ancmdp)
|
||||
else if ($nvmdp == $ancmdp)
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Veuillez changer le mot de passe!'), "index");
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
$msgErreur = _('Veuillez changer le mot de passe!');
|
||||
|
||||
$this->genererVue(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser,
|
||||
'msgErreur' => $msgErreur),
|
||||
"index"
|
||||
);
|
||||
}
|
||||
else if ($this->societeuser->verifiermotpass($codeSociete, $ancmdp))
|
||||
{
|
||||
|
|
@ -67,30 +88,58 @@ require_once 'Modele/Ouinon.php';
|
|||
$this->rediriger("Parametresgeneraux");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Ancien mot de passe incorrect!'), "index");
|
||||
{
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
$msgErreur = _('Ancien mot de passe incorrect!');
|
||||
|
||||
$this->genererVue(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser,
|
||||
'msgErreur' => $msgErreur),
|
||||
"index"
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Veuillez revoir votre saisie!'), "index");
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$societeuser = $this->societeuser->getVwSocieteuser($codeSociete);
|
||||
|
||||
$msgErreur = _('Veuillez revoir votre saisie!');
|
||||
|
||||
$this->genererVue(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives ,
|
||||
'activerOtpouinon' => $this->activerOtpouinon,
|
||||
'societeuser' => $societeuser,
|
||||
'msgErreur' => $msgErreur),
|
||||
"index"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function majcomplexitepassword()
|
||||
{
|
||||
$idExpression = $this->requete->getParametreFormulaire("idExpression");
|
||||
$actif = $this->requete->getParametreFormulaire("actif");
|
||||
$idExpression = $this->requete->getParametreFormulaire("idExpression");
|
||||
$actif = $this->requete->getParametreFormulaire("actif");
|
||||
|
||||
$this->societeuser->majcomplexitepassword($idExpression , $actif);
|
||||
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
||||
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
||||
|
||||
$this->genererVueAjax(array('expressionsinactives' => $expressionsinactives, 'expressionsactives' => $expressionsactives));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->genererVueAjax(array(
|
||||
'expressionsinactives' => $expressionsinactives,
|
||||
'expressionsactives' => $expressionsactives
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -89145,6 +89145,39 @@ function maj_authentification_otp()
|
|||
|
||||
}
|
||||
|
||||
// FONCTION OTP
|
||||
function maj_authentification_otp() {
|
||||
const activerOtp = $("#activerOtp").val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
if(activerOtp == "1"){
|
||||
v_msg="Etes-vous sur de vouloir activer la double authentification?";
|
||||
v_msgEng="Are you sure you want to enable two-factor authentication?";
|
||||
}else{
|
||||
v_msg="Etes-vous sur de vouloir désactiver la double authentification?";
|
||||
v_msgEng="Are you sure you want to disable two-factor authentication?";
|
||||
}
|
||||
|
||||
confirm_ebene(v_msg, v_msgEng)
|
||||
.then((isConfirmed) => {
|
||||
if (isConfirmed) {
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxparametresgeneraux/majauthentification/",
|
||||
type: 'POST',
|
||||
data: { activerOtp: activerOtp },
|
||||
success: function() {
|
||||
let msg = (codeLangue === "en_US") ? "OTP Security updated" : "Sécurité OTP mise à jour";
|
||||
toastr.success(msg);
|
||||
},
|
||||
complete: function() {
|
||||
window.location.assign($("#racineWeb" ).val()+"Paramreinitmotpass/");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function modifier_param_filtrage_ip()
|
||||
|
|
|
|||
|
|
@ -213,22 +213,6 @@ window.addEventListener('load', function() {
|
|||
}
|
||||
});
|
||||
|
||||
// 4. FONCTION OTP
|
||||
function maj_authentification_otp() {
|
||||
const activerOtp = $("#activerOtp").val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
$.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>
|
||||
|
|
|
|||
|
|
@ -1,47 +1,56 @@
|
|||
<div class="row">
|
||||
<div id="div_expression_non_actif" class="col-6" >
|
||||
<?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';
|
||||
}
|
||||
?>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<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; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_expression_actif" class="col-6" >
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<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; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user