gestion des no email

This commit is contained in:
afornerot 2021-01-21 17:24:21 +01:00
parent 69af156662
commit f77be05751
1 changed files with 2 additions and 4 deletions

View File

@ -44,7 +44,6 @@ class SecurityController extends Controller
$attributes = \phpCAS::getAttributes();
// Init
$username = "";
$email = "";
$lastname = "";
$firstname = "";
@ -63,9 +62,6 @@ class SecurityController extends Controller
if(isset($attributes[$this->getParameter('user_attr_cas_firstname')]))
$firstname = $attributes[$this->getParameter('user_attr_cas_firstname')];
// Cas nomail
if(empty($email)) $email = $username."@nomail.com";
$user = $em->getRepository('CadolesCoreBundle:User')->findOneBy(array("username"=>$username));
$exists = $user ? true : false;
@ -83,6 +79,8 @@ class SecurityController extends Controller
}
if($masteridentity=="SSO") {
if(empty($email)) $email = $username."@nomail.com";
// Là c'est normal que potentiellement il n'existe pas il faut donc l'autogénérer
$user = new User();