a
This commit is contained in:
parent
957c5759eb
commit
a31f592ebf
|
|
@ -7,14 +7,15 @@ require_once 'Modele/Logconnexion.php';
|
|||
require_once 'Modele/Societeuser.php';
|
||||
require_once 'Controleur/ControleurMoritio.php';
|
||||
require_once 'Framework/Localisation.php';
|
||||
require_once 'Modele/Societeusercentral.php';
|
||||
|
||||
class ControleurConnexion extends Controleur
|
||||
class ControleurConnexion extends Controleur
|
||||
{
|
||||
private $utilisateur;
|
||||
private $menu;
|
||||
private $logconnexion;
|
||||
private $societeuser;
|
||||
private $moritio;
|
||||
private $societeusercentral;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ require_once 'Framework/Localisation.php';
|
|||
$this->menu = new Menu();
|
||||
$this->logconnexion = new Logconnexion();
|
||||
$this->societeuser = new Societeuser();
|
||||
$this->moritio = new Moritio();
|
||||
$this->societeusercentral = new Societeusercentral();
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
|
@ -34,17 +35,75 @@ require_once 'Framework/Localisation.php';
|
|||
{
|
||||
if
|
||||
(
|
||||
$this->requete->existeParametre("codeSociete")
|
||||
&&
|
||||
$this->requete->existeParametre("login")
|
||||
&&
|
||||
$this->requete->existeParametre("mdp")
|
||||
)
|
||||
{
|
||||
$langue = $this->requete->getParametre("langue");
|
||||
$codeSociete = $this->requete->getParametre("codeSociete");
|
||||
$login = $this->requete->getParametre("login");
|
||||
$mdp = $this->requete->getParametre("mdp");
|
||||
|
||||
$_SESSION['codeSociete'] = $codeSociete;
|
||||
$_SESSION['lang'] = $langue;
|
||||
|
||||
// Ajout KANE du 16/12/2024 => Vérifier que le société existe!
|
||||
//$societeExiste = $this->societeusercentral->existeligne($codeSociete);
|
||||
|
||||
$societeExiste = $this->societeusercentral->existeligneconnexion($codeSociete);
|
||||
|
||||
if (!$societeExiste)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Please review your entity!"), "index");
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Veuillez revoir votre entité!"), "index");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$paramsabonnementsaas = $this->societeusercentral->getParamsAbonnementSaas($codeSociete);
|
||||
|
||||
|
||||
$actif = $paramsabonnementsaas['actif'];
|
||||
$delaiUsageSaas = $paramsabonnementsaas['delaiUsageSaas'];
|
||||
$dateJour = date('Y-m-d');
|
||||
|
||||
if ($actif == "0")
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Inactive subscription"), "index");
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Abonnement inactif!"), "index");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
if ($delaiUsageSaas<$dateJour)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Your subscription has expired!"), "index");
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => "Votre abonnement a expiré!"), "index");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// logConnexion
|
||||
$heureConnexion = date("Y-m-d H:i:s");
|
||||
$ipConnexion = $_SERVER['REMOTE_ADDR'];
|
||||
|
|
@ -52,7 +111,7 @@ require_once 'Framework/Localisation.php';
|
|||
$idSaisie = uniqid();
|
||||
|
||||
$idConnexion = $this->logconnexion->ajouter($login, $heureConnexion, $ipConnexion, $idSaisie);
|
||||
|
||||
|
||||
// Vidage Tables temporaires
|
||||
|
||||
$_SESSION['idSaisie'] = $idSaisie;
|
||||
|
|
@ -61,8 +120,6 @@ require_once 'Framework/Localisation.php';
|
|||
|
||||
$ipbanni = $this->logconnexion->ipbanni($ipConnexion);
|
||||
|
||||
|
||||
|
||||
if($ipbanni>"0")
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
|
|
@ -94,7 +151,8 @@ require_once 'Framework/Localisation.php';
|
|||
}
|
||||
|
||||
$nbTentativeConnexionMax = $this->societeuser->get_nbTentativeConnexion();
|
||||
|
||||
|
||||
|
||||
|
||||
if (!isset($_SESSION['nbTentativeConnexion']))
|
||||
{
|
||||
|
|
@ -102,7 +160,8 @@ require_once 'Framework/Localisation.php';
|
|||
}
|
||||
|
||||
$nbTentativeConnexion = $_SESSION['nbTentativeConnexion'];
|
||||
|
||||
|
||||
|
||||
|
||||
if($nbTentativeConnexion>$nbTentativeConnexionMax)
|
||||
{
|
||||
|
|
@ -117,7 +176,6 @@ require_once 'Framework/Localisation.php';
|
|||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->utilisateur->connecter($login, $mdp))
|
||||
{
|
||||
|
|
@ -126,15 +184,12 @@ require_once 'Framework/Localisation.php';
|
|||
$this->logconnexion->succesconnexion($idConnexion);
|
||||
|
||||
$utilisateur = $this->utilisateur->getUtilisateur($login);
|
||||
|
||||
//
|
||||
|
||||
// Début test Licence
|
||||
$codeSociete = $utilisateur['codeSociete'];
|
||||
$nomSociete = $utilisateur['nomSociete'];
|
||||
$codeLangueUtilisateur = $utilisateur['codeLangue'];
|
||||
|
||||
|
||||
if ($_SESSION['lang'] != $codeLangueUtilisateur)
|
||||
{
|
||||
$this->utilisateur->changerlangueutilisateurconnexion($login, $_SESSION['lang']);
|
||||
|
|
@ -182,12 +237,24 @@ require_once 'Framework/Localisation.php';
|
|||
exit();
|
||||
}
|
||||
|
||||
if($utilisateur['sorti']==1)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Family withdrawn!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Famille sortie!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
// Gestion limite usage
|
||||
$dateLimiteUsage = $utilisateur['dateLimiteUsage'];
|
||||
$dateLimiteUsage_0 = getMoritio_0();
|
||||
$dateLimiteUsage_2 = getMoritio_2();
|
||||
|
||||
|
||||
if($dateLimiteUsage<$dateLimiteUsage_0)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
|
|
@ -201,7 +268,6 @@ require_once 'Framework/Localisation.php';
|
|||
exit();
|
||||
}
|
||||
|
||||
|
||||
if($dateLimiteUsage_2<$dateLimiteUsage_0)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
|
|
@ -216,6 +282,74 @@ require_once 'Framework/Localisation.php';
|
|||
}
|
||||
// FIN Gestion limite usage
|
||||
|
||||
// DEBUT Gestion couverture adhérent
|
||||
|
||||
if($utilisateur['enVigueur']<>1)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Family not in force!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Famille non en vigeur!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
if($utilisateur['supprime']==1)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Family not renewed!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Family not renewed!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
if($utilisateur['dateEffetAdherent']>$dateLimiteUsage_0)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Family not yet in force!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Famille pas encore en vigeur!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if($utilisateur['dateEffetPolice']>$dateLimiteUsage_0)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Policy not yet in force!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Police pas encore en vigeur!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
if($utilisateur['dateFinPolice']<$dateLimiteUsage_0)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Deadline exceeded!'), "index");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->genererVue(array('msgErreur' => 'Echéance dépassée!'), "index");
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
// DEBUT Gestion du client
|
||||
|
||||
if($utilisateur['enVigueur']<>1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user