mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
LSsearch::getHash(): fix handling onlyAccessible parameter
This commit is contained in:
parent
11c2e3c9d4
commit
c4dc2a0441
1 changed files with 11 additions and 5 deletions
|
@ -972,10 +972,11 @@ class LSsearch extends LSlog_staticLoggerClass {
|
|||
* Return an hash corresponding to the parameters of the search
|
||||
*
|
||||
* @param[in] $searchParams array An optional search params array
|
||||
* @param[in] $onlyAccessible boolean An optional onlyAccessible boolean flag
|
||||
*
|
||||
* @retval string The hash of the parameters of the search
|
||||
**/
|
||||
public function getHash($searchParams=null) {
|
||||
public function getHash($searchParams=null, $onlyAccessible=null) {
|
||||
if (is_null($searchParams)) {
|
||||
$searchParams = $this -> _searchParams;
|
||||
}
|
||||
|
@ -984,6 +985,11 @@ class LSsearch extends LSlog_staticLoggerClass {
|
|||
if ($searchParams['filter'] instanceof Net_LDAP_Filter) {
|
||||
$searchParams['filter'] = $searchParams['filter'] -> asString();
|
||||
}
|
||||
$to_hash = print_r($searchParams, true);
|
||||
if (is_null($onlyAccessible)) {
|
||||
$onlyAccessible = ($this -> getParam('onlyAccessible') && LSsession :: getLSuserObjectDn());
|
||||
}
|
||||
$to_hash .= '-onlyAccessible='.intval($onlyAccessible);
|
||||
return hash('md5', print_r($searchParams, true));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue