page connexion suite
This commit is contained in:
parent
5186b0adc7
commit
9cad87f838
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Framework/Localisation.php';
|
||||
// ajout du 23/03/2025 => sociétées multiples
|
||||
require_once 'Modele/Societeusercentral.php';
|
||||
require_once 'Modele/Societeuser.php';
|
||||
|
||||
class ControleurAjaxconnexioncookie extends Controleur
|
||||
{
|
||||
|
|
@ -10,25 +9,20 @@ class ControleurAjaxconnexioncookie extends Controleur
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$this->societeuser = new Societeusercentral();
|
||||
$this->societeuser = new Societeuser();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$msgErreur = $this->requete->getParametreFormulaire("msgErreur");
|
||||
|
||||
$societeusers = $this->societeuser->getSocieteusers();
|
||||
$langues = $this->societeuser->getLangues();
|
||||
|
||||
$societeusersaas = $this->societeuser->getSocieteuserSaas();
|
||||
|
||||
$this->genererVueAjax
|
||||
(
|
||||
array
|
||||
(
|
||||
'msgErreur' => $msgErreur,
|
||||
'societeusers' => $societeusers,
|
||||
'societeusersaas' => $societeusersaas,
|
||||
'langues' => $langues
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
@ -195,7 +136,7 @@ require_once 'Modele/Societeusercentral.php';
|
|||
$this->utilisateur->changerlangueutilisateurconnexion($login, $_SESSION['lang']);
|
||||
}
|
||||
|
||||
$licensed = getLicensed($codeSociete, $nomSociete);
|
||||
$licensed = $this->moritio->getLicensed($codeSociete, $nomSociete);
|
||||
|
||||
if(!$licensed )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,5 +40,14 @@ class Societeuser extends Modele {
|
|||
|
||||
return $nbTentativeConnexionMax;
|
||||
}
|
||||
|
||||
|
||||
public function getLangues()
|
||||
{
|
||||
$sql = 'SELECT codeLangue AS `code`, CONCAT(libelle, " <=> ", libelleEng) AS libelle FROM langue ORDER BY parDefaut DESC, 2;';
|
||||
|
||||
$resultat = $this->executerRequete($sql);
|
||||
|
||||
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,13 +14,10 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wrap-input100">
|
||||
<div class="sr-only">
|
||||
<div class="wrap-input100 validate-input" data-validate="Enter Entity">
|
||||
<label for="codeSociete">Entity</label>
|
||||
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>"
|
||||
placeholder="Entity" style="text-align:center;" required AUTOCOMPLETE="off"
|
||||
onChange="javascript:changer_entite_portail();" >
|
||||
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,16 +6,13 @@
|
|||
RADIANT : Portail Assuré
|
||||
</span>
|
||||
|
||||
<div class="wrap-input100">
|
||||
<label for="langue">Langue</label>
|
||||
<select class="form-select" id="langue" name="langue"
|
||||
|
||||
required autocomplete="off" onchange="javascript:changer_langue_connexion();">
|
||||
<?php liste_options($langues, $_SESSION['lang'], true); ?>
|
||||
</select>
|
||||
<div class="sr-only">
|
||||
<div class="wrap-input100 validate-input" data-validate="Enter Entity">
|
||||
<label for="codeSociete">Entité</label>
|
||||
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wrap-input100">
|
||||
<div class="wrap-input100 validate-input" data-validate="Enter Entity">
|
||||
<label for="codeSociete">Entité</label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user