@ -138,7 +138,7 @@ class Access extends LDAPUtility {
if(is_array($dn)) {
$result = array();
foreach($dn as $singleDN) {
$result[] = $this->sanitizeDN($singleDN);
$result[] = $this->sanitizeDN($singleDN);
}
return $result;
}
@ -383,7 +383,7 @@ class Access extends LDAPUtility {
}
/**
* @param $dn
* @param string $dn
* @return bool|string
*/
private function findMappedUser($dn) {
@ -403,7 +403,7 @@ class Access extends LDAPUtility {
}
/**
* @param $dn
* @param string $dn
* @return bool|string
*/
private function findMappedGroup($dn) {
@ -630,8 +630,8 @@ class Access extends LDAPUtility {
}
/**
* @param $filter
* @param $attr
* @param string $filter
* @param string|string[] $attr
* @param int $limit
* @param int $offset
* @return array
@ -641,8 +641,8 @@ class Access extends LDAPUtility {
}
/**
* @param $filter
* @param $attr
* @param string $filter
* @param string|string[] $attr
* @param int $limit
* @param int $offset
* @return array
@ -652,7 +652,7 @@ class Access extends LDAPUtility {
}
/**
* @param $list
* @param array $list
* @param bool $manyAttributes
* @return array
*/
@ -672,7 +672,7 @@ class Access extends LDAPUtility {
/**
* @brief executes an LDAP search, optimized for Users
* @param string $filter the LDAP filter for the search
* @param string $attr optional, when a certain attribute shall be filtered out
* @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @return array with the search result
@ -685,7 +685,7 @@ class Access extends LDAPUtility {
/**
* @param string $filter
* @param array $attr
* @param string|string[] $attr
* @param int $limit
* @param int $offset
* @return false|int
@ -697,7 +697,7 @@ class Access extends LDAPUtility {
/**
* @brief executes an LDAP search, optimized for Groups
* @param string $filter the LDAP filter for the search
* @param string $attr optional, when a certain attribute shall be filtered out
* @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @return array with the search result
@ -712,7 +712,7 @@ class Access extends LDAPUtility {
* @brief prepares and executes an LDAP search operation
* @param string $filter the LDAP filter for the search
* @param array $base an array containing the LDAP subtree(s) that shall be searched
* @param array $attr optional, array, one or more attributes that shall be
* @param string|string[] $attr optional, array, one or more attributes that shall be
* retrieved. Results will according to the order in the array.
* @param int $limit optional, maximum results to be counted
* @param int $offset optional, a starting point
@ -799,7 +799,7 @@ class Access extends LDAPUtility {
* @brief executes an LDAP search, but counts the results only
* @param string $filter the LDAP filter for the search
* @param array $base an array containing the LDAP subtree(s) that shall be searched
* @param array $attr optional, array, one or more attributes that shall be
* @param string|string[] $attr optional, array, one or more attributes that shall be
* retrieved. Results will according to the order in the array.
* @param int $limit optional, maximum results to be counted
* @param int $offset optional, a starting point
@ -840,9 +840,9 @@ class Access extends LDAPUtility {
}
/**
* @param $searchResults
* @param $limit
* @param $hasHitLimit
* @param array $searchResults
* @param int $limit
* @param bool $hasHitLimit
* @return int
*/
private function countEntriesInSearchResults($searchResults, $limit, & $hasHitLimit) {
@ -864,7 +864,7 @@ class Access extends LDAPUtility {
* @brief Executes an LDAP search
* @param string $filter the LDAP filter for the search
* @param array $base an array containing the LDAP subtree(s) that shall be searched
* @param array $attr optional, array, one or more attributes that shall be
* @param string|string[] $attr optional, array, one or more attributes that shall be
* @param int $limit
* @param int $offset
* @param bool $skipHandling
@ -897,7 +897,7 @@ class Access extends LDAPUtility {
$findings = array();
foreach($sr as $res) {
$findings = array_merge($findings, $this->ldap->getEntries($cr , $res ));
$findings = array_merge($findings, $this->ldap->getEntries($cr , $res ));
}
$this->processPagedSearchStatus($sr, $filter, $base, $findings['count'],
@ -969,7 +969,7 @@ class Access extends LDAPUtility {
}
/**
* @param $name
* @param string $name
* @return bool|mixed|string
*/
public function sanitizeUsername($name) {
@ -1003,7 +1003,7 @@ class Access extends LDAPUtility {
/**
* @brief combines the input filters with AND
* @param $filters array, the filters to connect
* @param string[] $filters the filters to connect
* @return string the combined filter
*/
public function combineFilterWithAnd($filters) {
@ -1012,7 +1012,7 @@ class Access extends LDAPUtility {
/**
* @brief combines the input filters with AND
* @param $filters array, the filters to connect
* @param string[] $filters the filters to connect
* @return string the combined filter
*/
public function combineFilterWithOr($filters) {
@ -1021,17 +1021,17 @@ class Access extends LDAPUtility {
/**
* @brief combines the input filters with given operator
* @param $filters array, the filters to connect
* @param string[] $filters the filters to connect
* @param string $operator either & or |
* @return string the combined filter
*/
private function combineFilter($filters, $operator) {
$combinedFilter = '('.$operator;
foreach($filters as $filter) {
if(!empty($filter) & & $filter[0] !== '(') {
if(!empty($filter) & & $filter[0] !== '(') {
$filter = '('.$filter.')';
}
$combinedFilter.=$filter;
}
$combinedFilter.=$filter;
}
$combinedFilter.=')';
return $combinedFilter;
@ -1062,7 +1062,7 @@ class Access extends LDAPUtility {
/**
* @brief creates a filter part for searches
* @param string $search the search term
* @param $searchAttributes
* @param string[]|null $searchAttributes
* @param string $fallbackAttribute a fallback attribute in case the user
* did not define search attributes. Typically the display name attribute.
* @return string the final filter part to use in LDAP searches
@ -1152,7 +1152,7 @@ class Access extends LDAPUtility {
}
/**
* @param $dn
* @param string $dn
* @param bool $isUser
* @return array|bool|false
*/
@ -1220,7 +1220,7 @@ class Access extends LDAPUtility {
/**
* @brief checks if the given DN is part of the given base DN(s)
* @param string $dn the DN
* @param $bases array containing the allowed base DN or DNs
* @param string[] $bases array containing the allowed base DN or DNs
* @return bool
*/
private function isDNPartOfBase($dn, $bases) {
@ -1293,8 +1293,8 @@ class Access extends LDAPUtility {
/**
* @brief Prepares a paged search, if possible
* @param string $filter the LDAP filter for the search
* @param array $bases an array containing the LDAP subtree(s) that shall be searched
* @param array $attr optional, when a certain attribute shall be filtered outside
* @param string[] $bases an array containing the LDAP subtree(s) that shall be searched
* @param string[] $attr optional, when a certain attribute shall be filtered outside
* @param int $limit
* @param int $offset
* @return bool|true