Browse Source

[backend] Création utilisateur : liaison établissement si l'utilisateur existe

refactoring
Guillaume 4 years ago
parent
commit
38a2fa9273
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      backend/controllers/UserController.php

+ 8
- 3
backend/controllers/UserController.php View File

@@ -155,9 +155,14 @@ class UserController extends BackendController
{
$model = new User();

$userExist = User::searchOne([
'email' => Yii::$app->request->post('email')
]);
$userExist = false ;
$posts = Yii::$app->request->post() ;

if($posts) {
$userExist = User::searchOne([
'email' => $posts['User']['email']
]);
}

if ($userExist) {
Producer::addUser($userExist->id, GlobalParam::getCurrentProducerId()) ;

Loading…
Cancel
Save