Ajout d'un modele pour Utilisateur, j ai commencer à pouvoir inscrire une personne et que le formulaire d'inscription est bien vérifier, j ai changer les vues (design, nom, css...), J ai changer presque tout les classes de façon plus optimiser, j ai ajouter le FrontControleur.php!

pull/11/head
Emre KARTAL 2 years ago
parent 7d758156fd
commit 27f0e15458

@ -1,145 +0,0 @@
<?php
namespace Controller;
class Controleur {
function __construct() {
global $rep,$vues; // nécessaire pour utiliser variables globales
// on démarre ou reprend la session
session_start();
//debut
//on initialise un tableau d'erreur
$dVueEreur = array ();
try{
$action=NULL;
if(isset($_REQUEST['action'])){
$action = $_REQUEST["action"];
}
switch($action) {
//pas d'action, on réinitialise 1er appel
case NULL:
$this->Reinit();
break;
case "validationFormulaire":
$this->ValidationFormulaire($dVueEreur);
break;
case "redirectionLogin":
$this->redirectionLogin($dVueEreur);
break;
case "redirectionInscription":
$this->redirectionInscription($dVueEreur);
break;
case "seConnecter":
$this->seConnecter($dVueEreur);
break;
case "ConsulterListe":
$this->ConsulterListe();
break;
//mauvaise action
default:
$dVueEreur[] = "Erreur d'appel php";
require ($rep.$vues['home']);
break;
}
} catch (PDOException $e)
{
//si erreur BD, pas le cas ici
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
catch (Exception $e2)
{
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
//fin
exit(0);
}//fin constructeur
function Reinit() {
global $rep,$vues;
$dVue = array (
'nom' => "",
'age' => 0,
);
require ($rep.$vues['Home']);
}
function ValidationFormulaire(array $dVueEreur) {
global $rep,$vues;
//si exception, ca remonte !!!
$nom=$_POST['txtNom']; // txtNom = nom du champ texte dans le formulaire
$age=$_POST['txtAge'];
\config\Validation::val_form($nom,$age,$dVueEreur);
$model = new \Modele\Simplemodel();
$data=$model->get_data();
$dVue = array (
'nom' => $nom,
'age' => $age,
'data' => $data,
);
require ($rep.$vues['inscription']);
}
function redirectionLogin(array $dVueEreur) {
global $rep,$vues;
require ($rep.$vues['login']);
}
function redirectionInscription(array $dVueEreur) {
global $rep,$vues;
require ($rep.$vues['inscription']);
}
function seConnecter(array $dVueEreur) {
global $rep,$vues;
//si exception, ca remonte !!!
$mail=$_POST['mail']; // txtNom = nom du champ texte dans le formulaire
$password=$_POST['password'];
\config\Validation::val_connection($nom,$age,$dVueEreur);
require ($rep.$vues['login']);
}
function ConsulterListe(){
global $rep,$vues;
$con=new Connection("mysql:host=localhost;dbname=dbrahassou","rahassou","achanger");
$model = new ListeGateway($con);
$results=array();
$results=$model->getListePublic(0,10);
$dVue = array (
'results' => $results
);
require ($rep.$vues['listeVue']);
}
}//fin class
?>

@ -0,0 +1,100 @@
<?php
namespace Controller;
class Controleur {
function __construct() {
global $rep,$vues;
session_start();
$dVueEreur = array ();
try{
$action=NULL;
if(isset($_REQUEST['action'])){
$action = $_REQUEST["action"];
}
switch($action) {
//pas d'action, on réinitialise 1er appel
case NULL:
$this->Reinit();
break;
case "validationFormulaire":
$this->ValidationFormulaire($dVueEreur);
break;
case "redirectionLogin":
$this->redirectionLogin($dVueEreur);
break;
case "redirectionInscription":
$this->redirectionInscription($dVueEreur);
break;
case "seConnecter":
$this->seConnecter($dVueEreur);
break;
case "ConsulterListe":
$this->ConsulterListe();
break;
//mauvaise action
default:
$dVueEreur[] = "Erreur d'appel php";
require ($rep.$vues['home']);
break;
}
} catch (PDOException $e)
{
//si erreur BD, pas le cas ici
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
catch (Exception $e2)
{
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
//fin
exit(0);
}//fin constructeur
function Reinit() {
require ($rep.$vues['Home']);
}
function ValidationFormulaire(array $dVueEreur) {
require ($rep.$vues['inscription']);
}
function redirectionLogin(array $dVueEreur) {
require ($rep.$vues['login']);
}
function redirectionInscription(array $dVueEreur) {
require ($rep.$vues['inscription']);
}
function seConnecter(array $dVueEreur) {
require ($rep.$vues['login']);
}
function ConsulterListe(){
require ($rep.$vues['listeVue']);
}
}//fin class
?>

@ -0,0 +1,22 @@
<?php
class FrontController {
global $rep,$vues;
function __construct(){
session_start();
try {
$actionUser = array();
if(isset($_GET["action"]) and in_array($_GET["action"],$actionUser))
if(!isset($_SESSION["IdUserCourant"])){
require("views/login.php");
} else $controlleur = new CtrlUtilisateur();
else $controlleur = new CtrlVisiteur();
} catch (Exception $e) {
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
}
}
?>

@ -0,0 +1,67 @@
<?php
namespace modeles;
class Liste
{
private $id;
private $nom;
private $dateCreation;
private $estPublic;
private $idUser;
public function __construct($id, $nom, $dateCreation, $estPublic, $idUser){
$this->id = $id;
$this->nom = $nom;
$this->description = $description;
$this->dateCreation = $dateCreation;
$this->estPublic = $estPublic;
$this->idUser = $idUser;
}
//Id
public function getId(){
return $this->id;
}
public function setId($id){
$this->id=$id;
}
//Nom
public function getNom(){
return $this->nom;
}
public function setNom($nom){
$this->nom=$nom;
}
//DateCreation
public function getDateCreation(){
return $this->dateCreation;
}
public function setDateCreation($dateCreation){
$this->dateCreation = $dateCreation;
}
//EstPublic
public function getEstPublic(){
return $this->estPublic;
}
public function setEstPublic($estPublic){
$this->estPublic = $estPublic;
}
//IdUser
public function getIdUser(){
return $this->idUser;
}
public function setIdUser($idUser){
$this->idUser = $idUser;
}
}

@ -0,0 +1,22 @@
<?php
namespace modeles;
class Modele
{
public function __construct(){
}
public function getAllListePublic(){
}
}

@ -0,0 +1,77 @@
<?php
namespace modeles;
class Tache
{
private $id;
private $nom;
private $description;
private $dateCreation;
private $estValide;
private $idListe;
public function __construct($id, $nom, $description,$dateCreation, $estValide,$idListe){
$this->id = $id;
$this->nom = $nom;
$this->description = $description;
$this->dateCreation = $dateCreation;
$this->estValide = $estValide;
$this->idListe = $idListe;
}
//Id
public function getid(){
return $this->id;
}
public function setId($id){
$this->id=$id;
}
//Nom
public function getNom(){
return $this->nom;
}
public function setNom($nom){
$this->nom=$nom;
}
//Description
public function getDescription(){
return $this->description;
}
public function setDescription($description){
$this->description=$description;
}
//DateCreation
public function getDateCreation(){
return $this->dateCreation;
}
public function setDateCreation($dateCreation){
$this->dateCreation = $dateCreation;
}
//EstValide
public function getEstValide(){
return $this->estValide;
}
public function setEstValide($estValide){
$this->estValide = $estValide;
}
//idList
public function getIdListe(){
return $this->estValide;
}
public function setIdListe($idListe){
$this->idListe = $idListe;
}
}

@ -4,13 +4,13 @@ namespace modeles;
class Utilisateur class Utilisateur
{ {
private string $id; private $id;
private string $nom; private $nom;
private string $prenom; private $prenom;
private string $pseudo; private $pseudo;
private string $email; private $email;
public function __construct(string $id, string $nom, string $prenom, string $pseudo, string $email,string $motDePasse, bool $isAdmin){ public function __construct($id, $nom, $prenom, $pseudo, $email, $motDePasse, $isAdmin){
$this->id = $id; $this->id = $id;
$this->nom = $nom; $this->nom = $nom;
$this->prenom = $prenom; $this->prenom = $prenom;
@ -23,7 +23,7 @@ class Utilisateur
return $this->id; return $this->id;
} }
public function setId(string $id){ public function setId($id){
$this->nom = $id; $this->nom = $id;
} }
@ -32,7 +32,7 @@ class Utilisateur
return $this->nom; return $this->nom;
} }
public function setNom(string $nom){ public function setNom($nom){
$this->nom = $nom; $this->nom = $nom;
} }
@ -41,7 +41,7 @@ class Utilisateur
return $this->prenom; return $this->prenom;
} }
public function setPrenom(string $prenom){ public function setPrenom($prenom){
$this->prenom = $prenom; $this->prenom = $prenom;
} }
@ -50,7 +50,7 @@ class Utilisateur
return $this->pseudo; return $this->pseudo;
} }
public function setPseudo(string $pseudo){ public function setPseudo($pseudo){
$this->pseudo = $pseudo; $this->pseudo = $pseudo;
} }
@ -59,7 +59,7 @@ class Utilisateur
return $this->email; return $this->email;
} }
public function setEmail(string $email){ public function setEmail($email){
$this->email = $email; $this->email = $email;
} }

@ -1,47 +0,0 @@
<?php
namespace modeles;
class Liste
{
private string $id;
private string $nom;
private Date $dateCreation;
private bool $estValide;
private array $liste;
public function __construct(string $id, string $nom, Date $dateCreation, array $liste){
$this->id = $id;
$this->nom = $nom;
$this->description = $description;
$this->dateCreation = $dateCreation;
$this->estValide = false;
$this->liste = $liste;
}
//Nom
public function getNom(){
return $this->nom;
}
//Id
public function getid(){
return $this->id;
}
//DateCreation
public function getDateCreation(){
return $this->dateCreation;
}
//EstValide
public function getEstValide(){
return $this->estValide;
}
public function getListe(){
return $this->liste;
}
}

@ -21,9 +21,9 @@ class ListeGateway{
$this->con->executeQuery($query, array('nom' => array($Liste->getNom(), PDO::PARAM_STRING)), array('id' => array($Liste->getId()),PDO::PARAM_INT)); $this->con->executeQuery($query, array('nom' => array($Liste->getNom(), PDO::PARAM_STRING)), array('id' => array($Liste->getId()),PDO::PARAM_INT));
} }
public function Supprimer(Liste $liste){ public function Supprimer(int $id){
$query='DELETE FROM ToDoListe_Liste WHERE id=:id'; $query='DELETE FROM ToDoListe_Liste WHERE id=:id';
$this->con->executeQuery($query,'id' => array($liste->id, PDO::PARAM_STRING))); $this->con->executeQuery($query,'id' => array($id, PDO::PARAM_STRING)));
} }
public function getListe(int $offset, int $limit){ public function getListe(int $offset, int $limit){
@ -41,7 +41,7 @@ class ListeGateway{
} }
public function getListePublic($offset,$limit){ public function getListePublic($offset,$limit){
$query = "SELECT * FROM ToDoListe_Liste AND isPublic LIMITS $offset,$limit"; $query = "SELECT * FROM ToDoListe_Liste AND estPublic LIMITS $offset,$limit";
$this->con->executeQuery($query); $this->con->executeQuery($query);
$results=$this->con->getResults(); $results=$this->con->getResults();
return $results; return $results;

@ -0,0 +1,28 @@
<?php
namespace modeles;
class Modele
{
public function __construct(){
}
public static function CreerUtilisateur(){
$userGtw = new UtilisateurGateway();
$verif = Validation::val_form_user();
if($verif == false){
throw new Exception();
}
$userGtw->AjouterUtilisateur();
}
}

@ -1,47 +0,0 @@
<?php
namespace modeles;
class Tache
{
private string $id;
private string $nom;
private string $description;
private Date $dateCreation;
private bool $estValide;
public function __construct(string $id, string $nom, string $description, Date $dateCreation){
$this->id = $id;
$this->nom = $nom;
$this->description = $description;
$this->dateCreation = $dateCreation;
$this->estValide = false;
}
//Nom
public function getNom(){
return $this->nom;
}
//Id
public function getid(){
return $this->id;
}
//Description
public function getDescription(){
return $this->description;
}
//DateCreation
public function getDateCreation(){
return $this->dateCreation;
}
//EstValide
public function getEstValide(){
return $this->estValide;
}
}

@ -1,11 +1,11 @@
<?php <?php
class UtilisateurGateway{ class UtilisateurGateway{
private $con; private $con;
public function __construct(Connection $con){ public function __construct(){
$this->con=$con; $this->con=new Connection($dsn,$user,$pass);
} }
public function CreerUtilisateur(string $nom,string $prenom, string $pseudo, string $email, string $mdp){ public function AjouterUtilisateur(string $nom,string $prenom, string $pseudo, string $email, string $mdp){
$query='INSERT INTO ToDoList_Utilisateur(nom,prenom,pseudo,email,motDePasse) values (:nom,:prenom,:pseudo,:email,:mdp);'; $query='INSERT INTO ToDoList_Utilisateur(nom,prenom,pseudo,email,motDePasse) values (:nom,:prenom,:pseudo,:email,:mdp);';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STRING), 'nom' => array($nom, PDO::PARAM_STRING),
@ -15,10 +15,18 @@ class UtilisateurGateway{
'mdp' => array($mdp, PDO::PARAM_STRING))); 'mdp' => array($mdp, PDO::PARAM_STRING)));
} }
public function Supprimer(Utilisateur $user){ public function SupprimerUtilisateur(int $id){
$query='DELETE FROM ToDoList_Utilisateur WHERE id=:id;'; $query='DELETE FROM ToDoList_Utilisateur WHERE id=:id;';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
'id' => array($user->getNom(), PDO::PARAM_STRING))); 'id' => array($id, PDO::PARAM_STRING)));
}
public function RechercheUtilisateurViaPseudo(string $pseudo){
}
public function RechercheUtilisateurViaEmail(string $pseudo){
} }
} }
?> ?>

@ -1,15 +0,0 @@
.button-home{
color: white;
background-color: transparent;
font-family: JetBrains Mono,Menlo,Droid Sans Mono,monospace;
border-color: transparent;
font-weight: 600;
}
.button-home:hover{
color: #6a52fd;
}
.navbar-home{
margin-left: 10%;
}

@ -11,289 +11,3 @@ body::before {
transform: rotate(-5deg); transform: rotate(-5deg);
z-index: -1; z-index: -1;
} }
.form-redirection{
margin-top: -25px;
}
.main-logo{
display: flex;
flex-direction: column;
margin-left: auto;
margin-right: auto;
align-items: center;
}
.main-logo img{
width: 50%;
}
body fieldset {
box-shadow: 0 8px 10px #29a329;
}
body.error {
background: #f04000;
}
body.error fieldset {
box-shadow: 0 8px 10px #bd3200;
}
h2 {
position: absolute;
left: 50%;
transform: translateX(-50%);
font-family: sans-serif;
text-transform: uppercase;
letter-spacing: 2px;
}
h1 {
color: white;
font-size: 100%;
/*transform: translateX(-50%);*/
font-family: sans-serif;
text-transform: uppercase;
}
h2 {
top: 44px;
color: white;
font-size: 10px;
opacity: 0.7;
}
ul.items {
position: absolute;
width: 30px;
height: auto;
top: 50%;
left: -60px;
transform: translateY(-50%);
}
ul.items li {
width: 8px;
height: 8px;
margin: 10px 0;
background: white;
border-radius: 50%;
opacity: 0.4;
cursor: pointer;
}
ul.items li.active {
opacity: 1;
}
form {
position: absolute;
width: 300px;
height: 60px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
form fieldset {
position: absolute;
width: 300px;
height: 60px;
background: white;
border-radius: 3px;
opacity: 0;
transform: scale(0.2);
transition: all 0.4s ease-in-out;
}
form fieldset input, form fieldset p {
display: inline-block;
width: 200px;
margin-left: 50px;
color: #333333;
font-size: 16px;
letter-spacing: 1px;
}
form fieldset p {
margin-top: 22px;
text-align: center;
}
form fieldset input {
height: 40px;
margin-top: 8px;
border: none;
outline: none;
}
form fieldset .icon {
position: absolute;
width: 30px;
height: 30px;
top: 15px;
transition: all 0.4s ease;
}
form fieldset .icon i {
position: absolute;
display: block;
}
form fieldset .icon i::before, form fieldset .icon i::after {
position: absolute;
content: "";
}
form fieldset .icon.left {
left: 10px;
}
form fieldset .icon.right {
right: 10px;
cursor: pointer;
}
form fieldset .icon.button:hover {
background: #f2f2f2;
border-radius: 3px;
transition: all 0.4s ease;
}
form fieldset.enable {
z-index: 1;
opacity: 1;
transition: all 0.5s ease-out 0.2s;
transform: scale(1);
animation: enable 0.5s ease-out 0.2s;
}
form fieldset.disable {
opacity: 0;
transition: all 0.3s ease-in;
transform: translateY(120px) scale(0.9);
}
body.error fieldset {
transform-origin: 50% 100%;
animation: error 0.3s ease-out;
}
@keyframes enable {
0% {
opacity: 0;
transform: scale(0.2);
}
60% {
transform: scale(1.1);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes error {
0%, 50%, 100% {
transform: rotate(0deg);
}
25% {
transform: rotate(-3deg);
}
75% {
transform: rotate(3deg);
}
}
/**
* * Icons in CSS, long as f****
* */
.icon .arrow {
width: 2px;
height: 17px;
top: 5px;
left: 14px;
background: #333333;
}
.icon .arrow::before {
width: 6px;
height: 6px;
bottom: -1px;
left: -3px;
border-color: #333333;
border-right: 2px solid;
border-bottom: 2px solid;
transform: rotate(45deg);
}
.icon .user {
width: 20px;
height: 10px;
bottom: 5px;
left: 5px;
box-shadow: 0 0 0 2px #333333 inset;
border-radius: 6px 6px 3px 3px;
}
.icon .user::before {
width: 10px;
height: 10px;
top: -9px;
left: 5px;
box-shadow: 0 0 0 2px #333333 inset;
border-radius: 50%;
}
.icon .letter {
width: 20px;
height: 12px;
top: 9px;
left: 5px;
box-shadow: 0 0 0 2px #333333 inset;
border-radius: 3px;
}
.icon .letter::before, .icon .letter::after {
width: 11px;
height: 2px;
top: 4px;
background: #333333;
}
.icon .letter::before {
left: 0;
transform: rotate(30deg);
}
.icon .letter::after {
right: 0;
transform: rotate(-30deg);
}
.icon .lock {
width: 20px;
height: 16px;
top: 9px;
left: 5px;
box-shadow: 0 0 0 2px #333333 inset;
border-radius: 3px;
}
.icon .lock::before {
width: 8px;
height: 8px;
top: -4px;
left: 4px;
border: 2px solid transparent;
border-top: 2px solid #333333;
border-right: 2px solid #333333;
border-radius: 50%;
transform: rotate(-45deg);
}
.icon .lock::after {
width: 6px;
height: 7px;
top: 4px;
left: 7px;
box-shadow: 0 0 0 2px #333333 inset;
}
.icon .heart {
width: 10px;
height: 10px;
top: 11px;
left: 7px;
background: #ff5233;
transform: rotate(45deg);
}
.icon .heart::before, .icon .heart::after {
width: 10px;
height: 10px;
border-radius: 50%;
background: #ff5233;
}
.icon .heart::before {
left: -6px;
}
.icon .heart::after {
top: -6px;
}

@ -1,233 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');
body {
font: 18px "Nunito", sans-serif;
color: black;
min-height: 100vh;
padding: 2rem;
display: flex;
justify-content: center;
align-items: center;
}
body::before {
content: '';
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
background: url("../Images/Back(2).jpg") no-repeat center;
background-size: cover;
animation: backgroundZoomAnimate 20s forwards;
}
@keyframes backgroundZoomAnimate {
from {
transform: scale(1);
}
to {
transform: scale(1.3);
}
}
.profil-card {
box-shadow: 0 18px 200px -60px black;
border-radius: 50px;
width: 650px;
position: relative;
backdrop-filter: blur(15px);
border: 2px solid #ffffff40;
padding: 3rem 5rem;
display: flex;
flex-direction: column;
gap: 40px;
@media screen and (max-width: 768px) {
width: auto;
}
}
.profil-card__img img {
margin: auto;
width: 200px;
height: 200px;
border-radius: 50%;
object-fit: cover;
display: block;
box-shadow: 0 10px 60px -10px rgba(13,28,39,.5);
}
.profil-card__desc {
text-align: center;
display: flex;
flex-direction: column;
gap: 25px;
}
.localisation {
display: flex;
align-items:center;
gap:10px;
justify-content: center;
}
.profil-card__desc h1 {
font-size: 2.5rem;
font-weight: bold;
}
.profil-card__desc h1 + div {
font-size: 20px;
}
.info{
display: flex;
justify-content: center;
gap: 50px;
@media screen and (max-width: 576px) {
gap: 30px;
}
}
.info > div {
text-transform: uppercase;
font-weight: bold;
letter-spacing: 1px;
text-align: center;
}
.info > div > *:first-child {
font-weight: bold;
letter-spacing: 3px;
font-size: 2rem;
margin-bottom: 15px;
}
.info > div > *:last-child {
font-size: 16px;
opacity: .7;
}
.social {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.social a {
display: inline-block;
width: 55px;
height: 55px;
margin: 15px;
border-radius: 40%;
align-items: center;
justify-content: center;
color: white;
position: relative;
flex-shrink: 0;
transition: all .2s;
@media screen and (max-width: 768px) {
width: 50px;
height: 50px;
margin: 10px;
}
}
@media screen and (min-width: 768px) {
.social a:hover {
transform: scale(1.2) translateY(-5px);
}
}
.social a.facebook {
padding-top: 15px;
padding-left: 15px;
background: linear-gradient(45deg, #3b5998,#0078d7);
box-shadow: 0 4px 30px rgba(45, 98, 169, 1);
}
.social a.twitter {
padding-top: 15px;
padding-left: 15px;
background: linear-gradient(45deg, #1da1f2,#0e71c8);
box-shadow: 0 4px 30px rgba(19, 127, 212, 1);
}
.social a.instagram {
padding-top: 15px;
padding-left: 15px;
background: linear-gradient(45deg, #405de6,#5851db,#833ab4,#c13584,#e1306c,#fd1d1d);
box-shadow: 0 4px 30px rgba(120, 64, 190, 0.8);
}
.social a.gitlab {
padding-top: 15px;
padding-left: 15px;
background: linear-gradient(45deg, #FF9467,#DB4100);
box-shadow: 0 4px 30px rgba(255,148,103, 0.6);
}
.actions {
display: flex;
align-items: center;
justify-content: center;
gap: 2rem;
@media screen and (max-width: 576px) {
flex-direction: column;
gap: 1.5rem;
}
}
.actions > button {
font-weight: bold;
font-size: 22px;
padding: 15px 0;
min-width: 250px;
border-radius: 50px;
text-align: center;
color: white;
cursor: pointer;
transition: all .2s;
@media screen and (max-width: 760px) {
min-width: 170px;
}
@media screen and (max-width: 576px) {
min-width: inherit;
width: 100%;
max-width: 350%;
}
}
@media screen and (min-width: 576px) {
.actions > button:hover {
transform: translateY(-5px);
}
}
.bleu{
background: linear-gradient(45deg, #1da1f2,#0e71c8);
box-shadow: 0 4px 30px rgba(19, 127, 212, 0.4);
}
.bleu:hover {
box-shadow: 0 7px 30px rgba(19, 127, 212, 0.75);
}
.orange {
background: linear-gradient(45deg, #d5135a,#f05924);
box-shadow: 0 4px 30px rgba(223, 45, 70, 0.35);
}
.orange:hover {
box-shadow: 0 7px 30px rgba(223,45,70,0.75);
}

@ -211,16 +211,6 @@ body::before {
accent-color: black; accent-color: black;
} }
.model button {
background: #38b6ff;
color: white;
padding: 1rem;
border-radius: 100px;
text-transform: uppercase;
letter-spacing: 2px;
transition: background .5s;
}
.login-card-form button:hover { .login-card-form button:hover {
background-color: rgba(84,192,255,.85); background-color: rgba(84,192,255,.85);
cursor: pointer; cursor: pointer;
@ -270,6 +260,30 @@ body::before {
/* Button */ /* Button */
.mon-button{
font-family: 'Poppins', sans-serif;
font-weight: bold;
border-color: transparent;
background-color: transparent;
color: #35339a;
}
.mon-button:hover{
text-decoration: underline 1px;
}
.button-body{
background: #38b6ff;
color: white;
padding: 1rem;
border-radius: 100px;
text-transform: uppercase;
letter-spacing: 2px;
transition: background .5s;
}
.button{ .button{
border-color: #38b6ff; border-color: #38b6ff;
height: 2rem; height: 2rem;

@ -1,9 +0,0 @@
<?php
Foreach($results as $row)
{
print $row->getNom();
echo ("<br>");
print $row->getDateCreation();
echo ("<br>");
}
?>

@ -0,0 +1,21 @@
<header>
<nav class="navbar navbar-expand-lg bg-info">
<img src="./Vue/Images/LogoForHome.png" width="200">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse navbar-home" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link" href="#">Features</a>
<a class="nav-item nav-link" href="#">Pricing</a>
<a class="nav-item nav-link disabled" href="#">Disabled</a>
</div>
</div>
</nav>
</header>

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home Page</title> <title>Home Page</title>
<!-- CSS only --> <!-- CSS only -->
<link rel="stylesheet" href="./Vue/css/home.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper --> <!-- JavaScript Bundle with Popper -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
@ -15,49 +14,28 @@
</head> </head>
<body> <body>
<nav class="navbar navbar-expand-lg bg-info"> <? php require('Vue/html/NavBar.php'); ?>
<img src="./Vue/Images/LogoForHome.png" width="200">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse navbar-home" id="navbarNavAltMarkup">
<div class="navbar-nav">
<form method="post">
<button type="submit" class="button-home">Profil</Button>
<input type="hidden" name="action" value="redirectionLogin">
</form>
<form method="post">
<button type="submit" class="button-home">Mes tâches</Button>
<input type="hidden" name="action" value="">
</form>
<form method="post">
<button type="submit" class="button-home">Les tâches publics</Button>
<input type="hidden" name="action" value="ConsulterListe">
</form>
</div>
</div>
</nav>
<br>
<?php
Foreach($results as $row)
{
print $row->getNom();
echo ("<br>");
print $row->getDateCreation();
echo ("<br>");
}
?>
<nav aria-label="Page navigation example"> <nav aria-label="Page navigation example">
<ul class="pagination justify-content-center"> <ul class="pagination justify-content-center">
<li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item">
<li class="page-item"><a class="page-link" href="#">1</a></li> <a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li> <li class="page-item">
<li class="page-item"><a class="page-link" href="#">3</a></li> <a class="page-link" href="#">1</a>
<li class="page-item"><a class="page-link" href="#">Next</a></li> </li>
<li class="page-item">
<a class="page-link" href="#">2</a
></li>
<li class="page-item">
<a class="page-link" href="#">3</a>
</li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul> </ul>
</nav> </nav>
</body> </body>

@ -0,0 +1,18 @@
<html>
<head><title>Erreur</title>
</head>
<body>
<h1>ERREUR !!!!!</h1>
<?php
if (isset($dVueEreur)) {
foreach ($dVueEreur as $value){
echo $value;
}
}
?>
</body> </html>

@ -1,54 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page d'inscription</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Vue/css/inscription.css">
<script type="text/javascript" src="./Vue/javaScript/inscription.js" defer></script>
</head>
<body>
<div class="main-logo">
<form method="post" class="form-redirection">
<Button type="submit">Revenir</Button>
<input type="hidden" name="action" value="redirectionLogin">
</form>
<img src="./Vue/Images/Logo.png" alt="logo">
<h1>Inscription</h1>
</div>
<form>
<ul class="items"></ul>
<fieldset class="username enable">
<div class="icon left"><i class="user"></i></div>
<input type="text" name="usernameForm" placeholder="Username"/>
<div class="icon right button"><i class="arrow"></i></div>
</fieldset>
<fieldset class="email">
<div class="icon left"><i class="letter"></i></div>
<input type="mail" name="mailForm" placeholder="Email"/>
<div class="icon right button"><i class="arrow"></i></div>
</fieldset>
<fieldset class="password">
<div class="icon left"><i class="lock"></i></div>
<input type="password" name="passwordForm" placeholder="Password"/>
<div class="icon right button"><i class="arrow"></i></div>
</fieldset>
<fieldset class="thanks">
<div class="icon left"><i class="heart"></i></div>
<p>Merci pour votre inscription</p>
<div class="icon right"><i class="heart"></i></div>
</fieldset>
</form>
</body>
</html>

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<title>Page d'inscription</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS only -->
<link rel="stylesheet" href="./Vue/css/inscription.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<div class="main-logo">
<img src="./Vue/Images/Logo.png" alt="logo">
<h1>Inscription</h1>
</div>
<form>
<!-- 2 column grid layout with text inputs for the first and last names -->
<div class="row mb-4">
<div class="col">
<div class="form-outline">
<input type="text" id="form3Example1" class="form-control" />
<label class="form-label" for="form3Example1">First name</label>
</div>
</div>
<div class="col">
<div class="form-outline">
<input type="text" id="form3Example2" class="form-control" />
<label class="form-label" for="form3Example2">Last name</label>
</div>
</div>
</div>
<!-- Email input -->
<div class="form-outline mb-4">
<input type="email" id="form3Example3" class="form-control" />
<label class="form-label" for="form3Example3">Email address</label>
</div>
<!-- Password input -->
<div class="form-outline mb-4">
<input type="password" id="form3Example4" class="form-control" />
<label class="form-label" for="form3Example4">Password</label>
</div>
<!-- Submit button -->
<button type="submit" class="btn btn-primary btn-block mb-4">Sign up</button>
</form>
</body>
</html>

@ -46,12 +46,16 @@
</div> </div>
<a href="#">Oublie de mot de passe</a> <a href="#">Oublie de mot de passe</a>
</div> </div>
<button type="submit">Se connecter</button> <button type="submit" class="button-body">Se connecter</button>
<!-- action !!!!!!!!!! --> <!-- action !!!!!!!!!! -->
<input type="hidden" name="action" value="seConnecter"> <input type="hidden" name="action" value="seConnecter">
</form> </form>
<div class="login-card-footer"> <div class="login-card-footer">
Pas de compte? <a href="./Vue/html/inscription.html">Creer un compte</a> Pas de compte ? <!--<a href="../../Controller/Controleur.php?action='redirectionInscription'">Creer un compte</a>-->
<form method="post">
<Button type="submit" class="mon-button">Creer un compte</Button>
<input type="hidden" name="action" value="redirectionInscription">
</form>
</div> </div>
</div> </div>
<div class="social"> <div class="social">

@ -1,81 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Profil</title>
<link rel="stylesheet" href="../css/profil.css">
<link rel="stylesheet" href="../css/reset.css" />
</head>
<body>
<div class="profil-card">
<figure class="profil-card__img">
<img src="../Images/avatar.jpeg" alt="Image Profil">
</figure>
<div class="profil-card__desc">
<h1>Ritchie Golozer</h1>
<div>front-end Developer</div>
<div style="localisation">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-map-pin" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<circle cx="12" cy="11" r="3"></circle>
<path d="M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"></path>
</svg>
<span>Clermont-Ferrand</span>
</div>
</div>
<div class="social">
<a href="#" class="facebook">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-facebook" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M7 10v4h3v7h4v-7h3l1 -4h-4v-2a1 1 0 0 1 1 -1h3v-4h-3a5 5 0 0 0 -5 5v2h-3"></path>
</svg>
</a>
<a href="#" class="twitter">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-twitter" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"></path>
</svg>
</a>
<a href="#" class="instagram">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-instagram" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<rect x="4" y="4" width="16" height="16" rx="4"></rect>
<circle cx="12" cy="12" r="3"></circle>
<line x1="16.5" y1="7.5" x2="16.5" y2="7.501"></line>
</svg>
</a>
<a href="#" class="gitlab">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-gitlab" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M21 14l-9 7l-9 -7l3 -11l3 7h6l3 -7z"></path>
</svg>
</a>
</div>
<div class="info">
<div>
<div>850</div>
<div>Followers</div>
</div>
<div>
<div>50</div>
<div>References</div>
</div>
<div>
<div>105</div>
<div>Works</div>
</div>
</div>
<div class="actions">
<button class="orange">Se déconnecter</button>
</div>
<div class="actions">
<button class="orange">Supprimer le compte</button>
</div>
</div>
</body>
</html>

@ -1,53 +0,0 @@
function init() {
// Generate li foreach fieldset
for (var i = 0; i < count; i++) {
var ul = document.querySelector("ul.items"),
li = document.createElement("li");
ul.appendChild(li);
}
// Add class active on first li
ul.firstChild.classList.add("active");
}
function next(target) {
var input = target.previousElementSibling;
// Check if input is empty
if (input.value === "") {
body.classList.add("error");
} else {
body.classList.remove("error");
var enable = document.querySelector("form fieldset.enable"),
nextEnable = enable.nextElementSibling;
enable.classList.remove("enable");
enable.classList.add("disable");
nextEnable.classList.add("enable");
// Switch active class on left list
var active = document.querySelector("ul.items li.active"),
nextActive = active.nextElementSibling;
active.classList.remove("active");
nextActive.classList.add("active");
}
}
function keyDown(event) {
var key = event.keyCode,
target = document.querySelector("fieldset.enable .button");
if (key == 13 || key == 9) next(target);
}
var body = document.querySelector("body"),
form = document.querySelector("form"),
count = form.querySelectorAll("fieldset").length;
window.onload = init;
document.body.onmouseup = function (event) {
var target = event.target || event.toElement;
if (target.classList.contains("button")) next(target);
};
document.addEventListener("keydown", keyDown, false);

@ -0,0 +1,31 @@
<?php
class Connection extends PDO {
private $stmt;
public function __construct(string $dsn, string $username, string $password) {
parent::__construct($dsn,$username,$password);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
/** * @param string $query
* @param array $parameters *
* @return bool Returns `true` on success, `false` otherwise
*/
public function executeQuery(string $query, array $parameters = []) : bool{
$this->stmt = parent::prepare($query);
foreach ($parameters as $name => $value) {
$this->stmt->bindValue($name, $value[0], $value[1]);
}
return $this->stmt->execute();
}
public function getResults() : array {
return $this->stmt->fetchall();
}
}

@ -1,155 +0,0 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
* $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
* $classLoader->register();
*
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @author Jonathan H. Wage <jonwage@gmail.com>
* @author Roman S. Borschel <roman@code-factory.org>
* @author Matthew Weier O'Phinney <matthew@zend.com>
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
*/
class SplClassLoader
{
private $_fileExtension = '.php';
private $_namespace;
private $_includePath;
private $_namespaceSeparator = '\\';
/**
* Creates a new <tt>SplClassLoader</tt> that loads classes of the
* specified namespace.
*
* @param string $ns The namespace to use.
*/
public function __construct(string $ns = null, string $includePath = null)
{
$this->_namespace = $ns;
$this->_includePath = $includePath;
}
/**
* Sets the namespace separator used by classes in the namespace of this class loader.
*
* @param string $sep The separator to use.
*/
public function setNamespaceSeparator(string $sep)
{
$this->_namespaceSeparator = $sep;
}
/**
* Gets the namespace seperator used by classes in the namespace of this class loader.
*
* @return void
*/
public function getNamespaceSeparator()
{
return $this->_namespaceSeparator;
}
/**
* Sets the base include path for all class files in the namespace of this class loader.
*
* @param string $includePath
*/
public function setIncludePath(string $includePath)
{
$this->_includePath = $includePath;
}
/**
* Gets the base include path for all class files in the namespace of this class loader.
*
* @return string $includePath
*/
public function getIncludePath()
{
return $this->_includePath;
}
/**
* Sets the file extension of class files in the namespace of this class loader.
*
* @param string $fileExtension
*/
public function setFileExtension($fileExtension)
{
$this->_fileExtension = $fileExtension;
}
/**
* Gets the file extension of class files in the namespace of this class loader.
*
* @return string $fileExtension
*/
public function getFileExtension()
{
return $this->_fileExtension;
}
/**
* Installs this class loader on the SPL autoload stack.
*/
public function register()
{
spl_autoload_register(array($this, 'loadClass'));
}
/**
* Uninstalls this class loader from the SPL autoloader stack.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $className The name of the class to load.
* @return void
*/
public function loadClass(string $className)
{
if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
$fileName = '';
$namespace = '';
if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
}
}
}

@ -4,36 +4,81 @@ namespace config;
class Validation { class Validation {
static function val_action($action) { static function val_form_user(string &$nom, string &$prenom, string &$pseudo, string &$mdp, string &$email, &$dVueEreur) {
if (!isset($action)) {
throw new Exception('pas d\'action');
//on pourrait aussi utiliser
//$action = $_GET['action'] ?? 'no';
// This is equivalent to:
//$action = if (isset($_GET['action'])) $action=$_GET['action'] else $action='no';
}
}
static function val_form(string &$nom, string &$age, &$dVueEreur) {
int $i=0;
//Vérification Nom
if (!isset($nom)||$nom=="") { if (!isset($nom)||$nom=="") {
$dVueEreur[] = "pas de nom"; $dVueEreur[] = "pas de nom";
$nom=""; $nom="";
$i++;
}
val_string($Nom,$i,$dVueEreur);
//Vérification Prenom
if (!isset($prenom)||$prenom=="") {
$dVueEreur[] = "pas de prenom";
$pseudo="";
$i++;
}
val_string($prenom,$i,$dVueEreur);
//Vérification Email
if (!isset($email)||$email=="") {
$dVueEreur[] = "pas de email";
$pseudo="";
$i++;
} }
if ($nom != filter_var($nom, FILTER_SANITIZE_STRING)) if ($email != filter_var($email, FILTER_SANITIZE_STRING))
{ {
$dVueEreur[] = "testative d'injection de code (attaque sécurité)"; $dVueEreur[] = "testative d'injection de code (attaque sécurité)";
$nom=""; $nom="";
$i++;
}
val_string($email,$i,$dVueEreur);
//Vérification Pseudo
if (!isset($pseudo)||$pseudo=="") {
$dVueEreur[] = "pas de pseudo";
$pseudo="";
$i++;
} }
if (!isset($age)||$age==""||!filter_var($age, FILTER_VALIDATE_INT)) { val_string($pseudo,$i,$dVueEreur);
$dVueEreur[] = "pas d'age ";
$age=0; //Vérification Mot de Passe
if (!isset($mdp)||$mdp=="") {
$dVueEreur[] = "pas de mot de passe";
$mdp="";
$i++;
}
val_string($mdp,$i,$dVueEreur);
if (!preg_match('/^.{5,}$/', $mdp)) {
$dVueEreur[] = "Mot de passe trop léger : Plus de 5 caractères minimum !";
$i++;
} }
if($i>0){
return false;
}
return true;
}
static function val_string(string &$str, int &$i ,&$dVueEreur) {
if ($str != filter_var($str, FILTER_SANITIZE_STRING))
{
$dVueEreur[] = "tentative d'injection de code (attaque sécurité)";
$str="";
$i++;
}
} }
} }

@ -3,24 +3,17 @@
//gen //gen
$rep=__DIR__.'/../'; $rep=__DIR__.'/../';
// liste des modules à inclure
//$dConfig['includes']= array('controleur/Validation.php');
//BD //BD
$base="dbrahassou"; $user= 'rahassou';
$login="rahassou"; $pass='achanger';
$mdp="achanger"; $dsn='mysql:host=londres.uca.local;dbname=dbrahassou';
//Vues //Vues
$vues['inscription']='Vue/html/inscription.html'; $vues['erreur']='vues/erreur.php';
$vues['Home']='Vue/html/index.html'; $vues['inscription']='Vue/html/inscription.php';
$vues['login']='Vue/html/login.html'; $vues['ListPublic']='Vue/html/PageListPublic.php';
$vues['profil']='Vue/html/profil.html'; $vues['login']='Vue/html/login.php';
$vues['listeVue']='Vue/html/ListeVue.php'; $vues['listeVue']='Vue/html/ListeVue.php';
?> ?>

@ -7,23 +7,11 @@
//chargement config //chargement config
require_once(__DIR__.'/config/config.php'); require_once(__DIR__.'/config/config.php');
//autolarder du cours
//chargement autoloader pour autochargement des classes //chargement autoloader pour autochargement des classes
//require_once(__DIR__.'/config/Autoload.php'); require_once(__DIR__.'/config/Autoload.php');
//Autoload::charger(); Autoload::charger();
$cont = new FrontControleur();
//autoloader conforme norme PSR-0
require_once(__DIR__.'/config/SplClassLoader.php');
$myLibLoader = new SplClassLoader('Controller', './');
$myLibLoader->register();
$myLibLoader = new SplClassLoader('config', './');
$myLibLoader->register();
$myLibLoader = new SplClassLoader('Modele', './');
$myLibLoader->register();
$cont = new \Controller\Controleur();
?> ?>
Loading…
Cancel
Save