Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2021-03-04 17:04:20 +01:00
commit b40e3c4eb8
1 changed files with 41 additions and 29 deletions

View File

@ -30,7 +30,7 @@ class SecurityController extends Controller
// Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
@ -194,7 +194,7 @@ class SecurityController extends Controller
public function logoutAction() {
// Init Client CAS
\phpCAS::setDebug(false);
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true);
\phpCAS::setNoCasServerValidation();
@ -208,7 +208,7 @@ class SecurityController extends Controller
// Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
@ -258,11 +258,23 @@ class SecurityController extends Controller
}
foreach($attributes[$user_attr_cas_group] as $ssogroup) {
$basedn=$this->getParameter('ldap_basedn');
$name=$ssogroup;
if($basedn!="") {
// Si présence du basedn dans le nom du groupe = nous sommes en présence d'un DN = on récupere donc comme nom que son cn
if(stripos($name,$basedn)!==false) {
$tbname=explode(",",$name);
$tbname=explode("=",$tbname[0]);
$name=$tbname[1];
}
}
// Recherche du groupe
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["label"=>$ssogroup]);
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["label"=>$name]);
if(!$group) {
$group=new Group();
$group->setLabel($ssogroup);
$group->setLabel($name);
$group->setFgcancreatepage(false);
$group->setFgcancreateblog(false);
$group->setFgcancreatecalendar(false);