示例#1
0
 public function login()
 {
     // connexion au site
     if (isset($_SESSION['user'])) {
         $this->redirectToRoute('accueil');
         // si ok envoie page 2
     }
     if (isset($_POST['connexion'])) {
         $auth = new AuthentificationManager();
         $userManager = new UserManager();
         $UserManagerSuite = new GeneralManager();
         //debug($userManager); die; // vérification
         if ($auth->isValidLoginInfo($_POST['wuser']['mail'], $_POST['wuser']['mot_de_passe'])) {
             //selection table user
             $user_part1 = $userManager->getUserByUsernameOrEmail($_POST['wuser']['mail']);
             //recuperation de l'id de l'utilisateur connecté et jointure avec les autres tables.
             $id_user = $user_part1['id'];
             if ($user_part1['validation_inscription'] === 'true') {
                 $user_part2 = $UserManagerSuite->findAllLogUser($id_user);
                 $user = array_merge($user_part1, $user_part2);
                 // ajout de $user2 dans $user
                 $auth->logUserIn($user);
                 //debug($_SESSION['user']);die(); // vérification
                 $this->redirectToRoute('accueil');
             } else {
                 $this->show('home/home');
             }
         }
     }
     $this->show('home/home');
 }
示例#2
0
 public function getProfilPerso()
 {
     //affiche tout les membres de la bdd
     $user = $this->getUser();
     $manager = new GeneralManager();
     // execute la function qui recupere TOUTES les tables de la bdd
     $ProfilPerso = $manager->findProfilPerso();
     $this->show('accueil/accueil', ['ProfilPerso' => $ProfilPerso]);
 }
示例#3
0
 public function refreshUserMulti()
 {
     $app = getApp();
     $userManager = new UserManager();
     $userManager->setTable($app->getConfig('security_user_table'));
     $userFromSession = $this->getLoggedUser();
     if ($userFromSession) {
         $user_part1 = $userManager->find($userFromSession[$app->getConfig('security_id_property')]);
         //se connecte a la table wusers
         $UserManagerSuite = new GeneralManager();
         $id_user = $user_part1['id'];
         $user_part2 = $UserManagerSuite->findAllLogUser($id_user);
         $userFromDb = array_merge($user_part1, $user_part2);
         // ajout de $user2 dans $user
         if ($userFromDb) {
             $_SESSION["user"] = $userFromDb;
             return true;
         }
     }
     return false;
 }
 public function inscription_3()
 {
     if (isset($_SESSION['user'])) {
         $this->redirectToRoute('accueil');
         // si ok envoie page 2
     }
     if (isset($_POST['valider'])) {
         $_SESSION['reseaux_socialInsc'] = $_POST['reseaux_social'];
         $_SESSION['reseaux_proInsc'] = $_POST['reseaux_pro'];
         $_SESSION['reseaux_divertissementInsc'] = $_POST['reseaux_divertissement'];
         //nettoyage des espace en debut et fin de chaine de caractére
         $_SESSION['wuserInsc'] = array_map('trim', $_SESSION['wuserInsc']);
         $_SESSION['diplomeInsc'] = array_map('trim', $_SESSION['diplomeInsc']);
         $_SESSION['experience_proInsc'] = array_map('trim', $_SESSION['experience_proInsc']);
         $_SESSION['fil_actuInsc'] = array_map('trim', $_SESSION['fil_actuInsc']);
         $_SESSION['portfolioInsc'] = array_map('trim', $_SESSION['portfolioInsc']);
         $_SESSION['reseaux_socialInsc'] = array_map('trim', $_SESSION['reseaux_socialInsc']);
         $_SESSION['reseaux_proInsc'] = array_map('trim', $_SESSION['reseaux_proInsc']);
         $_SESSION['reseaux_divertissementInsc'] = array_map('trim', $_SESSION['reseaux_divertissementInsc']);
         // ajout d'un $key => $value (ex :role => membre)
         $_SESSION['wuserInsc']['role'] = 'membre';
         $_SESSION['wuserInsc']['validation_inscription'] = 'false';
         $manager = new UserManager();
         // insert formulaire 1
         $manager->insert($_SESSION['wuserInsc'], $stripTags = true);
         //enregistrement membre dans BDD
         $mail = $_SESSION['wuserInsc']['mail'];
         // recuperation du mail dans une variable
         //suite insert formulaire 1
         $manager = new GeneralManager();
         $membre = $manager->findMail($mail);
         //recuperation du membre dans la table wusers via le mail
         $id = $membre['id'];
         // insert page formulaire 2
         $_SESSION['diplomeInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['diplome']
         $manager = new DiplomeManager();
         //selection de la table Diplome
         $manager->insert($_SESSION['diplomeInsc'], $stripTags = true);
         $_SESSION['experience_proInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['experience_pro']
         $manager = new Experience_proManager();
         //selection de la table experience_pros
         $manager->insert($_SESSION['experience_proInsc'], $stripTags = true);
         $_SESSION['competenceInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['competence']
         $manager = new CompetenceManager();
         //selection de la table competences
         $manager->insert($_SESSION['competenceInsc'], $stripTags = true);
         $_SESSION['fil_actuInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['fil_actu']
         $manager = new Fil_actuManager();
         //selection de la table fil_actus
         $manager->insert($_SESSION['fil_actuInsc'], $stripTags = true);
         $_SESSION['portfolioInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['portfolio']
         $manager = new PortfolioManager();
         //selection de la table portfolios
         $manager->insert($_SESSION['portfolioInsc'], $stripTags = true);
         // insert page formulaire 3
         $_SESSION['reseaux_socialInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_social']
         $manager = new Reseaux_socialManager();
         //selection de la table reseaux_socials
         $manager->insert($_SESSION['reseaux_socialInsc'], $stripTags = true);
         $_SESSION['reseaux_proInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_pro']
         $manager = new Reseaux_proManager();
         //selection de la table reseaux_pros
         $manager->insert($_SESSION['reseaux_proInsc'], $stripTags = true);
         $_SESSION['reseaux_divertissementInsc']['id_wuser'] = $id;
         // ajout d'une $key id_wuser dans la SESSION['reseaux_divertissement']
         $manager = new Reseaux_divertissementManager();
         //selection de la table reseaux_divertissements
         $manager->insert($_SESSION['reseaux_divertissementInsc'], $stripTags = true);
         Helper::mail("*****@*****.**", "Une demande d'inscritption à été effectué sur LOTL", "Veuillez valider ou non l'inscritpion.");
         // l'envoi de mail vers la BAL de l'admin pour toute nouvelle demande d'inscription sur le site
         //destruction des SESSION INSCRIPTION
         $manager = new GeneralManager();
         $manager->logInscrOut();
         $this->redirectToRoute('validation');
     } elseif (isset($_POST['precedent2'])) {
         $_SESSION['inscription_3'] = $_POST['inscription_3'];
         $this->redirectToRoute('inscription2');
         // si précédent retour page 2
     }
     $this->show('inscription/inscription3');
 }