mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 11:52:20 +01:00 
			
		
		
		
	Modifications mail nouvau organisateur
This commit is contained in:
		@@ -24,6 +24,7 @@ class NewOrganizer {
 | 
			
		||||
	public $email;
 | 
			
		||||
	public $admin;
 | 
			
		||||
	public $password;
 | 
			
		||||
	public $token;
 | 
			
		||||
 | 
			
		||||
	public function __construct($data)
 | 
			
		||||
	{
 | 
			
		||||
@@ -45,10 +46,11 @@ class NewOrganizer {
 | 
			
		||||
		global $DB, $YEAR;
 | 
			
		||||
 | 
			
		||||
		$this->password = genRandomPhrase(16, true);
 | 
			
		||||
		$this->token = genRandomPhrase(64);
 | 
			
		||||
 | 
			
		||||
		$req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `surname`, `first_name`, `role`, `year`)
 | 
			
		||||
                VALUES (?, ?, ?, ?, ?, ?);");
 | 
			
		||||
		$req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->surname, $this->first_name, $this->admin ? "ADMIN" : "ORGANIZER", $YEAR]);
 | 
			
		||||
		$req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `surname`, `first_name`, `role`, `forgotten_password`, `year`)
 | 
			
		||||
                VALUES (?, ?, ?, ?, ?, ?, ?);");
 | 
			
		||||
		$req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->surname, $this->first_name, $this->admin ? "ADMIN" : "ORGANIZER", $this->token, $YEAR]);
 | 
			
		||||
 | 
			
		||||
		Mailer::sendAddOrganizerMail($this);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user