Пример #1
0
 static function Profile()
 {
     global $vues, $rep, $dVueErreur;
     $dataErrors = array();
     $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT * FROM User WHERE email=?', array($_SESSION['email']));
     $results = $stmt->fetchall();
     require $rep . $vues['Profile'];
 }
Пример #2
0
 public function selectAll($categ)
 {
     if (empty($categ)) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT prenom, nom, email, etat, objet, commentaire, date FROM feedback ORDER BY date DESC', array());
     } else {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT prenom, nom, email, etat, objet, commentaire, date FROM feedback WHERE etat = ? ORDER BY date DESC', array($categ));
     }
     return $resultat = $stmt->fetchall();
 }
Пример #3
0
 public static function deletePersonnage(&$dataError, $id)
 {
     $personnage = self::getPersonnageById($dataError, $id);
     if (empty($dataError)) {
         $statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('DELETE FROM Personnage WHERE id=?', array($id));
         if ($statement === false) {
             $dataError['persistance-get'] = "Probleme d'exécution de la requête.";
         }
         DataBaseManager::destroyQueryResults($statement);
     }
     return $personnage;
 }
Пример #4
0
 public static function getRoleByPassword(&$dataError, $login, $mdp)
 {
     try {
         $statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT * FROM Identifiant WHERE login=?', array($login));
     } catch (Exception $e) {
         $dataError['requete'] = "Impossible d'accéder aux données.";
     }
     if ($statement === false) {
         $dataError['login'] = "******";
         return "";
     }
     $row = $statement->fetch();
     $identifiant = IdentifiantFabrique::getIdentifiant($dataErrors, $row['login'], $row['password']);
     if ($row['password'] != $mdp) {
         $dataError['login'] = "******";
     }
     return $identifiant;
 }
Пример #5
0
 static function SavePanelAdminUsers($email, $rang, $civilite, $ddn, $ville, $rue, $cp, $tel, $mobile)
 {
     global $vues, $rep, $modeles, $dVueErreur;
     if ($rang != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET rang=? WHERE email=?', array($rang, $email));
     }
     if ($civilite != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET civilite=? WHERE email=?', array($civilite, $email));
     }
     if ($ddn != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET dateDeNaissance=? WHERE email=?', array($ddn, $email));
     }
     if ($ville != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET ville=? WHERE email=?', array($ville, $email));
     }
     if ($rue != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET rue=? WHERE email=?', array($rue, $email));
     }
     if ($cp != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET cp=? WHERE email=?', array($cp, $email));
     }
     if ($tel != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET tel=? WHERE email=?', array($tel, $email));
     }
     if ($mobile != NULL) {
         $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET mobile=? WHERE email=?', array($mobile, $email));
     }
     Self::PanelAdminUsers();
 }
Пример #6
0
<?php

if ($mdp != $mdpConfirm) {
    $dVueErreur[] = "Les mots de passe doivent être identiques.";
} else {
    if (!preg_match("/^([[:alnum:]]|[&,#,-,_,=,+]){8,30}\$/", $mdp)) {
        $dVueErreur[] = "Le mot de passe est invalide (entre 8 et 30 caractères, seuls ces caractères spéciaux &#-_+=, sont autorisés)";
    }
}
if (empty($dVueErreur)) {
    $statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('UPDATE User SET motDePasse=? WHERE email=?', array(md5($mdp), $email));
}
?>

	
	
Пример #7
0
<?php

$email = isset($_POST['email']) ? $_POST['email'] : "";
$password = isset($_POST['mdp2']) ? $_POST['mdp2'] : "";
$passwordconfirm = isset($_POST['mdp2_confirm']) ? $_POST['mdp2_confirm'] : "";
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
$password = filter_var($password, FILTER_SANITIZE_STRING);
$passwordconfirm = filter_var($passwordconfirm, FILTER_SANITIZE_STRING);
$stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT email FROM User WHERE email=?', array($email));
$results = $stmt->fetchall();
if (!preg_match("/^([a-zA-Z0-9])+([\\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\\.[a-zA-Z0-9_-]+)+/", $email)) {
    $dVueErreur[] = "L'e-mail est invalide";
} else {
    if ($results != NULL) {
        $dVueErreur[] = 'Adresse email déjà utilisée.';
    }
}
if ($password != $passwordconfirm) {
    $dVueErreur[] = "Les mots de passe doivent être identiques.";
}
if (!preg_match("/^([[:alnum:]]|[&,#,-,_,=,+]){8,30}\$/", $password)) {
    $dVueErreur[] = "Le mot de passe est invalide (entre 8 et 30 caractères, seuls ces caractères spéciaux &#-_+=, sont autorisés)";
}
if (empty($dVueErreur)) {
    $_SESSION['email'] = $email;
    $_SESSION['password'] = $password;
    require $rep . $vues['Infos_EspaceClient'];
} else {
    require $rep . $vues['EspaceClient'];
}
$stmt = null;
Пример #8
0
 static function MdpChangement($confirm, $email)
 {
     global $vues, $rep, $modeles, $dVueErreur;
     $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT motDePasse FROM User WHERE email=?', array($email));
     $results = $stmt->fetchall();
     if (md5($results[0]['motDePasse']) == $confirm) {
         require $rep . $vues['MdpChangementVue'];
     } else {
         Self::Reinit();
     }
 }
Пример #9
0
<?php

$rang = "Utilisateur";
$statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('INSERT INTO User VALUES(?,?,?,?,?,?,?,?,?,?,?,?)', array($_SESSION['email'], $rang, md5($_SESSION['password']), $civilite, $nom, $prenom, $ddn, $ville, $rue, $cp, $tel, $mobile));
if ($statement === false) {
    $dVueErreur['preparation-query'] = "Problème lors de la préparation de la requête.";
    require $rep . $vues['erreur'];
    die;
} else {
    $random = rand(10000000000000000, 99999999999999999);
    $lien = 'http://godart.xyz/index.php?action=Confirmation_Inscr&confirmation=' . $random;
    $query = 'INSERT INTO SignIn values(?,?)';
    $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery($query, array($_SESSION['email'], $random));
    $subject = 'Validation Inscription[Afials.fr]';
    $message = "<html><body><p>Bonjour <b>" . $prenom . " " . $nom . "</b> ,<br/>Merci pour votre inscription sur <b>Afials.fr</b>. Pour confirmer votre inscription, veuillez cliquer sur le lien ci-dessous:<br/><a href='" . $lien . "'>Cliquez ici.</a><br/><br/>Cordialement, L'équipe d'Afials</p></body></html>";
    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->SMTPDebug = 0;
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = 'ssl';
    $mail->Host = 'SSL0.ovh.net';
    $mail->Port = 465;
    $mail->Username = "******";
    $mail->Password = "******";
    $mail->IsHTML(true);
    $mail->CharSet = 'utf-8';
    $mail->SetFrom('*****@*****.**', 'Afials');
    $mail->Subject = $subject;
    $mail->Body = $message;
    $mail->AddAddress($_SESSION['email']);
    $res = $mail->Send();
 public static function deleteArticle(&$dataError, $id)
 {
     $article = self::getArticleById($dataError, $id);
     if (empty($dataError)) {
         $statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('DELETE FROM articles WHERE idArticle=?', array($id));
         if ($statement === false) {
             $dataError["persistance-delete"] = "Probleme d'execution de la requete";
         }
         DataBaseManager::destroyQueryResults($statement);
     }
     return $article;
 }
 public static function deleteCommentaire(&$dataError, $id)
 {
     $comm = self::getCommentaireByID($dataError, $id);
     if (empty($dataError)) {
         $statement = DataBaseManager::getInstance()->prepareAndExecuteQuery('DELETE FROM commentaire WHERE id=?', array($id));
         if ($statement === false) {
             $dataError["persistance-delete"] = "Probleme d'execution de la requete";
         }
         DataBaseManager::destroyQueryResults($statement);
     }
     return $comm;
 }
Пример #12
0
								<div class="completed-step"><a href="#"><span>1 Enregistrement</span></a></div>
								<div class="completed-step"><a href="#"><span>2 Informations</span></a></div>
								<div class="active-step"><a href="#"><span>3 Finalisation</span></a></div>
							</div>
							<div class="panel panel-default">
								<div class="panel-heading">
									<h3 class="panel-title">Confirmation Inscription</h3>
								</div>
								<div class="panel-body" style="text-align : center;">
									<p>
										<?php 
$reponse = DataBaseManager::getInstance()->prepareAndExecuteQuery('SELECT codeconfirm FROM SignIn WHERE codeconfirm=?', array($_GET['confirmation']));
if ($reponse == NULL) {
    echo "Ce lien n'existe pas.";
} else {
    $stmt = DataBaseManager::getInstance()->prepareAndExecuteQuery('DELETE FROM SignIn WHERE codeconfirm=?', array($_GET['confirmation']));
    echo 'Votre compte a été activé.' . '<br/>' . "Vous pouvez maintenant vous connecter en <a style='color: black;' href='index.php?action=EspaceClient'>cliquant ici.</a>";
}
?>
									</p>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
<?php 
$stmt = null;
$reponse = null;