gestion synchro no mail
This commit is contained in:
parent
d883e3453c
commit
a5a57cc9e0
@ -214,6 +214,7 @@ class SynchroUsersCommand extends Command
|
||||
$result[$ldap_username]=utf8_encode($result[$ldap_username]);
|
||||
if(!isset($result[$ldap_lastname])) $result[$ldap_lastname] = "";
|
||||
if(!isset($result[$ldap_firstname])) $result[$ldap_firstname] = "";
|
||||
if(!array_key_exists($ldap_email,$result)||empty($result[$ldap_email])) $result[$ldap_email]=$result[$ldap_username]."@nomail.fr";
|
||||
$result[$ldap_email]=strtolower($result[$ldap_email]);
|
||||
$result[$ldap_email]=utf8_encode($result[$ldap_email]);
|
||||
|
||||
@ -246,7 +247,7 @@ class SynchroUsersCommand extends Command
|
||||
|
||||
if($user->getLastname()!=$result[$ldap_lastname]||$user->getFirstname()!=$result[$ldap_firstname]||$user->getEmail()!=$result[$ldap_email]||$toadmin) {
|
||||
$usermail=$this->em->getRepository('App:User')->findOneBy(array('email' => $result[$ldap_email]));
|
||||
if($usermail!=$user) {
|
||||
if($usermail&&$usermail!=$user) {
|
||||
array_push($tberrors," - Modification dans Bundle impossible >> ".$result[$ldap_username]." un autre utilisateur a déjà ce mail = ".$result[$ldap_email]);
|
||||
}
|
||||
else {
|
||||
|
@ -66,6 +66,12 @@ class SecurityController extends AbstractController
|
||||
// Récupération Attribut
|
||||
$attributes = \phpCAS::getAttributes();
|
||||
|
||||
// Init
|
||||
$username = "";
|
||||
$email = "";
|
||||
$lastname = "";
|
||||
$firstname = "";
|
||||
|
||||
// Rechercher l'utilisateur
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
if(isset($attributes[$this->getParameter('casUsername')]))
|
||||
@ -80,6 +86,9 @@ 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user