Skip to content

Commit

Permalink
feat(register): Set the user type
Browse files Browse the repository at this point in the history
  • Loading branch information
fxleblanc committed Feb 25, 2016
1 parent 81ce02c commit 089ded5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ public function registerProfessor()

if ($this->request->is('post')) {
$user = $this->Users->patchEntity($user, $this->request->data);
$user->isProfessor = true;

if ($user->errors()) {
$this->Flash->error(__('Your informations are invalid. Please try again later or contact us if the problem persists'));
Expand Down Expand Up @@ -400,6 +401,7 @@ public function registerStudent()
$user->editPassword($this->request->data['password']);
$user->editEmailPublic($this->request->data['email']);
$user->editMailingList(true);
$user->isStudent = true;

if ($this->Users->save($user)) {
// Redirect to optional information page
Expand Down

0 comments on commit 089ded5

Please sign in to comment.