mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 15:22:26 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			726 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			726 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
include 'config.php';
 | 
						|
 | 
						|
$token = $_GET["token"];
 | 
						|
 | 
						|
if (isset($token)) {
 | 
						|
    $result = $DB->query("SELECT `email` FROM `users` WHERE `confirm_email` = '$token' AND `year` = '$YEAR';");
 | 
						|
    if (($data = $result->fetch()) === FALSE)
 | 
						|
        $error_message = "Le jeton est invalide. Votre compte est peut-être déjà validé ?";
 | 
						|
    else {
 | 
						|
        $DB->exec("UPDATE `users` SET `confirm_email` = NULL WHERE `confirm_email` = '$token';");
 | 
						|
        $error_message = "Votre adresse mail a été validée ! Vous pouvez désormais vous connecter.";
 | 
						|
    }
 | 
						|
}
 | 
						|
else {
 | 
						|
    $error_message = "Il n'y a pas de compte à valider !";
 | 
						|
}
 | 
						|
 | 
						|
?>
 | 
						|
 | 
						|
<?php include "header.php" ?>
 | 
						|
 | 
						|
<h2><?php echo $error_message ?></h2>
 | 
						|
 | 
						|
<?php include "footer.php" ?>
 |