function createSessionAmicale($login) { global $bddAmicale; $reponse = $bddAmicale->query('SELECT (login),(lastname), (firstname),(id) FROM `newdeal_amicalistes` WHERE login="******"'); $donnees = $reponse->fetch(); $_SESSION["prenom"] = $donnees["firstname"]; $_SESSION["nom"] = $donnees["lastname"]; $_SESSION["login"] = $donnees["login"]; //$_SESSION["id"] = $donnees["id"]; $_SESSION['INSA'] = "OUI"; if (isAdmin($donnees['login']) == TRUE) { $_SESSION['admin'] = "OUI"; } else { $_SESSION['admin'] = "NON"; } if (isPhotoUploader($donnees['login']) == TRUE) { $_SESSION['uploaderPhoto'] = "OUI"; } else { $_SESSION['uploaderPhoto'] = "NON"; } }
//} if (isset($_POST['login']) and strlen($_POST['login']) != 0 and isset($_POST['pass']) and strlen($_POST['pass']) != 0 and authenticate($_POST['login'], $_POST['pass'])) { mettrePlusUnDansVuesTable(); mettrePlusUnDansVuesTableForNumerConnexionsDayByDay(); $login = $_POST['login']; $tabNomPrenomINSA = prenomNom($login); $_SESSION["login"] = $login; $_SESSION['INSA'] = "OUI"; $_SESSION["prenom"] = $tabNomPrenomINSA["prenom"]; $_SESSION["nom"] = $tabNomPrenomINSA["nom"]; if (isAdmin($login) == TRUE) { $_SESSION['admin'] = "OUI"; } else { $_SESSION['admin'] = "NON"; } if (isPhotoUploader($login) == TRUE) { $_SESSION['uploaderPhoto'] = "OUI"; } else { $_SESSION['uploaderPhoto'] = "NON"; } // if (loginDansBDDAMicale($login) == TRUE) //{ // createSessionAmicale($login); // TO DO : // Faire une autre fonction en attendant pour simplement rentrer le login de la personne. if (userExisteBddPK($login) == FALSE) { inserUserInBddPK($login, $_SESSION["prenom"], $_SESSION["prenom"]); } createSessionIDBDDPKForINSA($login); majAddrIP($_SERVER["REMOTE_ADDR"], $_SESSION["login"]); majLastVisit($_SESSION["login"]);