1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 01:00:28 +02:00

Flexibilité sur la validation des vidéos accrue

This commit is contained in:
galaxyoyo
2019-09-19 00:31:53 +02:00
parent 1e67b8569d
commit 5372350f46
13 changed files with 289 additions and 17 deletions

View File

@ -41,6 +41,7 @@ class MyAccount
public $school;
public $class;
public $description;
public $receive_animath_mails;
/** @var User */
private $user;
@ -65,6 +66,7 @@ class MyAccount
ensure(filter_var($this->email, FILTER_VALIDATE_EMAIL), "L'adresse e-mail entrée est invalide.");
$this->email = strtolower($this->email);
ensure($this->email == $this->user->getEmail() || !userExists($this->email), "Un compte existe déjà avec cette adresse e-mail.");
$this->receive_animath_mails = $this->receive_animath_mails != false;
}
public function updateAccount()
@ -74,6 +76,7 @@ class MyAccount
$this->user->setSchool($this->school);
$this->user->setClass($this->class);
$this->user->setDescription($this->description);
$this->user->setReceiveAnimathMails($this->receive_animath_mails);
if ($this->email != $this->user->getEmail()) {
$this->user->setEmail($this->email);