From 1d448e70c780f3c537e1eae6beefc8bc91acebf1 Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 14 Sep 2021 11:40:18 +0200 Subject: [PATCH] autocreate user (fixes #33139) --- .../CASBundle/Controller/SecurityController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php b/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php index e3c0412c..df130cd7 100644 --- a/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php +++ b/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php @@ -78,7 +78,9 @@ class SecurityController extends Controller if($masteridentity=="LDAP") { // Normalement la synchronisation des comptes aurait du générer le compte en base c'est donc pas normal // Peut-être juste relancer une synchronisation - throw $this->createNotFoundException('Permission denied. Need to synchronize LDAP ? Contact your administrator'); + // On tente une synchronisation via methode SSO + $masteridentity="SSO"; + // throw $this->createNotFoundException('Permission denied. Need to synchronize LDAP ? Contact your administrator'); } if($masteridentity=="SSO") { @@ -89,8 +91,10 @@ class SecurityController extends Controller // On calcule le niveau01 de l'utilisateur $niveau01=$em->getRepository('CadolesCoreBundle:Niveau01')->calculateNiveau01($attributes); - if(!$niveau01) - throw $this->createNotFoundException('Permission denied. No Organisation Niveau 01 match'); + if(!$niveau01) { + $niveau01=$em->getRepository('CadolesCoreBundle:Niveau01')->findAll()[0]; + //throw $this->createNotFoundException('Permission denied. No Organisation Niveau 01 match'); + } $user->setUsername($username); $user->setEmail($email);