96 lines
2.9 KiB
PHP
Executable File
96 lines
2.9 KiB
PHP
Executable File
<?php
|
|
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Societeuser.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
require_once 'Modele/Ouinon.php';
|
|
|
|
class ControleurParamreinitmotpass extends Controleur
|
|
{
|
|
private $menuvue;
|
|
private $societeuser;
|
|
private $activerOtpouinon;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue('Paramreinitmotpass');
|
|
|
|
$this->societeuser = new Societeuser();
|
|
$this->activerOtpouinon = (new Ouinon())->getListe();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$codeSociete = $_SESSION['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
|
|
));
|
|
}
|
|
|
|
public function changerpass()
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
|
|
if ($this->requete->existeParametre("ancmdp")
|
|
&& $this->requete->existeParametre("nvmdp")
|
|
&& $this->requete->existeParametre("cfnvmdp"))
|
|
{
|
|
$ancmdp = $this->requete->getParametre("ancmdp");
|
|
$nvmdp = $this->requete->getParametre("nvmdp");
|
|
$cfnvmdp = $this->requete->getParametre("cfnvmdp");
|
|
|
|
|
|
if ($nvmdp!=$cfnvmdp)
|
|
{
|
|
$this->genererVue(array('msgErreur' => 'Veuillez confirmer le nouveau mot de passe!'), "index");
|
|
}
|
|
else if ($nvmdp==$ancmdp)
|
|
{
|
|
$this->genererVue(array('msgErreur' => 'Veuillez changer le mot de passe!'), "index");
|
|
}
|
|
else if ($this->societeuser->verifiermotpass($codeSociete, $ancmdp))
|
|
{
|
|
$this->societeuser->changerpass($codeSociete, $ancmdp, $nvmdp);
|
|
$this->rediriger("Parametresgeneraux");
|
|
}
|
|
else
|
|
{
|
|
$this->genererVue(array('msgErreur' => 'Ancien mot de passe incorrect!'), "index");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$this->genererVue(array('msgErreur' => 'Veuillez revoir votre saisie!'), "index");
|
|
}
|
|
}
|
|
|
|
public function majcomplexitepassword()
|
|
{
|
|
$idExpression = $this->requete->getParametreFormulaire("idExpression");
|
|
$actif = $this->requete->getParametreFormulaire("actif");
|
|
|
|
$this->societeuser->majcomplexitepassword($idExpression , $actif);
|
|
|
|
$expressionsinactives = $this->societeuser->getcompsantepasswordactif("0");
|
|
|
|
$expressionsactives = $this->societeuser->getcompsantepasswordactif("1");
|
|
|
|
$this->genererVueAjax(array('expressionsinactives' => $expressionsinactives, 'expressionsactives' => $expressionsactives));
|
|
}
|
|
|
|
|
|
|
|
} |