summaryrefslogtreecommitdiff
path: root/lib/Auth/LDAP.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Auth/LDAP.php')
-rw-r--r--lib/Auth/LDAP.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 6d13a6c..bf02ba1 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -1304,21 +1304,18 @@ class LDAP extends Net_LDAP3 {
}
if (!empty($params) && is_array($params)) {
- if (array_key_exists('sort_by', $params)) {
+ if (!empty($params['sort_by'])) {
$this->sort_result_key = $params['sort_by'];
uasort($entries, array($this, 'sort_result'));
}
- if (array_key_exists('page_size', $params) && array_key_exists('page', $params)) {
- if ($result->count() > $params['page_size']) {
- $entries = array_slice($entries, (($params['page'] - 1) * $params['page_size']), $params['page_size'], true);
- }
-
+ if (!empty($params['sort_order']) && $params['sort_order'] == "DESC") {
+ $entries = array_reverse($entries, true);
}
- if (array_key_exists('sort_order', $params) && !empty($params['sort_order'])) {
- if ($params['sort_order'] == "DESC") {
- $entries = array_reverse($entries, true);
+ if (!empty($params['page_size']) && !empty($params['page'])) {
+ if ($result->count() > $params['page_size']) {
+ $entries = array_slice($entries, (($params['page'] - 1) * $params['page_size']), $params['page_size'], true);
}
}
}