Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'Maks3w/feature/ldap-documentation'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/Dn.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public static function setDefaultCaseFold($caseFold)
* Sanitizes the case fold
*
* @param string $caseFold
* @param string $default
* @return string
*/
protected static function sanitizeCaseFold($caseFold, $default)
Expand Down Expand Up @@ -693,7 +694,7 @@ public static function checkDn(
* This method supports the creation of multi-valued RDNs
* $part must contain an even number of elemets.
*
* @param array $attribute
* @param array $part
* @param string $caseFold
* @return string
* @throws Exception\LdapException
Expand All @@ -709,6 +710,7 @@ public static function implodeRdn(array $part, $caseFold = null)
$rdnParts[$keyId] = implode('=', array($key, $value));
}
ksort($rdnParts, SORT_STRING);

return implode('+', $rdnParts);
}

Expand Down Expand Up @@ -752,18 +754,17 @@ public static function isChildOf($childDn, $parentDn)
try {
$keys = array();
$vals = array();
if ($childDn instanceof DN) {
if ($childDn instanceof Dn) {
$cdn = $childDn->toArray(DN::ATTR_CASEFOLD_LOWER);
} else {
$cdn = self::explodeDn($childDn, $keys, $vals, DN::ATTR_CASEFOLD_LOWER);
}
if ($parentDn instanceof DN) {
if ($parentDn instanceof Dn) {
$pdn = $parentDn->toArray(DN::ATTR_CASEFOLD_LOWER);
} else {
$pdn = self::explodeDn($parentDn, $keys, $vals, DN::ATTR_CASEFOLD_LOWER);
}
}
catch (Exception\LdapException $e) {
} catch (Exception\LdapException $e) {
return false;
}

Expand Down
9 changes: 6 additions & 3 deletions src/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ protected function getNetworkTimeout()
}

/**
* @param strint $acctname
* @return string The LDAP search filter for matching directory accounts
*/
protected function getAccountFilter($acctname)
Expand Down Expand Up @@ -543,7 +544,7 @@ protected function isPossibleAuthority($dname)

/**
* @param string $acctname The name to canonicalize
* @param int $type The desired form of canonicalization
* @param int $form The desired form of canonicalization
* @return string The canonicalized name in the desired form
* @throws Exception\LdapException
*/
Expand Down Expand Up @@ -597,8 +598,9 @@ public function getCanonicalAccountName($acctname, $form = 0)
}

/**
* @param array $attrs An array of names of desired attributes
* @return array An array of the attributes representing the account
* @param string $acctname
* @param array $attrs An array of names of desired attributes
* @return array An array of the attributes representing the account
* @throws Exception\LdapException
*/
protected function getAccount($acctname, array $attrs = null)
Expand All @@ -622,6 +624,7 @@ protected function getAccount($acctname, array $attrs = null)
if ($count === 1) {
$acct = $accounts->getFirst();
$accounts->close();

return $acct;
} else {
if ($count === 0) {
Expand Down

0 comments on commit ac3ef2c

Please sign in to comment.