From 4a57eb6a6c4f2ab742c7bef76e5331dc58eacc67 Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 21 Jan 2021 17:17:23 +0100 Subject: [PATCH] gestion synchro no mail --- src/ninesurvey-1.0/src/Controller/SecurityController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ninesurvey-1.0/src/Controller/SecurityController.php b/src/ninesurvey-1.0/src/Controller/SecurityController.php index 9ba9a88..20ecb9c 100755 --- a/src/ninesurvey-1.0/src/Controller/SecurityController.php +++ b/src/ninesurvey-1.0/src/Controller/SecurityController.php @@ -67,7 +67,6 @@ class SecurityController extends AbstractController $attributes = \phpCAS::getAttributes(); // Init - $username = ""; $email = ""; $lastname = ""; $firstname = ""; @@ -85,14 +84,13 @@ class SecurityController extends AbstractController if(isset($attributes[$this->getParameter('casFirstname')])) $firstname = $attributes[$this->getParameter('casFirstname')]; - - // Cas nomail - if(empty($email)) $email = $username."@nomail.com"; $user = $em->getRepository('App:User')->findOneBy(array("username"=>$username)); $exists = $user ? true : false; if (!$exists) { + if(empty($email)) $email = $username."@nomail.com"; + $user = new User(); $key = Uuid::uuid4();