app ldap connect

This commit is contained in:
2023-07-20 14:53:57 +02:00
parent c6cce8700e
commit 41e11123da
14 changed files with 353 additions and 24 deletions

View File

@ -347,6 +347,28 @@ class LdapService
// == Function User==================================================================================================================================================
// ==================================================================================================================================================================
public function fixtureUser(User $user,$dn)
{
$connection = $this->connect();
$attrs = [];
$attrs['objectclass'] = $this->getObjectClassesUser();
$this->fillAttributesUser($user, $attrs);
foreach ($attrs as $key => $value) {
if (empty($value)) {
unset($attrs[$key]);
}
}
$result = ldap_add($connection, $dn, $attrs);
if (!$result) {
$this->ldapError();
}
return $result;
}
public function addUser(User $user)
{
$connection = $this->connect();
@ -643,8 +665,6 @@ class LdapService
$attrs['sn'] = $user->getLastname();
$attrs['mail'] = $user->getEmail();
$attrs['displayname'] = $user->getFirstname().' '.$user->getLastname();
$attrs['telephonenumber'] = $user->getTelephonenumber();
$attrs['postaladdress'] = $user->getPostaladress();
$attrs['userpassword'] = $user->getPassword();
}