Loading README.md +1 −0 Original line number Diff line number Diff line Loading @@ -38,5 +38,6 @@ $ cp -n vendor/unicaen/zimbra/config/unicaen-ldap.local.php.dist config/autoload 'username' => "uid=xxxx,ou=system,dc=unicaen,dc=fr", 'password' => "xxxx", 'accountFilterFormat' => "(&(objectClass=supannPerson)(supannAliasLogin=%s))", 'useStartTls' => false ] ``` No newline at end of file config/unicaen-ldap.local.php.dist +1 −0 Original line number Diff line number Diff line Loading @@ -10,5 +10,6 @@ return [ 'username' => "uid=xxxxxxxxx,ou=xxxxxxxxxx,dc=domain,dc=fr", 'password' => "xxxxxxxxxxxx", 'accountFilterFormat' => "(&(objectClass=posixAccount)(supannAliasLogin=%s))", 'useStartTls' => false ] ]; src/UnicaenLdap/Entity/Base/People.php +2 −2 Original line number Diff line number Diff line Loading @@ -2215,7 +2215,7 @@ class People extends Entity $uni = ''; $value = (string)$value; for ($i = 0; $i < strlen($value); $i++) { $a = ord($value{$i}) << 8; $a = ord($value[$i]) << 8; $uni .= sprintf('%X', $a); } $nthash = hash("md4", pack('H*', $uni), true); Loading @@ -2238,7 +2238,7 @@ class People extends Entity $uni = ''; $value = (string)$value; for ($i = 0; $i < strlen($value); $i++) { $a = ord($value{$i}) << 8; $a = ord($value[$i]) << 8; $uni .= sprintf('%X', $a); } $nthash = hash("md4", pack('H*', $uni), true); Loading src/UnicaenLdap/Options/ModuleOptions.php +26 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ class ModuleOptions extends AbstractOptions */ protected $accountFilterFormat; /** * @var bool */ protected $useStartTls; public function getIterator() { return new \ArrayIterator($this); Loading Loading @@ -244,7 +249,25 @@ class ModuleOptions extends AbstractOptions */ public function setAccountFilterFormat($accountFilterFormat) { $this->accountFilterFormat = (boolean)$accountFilterFormat; $this->accountFilterFormat = (string)$accountFilterFormat; return $this; } /** * @return bool */ public function getUseStartTls(): ?bool { return $this->useStartTls; } /** * @param bool $useStartTls * @return $this */ public function setUseStartTls(bool $useStartTls): ModuleOptions { $this->useStartTls = $useStartTls; return $this; } Loading @@ -262,6 +285,7 @@ class ModuleOptions extends AbstractOptions 'password' => $this->getPassword(), 'bindRequiresDn' => $this->getBindRequiresDn(), 'baseDn' => $this->getBaseDn(), 'useStartTls' => $this->getUseStartTls(), ); } } No newline at end of file src/UnicaenLdap/Service/AbstractService.php +7 −7 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ abstract class AbstractService implements $filter = $ouFilter . ")$filter)"; } $resource = $this->getLdap()->getResource(); ErrorHandler::start(E_WARNING); if (null === $attributes) $search = ldap_search($resource, $basedn, $filter); else $search = ldap_search($resource, $basedn, $filter, $attributes); ErrorHandler::stop(); if ($search === false) { throw new Exception('searching: ' . $filter); } Loading @@ -324,20 +326,19 @@ abstract class AbstractService implements /** * Retourne un tableau d'attributs * * @param resource $resource * @param resource|\Ldap\Connection $resource * @param resource $entry * @return null|array * @desc depuis php 8.1 $resource est de type Ldap\Connection */ private function __getEntryAttributes($resource, $entry) { if (!is_resource($resource)) { if (!is_resource($resource) && !($resource instanceof \Ldap\Connection)) { return null; } $berIdentifier = null; $name = ldap_first_attribute( $resource, $entry, $berIdentifier $resource, $entry ); $attributes = array(); Loading @@ -359,8 +360,7 @@ abstract class AbstractService implements $attributes[$attrName] = $data; $name = ldap_next_attribute( $resource, $entry, $berIdentifier $resource, $entry ); } ksort($attributes, SORT_LOCALE_STRING); Loading Loading
README.md +1 −0 Original line number Diff line number Diff line Loading @@ -38,5 +38,6 @@ $ cp -n vendor/unicaen/zimbra/config/unicaen-ldap.local.php.dist config/autoload 'username' => "uid=xxxx,ou=system,dc=unicaen,dc=fr", 'password' => "xxxx", 'accountFilterFormat' => "(&(objectClass=supannPerson)(supannAliasLogin=%s))", 'useStartTls' => false ] ``` No newline at end of file
config/unicaen-ldap.local.php.dist +1 −0 Original line number Diff line number Diff line Loading @@ -10,5 +10,6 @@ return [ 'username' => "uid=xxxxxxxxx,ou=xxxxxxxxxx,dc=domain,dc=fr", 'password' => "xxxxxxxxxxxx", 'accountFilterFormat' => "(&(objectClass=posixAccount)(supannAliasLogin=%s))", 'useStartTls' => false ] ];
src/UnicaenLdap/Entity/Base/People.php +2 −2 Original line number Diff line number Diff line Loading @@ -2215,7 +2215,7 @@ class People extends Entity $uni = ''; $value = (string)$value; for ($i = 0; $i < strlen($value); $i++) { $a = ord($value{$i}) << 8; $a = ord($value[$i]) << 8; $uni .= sprintf('%X', $a); } $nthash = hash("md4", pack('H*', $uni), true); Loading @@ -2238,7 +2238,7 @@ class People extends Entity $uni = ''; $value = (string)$value; for ($i = 0; $i < strlen($value); $i++) { $a = ord($value{$i}) << 8; $a = ord($value[$i]) << 8; $uni .= sprintf('%X', $a); } $nthash = hash("md4", pack('H*', $uni), true); Loading
src/UnicaenLdap/Options/ModuleOptions.php +26 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,11 @@ class ModuleOptions extends AbstractOptions */ protected $accountFilterFormat; /** * @var bool */ protected $useStartTls; public function getIterator() { return new \ArrayIterator($this); Loading Loading @@ -244,7 +249,25 @@ class ModuleOptions extends AbstractOptions */ public function setAccountFilterFormat($accountFilterFormat) { $this->accountFilterFormat = (boolean)$accountFilterFormat; $this->accountFilterFormat = (string)$accountFilterFormat; return $this; } /** * @return bool */ public function getUseStartTls(): ?bool { return $this->useStartTls; } /** * @param bool $useStartTls * @return $this */ public function setUseStartTls(bool $useStartTls): ModuleOptions { $this->useStartTls = $useStartTls; return $this; } Loading @@ -262,6 +285,7 @@ class ModuleOptions extends AbstractOptions 'password' => $this->getPassword(), 'bindRequiresDn' => $this->getBindRequiresDn(), 'baseDn' => $this->getBaseDn(), 'useStartTls' => $this->getUseStartTls(), ); } } No newline at end of file
src/UnicaenLdap/Service/AbstractService.php +7 −7 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ abstract class AbstractService implements $filter = $ouFilter . ")$filter)"; } $resource = $this->getLdap()->getResource(); ErrorHandler::start(E_WARNING); if (null === $attributes) $search = ldap_search($resource, $basedn, $filter); else $search = ldap_search($resource, $basedn, $filter, $attributes); ErrorHandler::stop(); if ($search === false) { throw new Exception('searching: ' . $filter); } Loading @@ -324,20 +326,19 @@ abstract class AbstractService implements /** * Retourne un tableau d'attributs * * @param resource $resource * @param resource|\Ldap\Connection $resource * @param resource $entry * @return null|array * @desc depuis php 8.1 $resource est de type Ldap\Connection */ private function __getEntryAttributes($resource, $entry) { if (!is_resource($resource)) { if (!is_resource($resource) && !($resource instanceof \Ldap\Connection)) { return null; } $berIdentifier = null; $name = ldap_first_attribute( $resource, $entry, $berIdentifier $resource, $entry ); $attributes = array(); Loading @@ -359,8 +360,7 @@ abstract class AbstractService implements $attributes[$attrName] = $data; $name = ldap_next_attribute( $resource, $entry, $berIdentifier $resource, $entry ); } ksort($attributes, SORT_LOCALE_STRING); Loading