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

Commit

Permalink
Admin search engine was getting the shared children of every results …
Browse files Browse the repository at this point in the history
…(for users), thus returning useless results. Change AuthService::listUsers() to not load children if query is not really paginated ( offset or limit different from -1).
  • Loading branch information
cdujeu committed Nov 27, 2014
1 parent 8d6e7ca commit 7812bd2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/core/classes/class.AuthService.php
Expand Up @@ -976,7 +976,7 @@ public static function listUsers($baseGroup = "/", $regexp = null, $offset = -1,
$paginated = false;
if (($regexp != null || $offset != -1 || $limit != -1) && $authDriver->supportsUsersPagination()) {
$users = $authDriver->listUsersPaginated($baseGroup, $regexp, $offset, $limit, $recursive);
$paginated = true;
$paginated = ($offset != -1 || $limit != -1);
} else {
$users = $authDriver->listUsers($baseGroup);
}
Expand Down
Expand Up @@ -262,7 +262,6 @@ public function searchAction($action, $httpVars, $fileVars)
if(! AJXP_Utils::decodeSecureMagic($httpVars["dir"]) == "/data/users") return;
$query = AJXP_Utils::decodeSecureMagic($httpVars["query"]);
AJXP_XMLWriter::header();

$this->recursiveSearchGroups("/", $query);
AJXP_XMLWriter::close();

Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/auth.sql/class.sqlAuthDriver.php
Expand Up @@ -74,7 +74,7 @@ public function listUsersPaginated($baseGroup, $regexp, $offset, $limit, $recurs
$res = dibi::query("SELECT * FROM [ajxp_users] AS u WHERE $groupPathCondition AND $ignoreHiddens ORDER BY [login] ASC", $baseGroup);
}
$pairs = $res->fetchPairs('login', 'password');
return $pairs;
return $pairs;
}

public function findUserPage($baseGroup, $userLogin, $usersPerPage, $offset){
Expand Down

0 comments on commit 7812bd2

Please sign in to comment.