예제 #1
0
 public function oubli()
 {
     if (isset($_POST["envoyer"])) {
         $manager = new TokenManager();
         $result = $manager->findMail($_POST['oublie']['mail']);
         //recuperation de l'id et du mail de l'utilisateur
         //debug($result);die();
         if ($result) {
             $id = $result["id"];
             $token = md5(uniqid(rand(), true));
             $tableautoken = array('token' => $token, 'id_wuser' => $id);
             //debug($tableautoken);debug($token);die;
             $manager->insert($tableautoken, $stripTags = true);
             // envoi email
             $lien = $this->generateUrl('nouveau', ['token' => $token, 'id' => $id]);
             Helper::mail($result['mail'], "Demande de nouveau mot de passe", '<a href="projet_lotl' . $lien . '">Lien</a>');
         }
     }
     // création d'une page mot_de_passe_oublie.php
     // on vérifie que les id et token sont dans la base de données
     // si oui on propose à l'utilisateur un formulaire pour ressaisir son passsword (+ confirmation du password)
     $this->redirectToRoute('home');
 }
예제 #2
0
 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');
 }
예제 #3
0
 private function validateType($value, $type)
 {
     switch ($type) {
         case 'int':
             return \Helper\Helper::validateNumeric($value);
             break;
         case 'smallint':
             if ((int) $value < 65535) {
                 return \Helper\Helper::validateNumeric($value);
             }
             break;
         case 'text':
             return TRUE;
             break;
         case 'string':
             return strlen($value) <= 255;
             break;
         case 'datetime':
             return \Helper\Helper::validateDate($value);
             break;
         case 'double':
             return \Helper\Helper::validateNumeric($value);
             break;
         case 'float':
             return \Helper\Helper::validateNumeric($value);
             break;
         case 'bool':
         case 'relation':
             return \Helper\Helper::validateBool($value);
             break;
         case 'listInt':
             return \Helper\Helper::validateListInt($value);
             break;
         case 'listFloat':
             return \Helper\Helper::validateListFloat($value);
             break;
         case 'special':
             return TRUE;
             break;
         default:
             break;
     }
     return FALSE;
 }