V
This commit is contained in:
@@ -7,7 +7,6 @@ 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
|
||||
{
|
||||
@@ -15,7 +14,7 @@ require_once 'Modele/Societeusercentral.php';
|
||||
private $menu;
|
||||
private $logconnexion;
|
||||
private $societeuser;
|
||||
private $societeusercentral;
|
||||
private $moritio;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -23,7 +22,7 @@ require_once 'Modele/Societeusercentral.php';
|
||||
$this->menu = new Menu();
|
||||
$this->logconnexion = new Logconnexion();
|
||||
$this->societeuser = new Societeuser();
|
||||
$this->societeusercentral = new Societeusercentral();
|
||||
$this->moritio = new Moritio();
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -35,75 +34,17 @@ require_once 'Modele/Societeusercentral.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'];
|
||||
@@ -152,8 +93,6 @@ require_once 'Modele/Societeusercentral.php';
|
||||
|
||||
$nbTentativeConnexionMax = $this->societeuser->get_nbTentativeConnexion();
|
||||
|
||||
|
||||
|
||||
if (!isset($_SESSION['nbTentativeConnexion']))
|
||||
{
|
||||
$_SESSION['nbTentativeConnexion'] = '0';
|
||||
@@ -161,8 +100,6 @@ require_once 'Modele/Societeusercentral.php';
|
||||
|
||||
$nbTentativeConnexion = $_SESSION['nbTentativeConnexion'];
|
||||
|
||||
|
||||
|
||||
if($nbTentativeConnexion>$nbTentativeConnexionMax)
|
||||
{
|
||||
if ($_SESSION['lang']=="en_US")
|
||||
@@ -339,7 +276,7 @@ require_once 'Modele/Societeusercentral.php';
|
||||
}
|
||||
|
||||
// FIN Gestion couverture adhérent
|
||||
|
||||
|
||||
// Variables de session Utilisateur
|
||||
$this->requete->getSession()->setAttribut("dateLimiteUsage", $dateLimiteUsage);
|
||||
$this->requete->getSession()->setAttribut("idUtilisateur", $utilisateur['idUtilisateur']);
|
||||
@@ -575,13 +512,13 @@ require_once 'Modele/Societeusercentral.php';
|
||||
/* FIN variable de session context */
|
||||
|
||||
$filename = 'Societes/'.$utilisateur['codeSociete'];
|
||||
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
mkdir($filename, 0700);
|
||||
}
|
||||
$this->requete->getSession()->setAttribut("dossierSociete", $filename);
|
||||
|
||||
// $this->requete->getSession()->setAttribut("dossierGed", $_SESSION['lienPrestation_C'].$_SESSION['dossierSociete'].'/Ged/');
|
||||
$this->requete->getSession()->setAttribut("dossierGed", $_SESSION['lienAssure_C'].$_SESSION['dossierSociete'].'/Ged/');
|
||||
$this->requete->getSession()->setAttribut("cheminGed", $_SESSION['dossierSociete'].'/Ged/');
|
||||
|
||||
@@ -600,7 +537,7 @@ require_once 'Modele/Societeusercentral.php';
|
||||
}
|
||||
|
||||
$this->requete->getSession()->setAttribut("menu", $this->menu->getMenu($utilisateur['codeProfil']));
|
||||
|
||||
|
||||
$codeProfil = $_SESSION['codeProfil_C'];
|
||||
|
||||
$login = $_SESSION['login'];
|
||||
@@ -641,8 +578,8 @@ require_once 'Modele/Societeusercentral.php';
|
||||
|
||||
$_SESSION['passAchanger'] = false;
|
||||
|
||||
// $this->requete->getSession()->setAttribut("bdTests_C", $utilisateur['bdTests']);
|
||||
$this->requete->getSession()->setAttribut("colorTests", $utilisateur['colorTests']);
|
||||
$this->requete->getSession()->setAttribut("bdTests_C", "0");
|
||||
$this->requete->getSession()->setAttribut("colorTests", "red");
|
||||
|
||||
$this->requete->getSession()->setAttribut("faceRegistered_C", "0");
|
||||
|
||||
@@ -661,18 +598,30 @@ require_once 'Modele/Societeusercentral.php';
|
||||
$this->requete->getSession()->setAttribut("lienPhotoFace", $utilisateur['lienPhotoFace']);
|
||||
$this->requete->getSession()->setAttribut("motPassPdf", $utilisateur['motPassPdf']);
|
||||
|
||||
$logo = $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Logos/logo_societe.png';
|
||||
$logo = 'Societes/'.$_SESSION['codeSociete'].'/images/logo_etat.png';
|
||||
$this->requete->getSession()->setAttribut("lienLogo", $logo);
|
||||
|
||||
$dossierLogo=dirname($_SESSION['lienPhotoFace'])."/Logos/logo_societe.png";
|
||||
$this->requete->getSession()->setAttribut("dossierAssure", $utilisateur['dossierAssure']);
|
||||
$dossierLogo=$_SESSION['dossierAssure']."/images/logo_etat.png";
|
||||
$this->requete->getSession()->setAttribut("dossierLogo", $dossierLogo);
|
||||
|
||||
|
||||
$_SESSION['idLogapiface'] = "0";
|
||||
|
||||
// fin 26/09/2025
|
||||
|
||||
$_SESSION['deconnexion'] = "0";
|
||||
$_SESSION['derniere_action'] = time();
|
||||
|
||||
/*
|
||||
var_dump
|
||||
(
|
||||
array
|
||||
(
|
||||
"motCourt" => $motCourt,
|
||||
)
|
||||
);
|
||||
exit();
|
||||
*/
|
||||
|
||||
if(($motCourt===true) or ($changerMotPassDefaut===true) or ($passExpired===true))
|
||||
{
|
||||
@@ -743,7 +692,6 @@ require_once 'Modele/Societeusercentral.php';
|
||||
{
|
||||
$login = $this->requete->getSession()->getAttribut("login");
|
||||
$this->utilisateur->viderTablesTemporairesUser($login);
|
||||
$this->societeusercentral->viderTablesTemporairesUser($login);
|
||||
}
|
||||
|
||||
$langue = $_SESSION['lang'];
|
||||
|
||||
Reference in New Issue
Block a user