config typesso client ou proxy (fixes #32904)

This commit is contained in:
afornerot 2021-07-12 10:32:14 +02:00
parent 911bea2b5d
commit 7380823897
4 changed files with 37 additions and 7 deletions

View File

@ -88,6 +88,7 @@
<variable type='string' name='ninegate_ssoreqgroup' description="Attribut SSO associé à la notion de groupe" mandatory='True'><value>user_groups</value></variable> <variable type='string' name='ninegate_ssoreqgroup' description="Attribut SSO associé à la notion de groupe" mandatory='True'><value>user_groups</value></variable>
<variable type='oui/non' name='ninegate_ssosynchroitem' description="Associer automatiquement les items en fonction d'un attribut SSO"><value>non</value></variable> <variable type='oui/non' name='ninegate_ssosynchroitem' description="Associer automatiquement les items en fonction d'un attribut SSO"><value>non</value></variable>
<variable type='string' name='ninegate_ssoreqitem' description="Attribut SSO associé à la notion d'item" mandatory='True'><value></value></variable> <variable type='string' name='ninegate_ssoreqitem' description="Attribut SSO associé à la notion d'item" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_typesso' description="Mode de connexion SSO (Client ou Proxy)" mandatory='True'><value>client</value></variable>
<variable type='oui/non' name='ninegate_syncldap' description="Synchroniser Ninegate vers votre Annuaire CadolesLDAP"><value>non</value></variable> <variable type='oui/non' name='ninegate_syncldap' description="Synchroniser Ninegate vers votre Annuaire CadolesLDAP"><value>non</value></variable>
<variable type='string' name='ninegate_ldaptemplate' description="Modèle d'annuaire"><value>scribe</value></variable> <variable type='string' name='ninegate_ldaptemplate' description="Modèle d'annuaire"><value>scribe</value></variable>
@ -463,7 +464,8 @@
<target type='variable'>ninegate_ssoreqgroup</target> <target type='variable'>ninegate_ssoreqgroup</target>
<target type='variable'>ninegate_ssosynchroitem</target> <target type='variable'>ninegate_ssosynchroitem</target>
<target type='variable'>ninegate_ssoreqitem</target> <target type='variable'>ninegate_ssoreqitem</target>
<target type='variable'>ninegate_typesso</target>
<target type='variable'>ninegate_syncldap</target> <target type='variable'>ninegate_syncldap</target>
<target type='variable'>ninegate_ldaptemplate</target> <target type='variable'>ninegate_ldaptemplate</target>
<target type='variable'>ninegate_scribegroup</target> <target type='variable'>ninegate_scribegroup</target>
@ -562,7 +564,15 @@
<target type='variable'>ninegate_ssosynchrogroup</target> <target type='variable'>ninegate_ssosynchrogroup</target>
<target type='variable'>ninegate_ssoreqgroup</target> <target type='variable'>ninegate_ssoreqgroup</target>
<target type='variable'>ninegate_ssosynchroitem</target> <target type='variable'>ninegate_ssosynchroitem</target>
<target type='variable'>ninegate_ssoreqitem</target> <target type='variable'>ninegate_ssoreqitem</target>
</condition>
<condition name='hidden_if_in' source='ninegate_mode_auth'>
<param>SQL</param>
<param>LDAP</param>
<param>SAML</param>
<target type='variable'>ninegate_typesso</target>
</condition> </condition>
<condition name='hidden_if_in' source='ninegate_syncldap'> <condition name='hidden_if_in' source='ninegate_syncldap'>
@ -1636,6 +1646,10 @@
<param>['CAS', 'SAML', 'SQL', 'LDAP']</param> <param>['CAS', 'SAML', 'SQL', 'LDAP']</param>
</check> </check>
<check name='valid_enum' target='ninegate_typesso'>
<param>['client', 'proxy']</param>
</check>
<check name='valid_enum' target='ninegate_moderegistration'> <check name='valid_enum' target='ninegate_moderegistration'>
<param>['none', 'byuser', 'byadmin']</param> <param>['none', 'byuser', 'byadmin']</param>
</check> </check>

View File

@ -30,7 +30,10 @@ class SecurityController extends Controller
// Init Client CAS // Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log"); \phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false); if($this->getParameter("cas_type")=="client")
@\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);
else
@\phpCAS::proxy(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(); \phpCAS::setNoCasServerValidation();
@ -195,7 +198,10 @@ class SecurityController extends Controller
public function logoutAction() { public function logoutAction() {
// Init Client CAS // Init Client CAS
\phpCAS::setDebug(false); \phpCAS::setDebug(false);
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), true); if($this->getParameter("cas_type")=="client")
@\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);
else
@\phpCAS::proxy(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(); \phpCAS::setNoCasServerValidation();
@ -209,7 +215,10 @@ class SecurityController extends Controller
// Init Client CAS // Init Client CAS
\phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log"); \phpCAS::setDebug("/var/log/phpcas/phpCAS-ninegate.log");
@\phpCAS::proxy(CAS_VERSION_2_0, $this->getParameter('cas_host'), $this->getParameter('cas_port'), is_null($this->getParameter('cas_path')) ? '' : $this->getParameter('cas_path'), false); if($this->getParameter("cas_type")=="client")
@\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);
else
@\phpCAS::proxy(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(); \phpCAS::setNoCasServerValidation();
@ -297,7 +306,7 @@ class SecurityController extends Controller
} }
function imapunreadAction() { function imapunreadAction() {
if($this->getParameter("active_imapunread")) { if($this->getParameter("active_imapunread")&&$this->getParameter("cas_type")=="proxy") {
$ip=$this->getParameter("imapundread_ip"); $ip=$this->getParameter("imapundread_ip");
// Init Client CAS // Init Client CAS

View File

@ -973,7 +973,12 @@ class InitDataCommand extends ContainerAwareCommand
$entityItem->addGroup($groupall); $entityItem->addGroup($groupall);
} }
$entityItem->setUrl($widroundcube_url); $entityItem->setUrl($widroundcube_url);
$entityItem->setBadgeurl("/ninegate/cas/imapunread");
if($this->getContainer()->getParameter('cas_type')=="proxy")
$entityItem->setBadgeurl("/ninegate/cas/imapunread");
else
$entityItem->setBadgeurl(null);
$em->persist($entityItem); $em->persist($entityItem);
} }

View File

@ -540,6 +540,8 @@ parameters:
cas_host: %%eolesso_adresse cas_host: %%eolesso_adresse
cas_path: %%getVar("eolesso_cas_folder", '') cas_path: %%getVar("eolesso_cas_folder", '')
cas_port: %%eolesso_port cas_port: %%eolesso_port
cas_type: %%getVar("ninegate_typesso", 'client')
# Si mode_aut = SAML # Si mode_aut = SAML
saml_entityid: 'http://dev.nuonet.cadoles' saml_entityid: 'http://dev.nuonet.cadoles'