profilePath AD

This commit is contained in:
afornerot 2021-01-25 15:02:11 +01:00
parent 92477123b7
commit e82d932cfb
4 changed files with 21 additions and 13 deletions

View File

@ -102,7 +102,8 @@
<variable type='string' name='ninegate_openldapsubbranchuser' description="Rechercher les utilisateurs dans la sous-branche" mandatory='False' />
<variable type='string' name='ninegate_ldaptype' description="Annuaire Cadoles LDAP ou AD " mandatory='True'><value>LDAP</value></variable>
<variable type='string' name='ninegate_addomaine' description="Nom de votre domaine AD" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_addomainehome' description="Nom de votre domaine AD Home" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_addomaineprofil' description="Nom de votre domaine AD Profil" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_pwdadmin' description="Mot de passe du compte admin durant l'instance (idem valeur Cadoles ldap)" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_organization' description="Nom de l'organisation principale (idem valeur Cadoles ldap)" mandatory='True'><value></value></variable>
<variable type='string' name='ninegate_niveau01branche' description="Nom de la branche de Niveau 01 (idem valeur Cadoles ldap)" mandatory='True'><value>niveau01</value></variable>
@ -694,7 +695,8 @@
<condition name='hidden_if_not_in' source='ninegate_ldaptype'>
<param>AD</param>
<target type='variable'>ninegate_addomaine</target>
<target type='variable'>ninegate_addomainehome</target>
<target type='variable'>ninegate_addomaineprofil</target>
</condition>
<!-- AFFICHAGE EN FONCTION DU MODULE PORTAL -->

View File

@ -109,7 +109,8 @@ services:
- %ldap_port%
- %ldap_tls%
- %ldap_type%
- %ldap_addomaine%
- %ldap_addomainehome%
- %ldap_addomaineprofil%
calls:
- [setUser, ["%ldap_user%"]]
- [setPassword, ["%ldap_password%"]]

View File

@ -15,7 +15,8 @@ class ldapService
protected $port;
protected $tls;
protected $type;
protected $addomaine;
protected $addomainehome;
protected $addomaineprofil;
protected $baseDN;
protected $baseUser;
@ -29,13 +30,14 @@ class ldapService
private $connection = null;
private $ldapSync = false;
public function __construct($host, $port, $tls, $type, $addomaine)
public function __construct($host, $port, $tls, $type, $addomainehome, $addomaineprofil)
{
$this->host = $host;
$this->port = $port;
$this->tls = $tls;
$this->type = $type;
$this->addomaine = $addomaine;
$this->host = $host;
$this->port = $port;
$this->tls = $tls;
$this->type = $type;
$this->addomainehome = $addomainehome;
$this->addomaineprofil = $addomaineprofil;
}
public function isEnabled() {
@ -316,7 +318,8 @@ class ldapService
$attrs['sAMAccountName'] = $user->getUsername();
$attrs["userAccountControl"] = 544;
$attrs["homeDrive"] = "U:";
$attrs["homeDirectory"] = "\\\\".$this->addomaine."\\".$user->getUsername();
$attrs["homeDirectory"] = "\\\\".$this->addomainehome."\\".$user->getUsername();
$attrs["profilePath"] = "\\\\".$this->addomaineprofil."\\profiles\\".$user->getUsername();
}
$attrs['givenName'] = $user->getFirstname();

View File

@ -136,9 +136,11 @@ parameters:
%end if
ldap_basedn: %%ldap_base_dn
%if %%getVar("ninegate_ldaptype", 'LDAP') == "AD"
ldap_addomaine: %%ninegate_addomaine
ldap_addomainehome: %%ninegate_addomainehome
ldap_addomaineprofil: %%ninegate_addomaineprofil
%else
ldap_addomaine:
ldap_addomainehome:
ldap_addomaineprofil:
%end if
# Mise en page