From ef8bfa001442468c89886d3df29e799362a62542 Mon Sep 17 00:00:00 2001 From: REJack Date: Tue, 20 Sep 2016 18:55:36 +0200 Subject: [PATCH] add sort parameter to list_users (#176) --- application/libraries/Aauth.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 5291e81..b634f11 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -806,9 +806,10 @@ class Aauth { * @param string $limit Limit of users to be returned * @param bool $offset Offset for limited number of users * @param bool $include_banneds Include banned users + * @param string $sort Order by MYSQL string (e.g. 'name ASC', 'email DESC') * @return array Array of users */ - public function list_users($group_par = FALSE, $limit = FALSE, $offset = FALSE, $include_banneds = FALSE) { + public function list_users($group_par = FALSE, $limit = FALSE, $offset = FALSE, $include_banneds = FALSE, $sort = FALSE) { // if group_par is given if ($group_par != FALSE) { @@ -831,6 +832,11 @@ class Aauth { $this->aauth_db->where('banned != ', 1); } + // order_by + if ($sort) { + $this->aauth_db->order_by($sort); + } + // limit if ($limit) {