You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							32 lines
						
					
					
						
							689 B
						
					
					
				
			
		
		
	
	
							32 lines
						
					
					
						
							689 B
						
					
					
				| <?php
 | |
| 
 | |
| require_once ($_SERVER["DOCUMENT_ROOT"]."/services/bdd/connexion.php");
 | |
| 
 | |
| /*
 | |
| *Fonction d'authentification des utilisateurs.
 | |
| */
 | |
| function validationIdentifiants($pdo,$identifiant,$mdp){
 | |
| 	try {
 | |
| 		$req = 'SELECT * FROM postfix_utilisateurs WHERE utilisateur=:identifiant AND mot_de_passe=:mdp';
 | |
| 		$prep = $pdo->prepare($req);
 | |
| 		$prep->bindValue(':identifiant', $identifiant);
 | |
| 		$prep->bindValue(':mdp', $mdp);
 | |
| 		$prep->execute();
 | |
| 
 | |
| 		$result = $prep ->fetchAll(PDO::FETCH_ASSOC);
 | |
| 		$comptage = count($result);
 | |
| 
 | |
| 	}
 | |
| 	catch(PDOException $e) {
 | |
| 		die ("Erreur lors du traitement de la requête : " . $e->getMessage());
 | |
| 	}
 | |
| 
 | |
| 	if($comptage == 1){
 | |
| 		return $result;
 | |
| 	}
 | |
| 	else
 | |
| 		return false;
 | |
| }
 | |
| 
 | |
| ?>
 |