1
0
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:
Yohann
2019-10-04 22:36:23 +02:00
parent 7eba8b542b
commit 57b8f7bdfe
13 changed files with 142 additions and 43 deletions

View File

@ -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);
}