mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 18:17:24 +02:00
Nombreux changements mineurs
This commit is contained in:
@ -22,6 +22,8 @@ class NewUser
|
||||
public $surname;
|
||||
public $role;
|
||||
public $school;
|
||||
public $city;
|
||||
public $country;
|
||||
public $class;
|
||||
public $receive_animath_mails;
|
||||
|
||||
@ -66,10 +68,12 @@ class NewUser
|
||||
if (!$DB->query("SELECT `id` FROM `users` WHERE `year` = $YEAR;")->fetch())
|
||||
$this->role = Role::ADMIN;
|
||||
|
||||
$req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `confirm_email`, `surname`, `first_name`, `school`, `class`, `role`, `description`, `receive_animath_mails`, `year`)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
|
||||
$req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->confirm_email_token, $this->surname, $this->first_name,
|
||||
$this->school, SchoolClass::getName($this->class), Role::getName($this->role), $this->description, $this->receive_animath_mails, $YEAR]);
|
||||
$req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `confirm_email`, `surname`, `first_name`,
|
||||
`school`, `city`, `country`, `class`, `role`, `description`, `receive_animath_mails`, `year`)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
|
||||
$req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->confirm_email_token,
|
||||
$this->surname, $this->first_name, $this->school, $this->city, $this->country, SchoolClass::getName($this->class),
|
||||
Role::getName($this->role), $this->description, $this->receive_animath_mails, $YEAR]);
|
||||
|
||||
Mailer::sendRegisterMail($this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user