Browse Source

add sort parameter to list_users (#176)

develop
REJack 9 years ago
parent
commit
ef8bfa0014
  1. 8
      application/libraries/Aauth.php

8
application/libraries/Aauth.php

@ -806,9 +806,10 @@ class Aauth {
* @param string $limit Limit of users to be returned * @param string $limit Limit of users to be returned
* @param bool $offset Offset for limited number of users * @param bool $offset Offset for limited number of users
* @param bool $include_banneds Include banned 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 * @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 is given
if ($group_par != FALSE) { if ($group_par != FALSE) {
@ -831,6 +832,11 @@ class Aauth {
$this->aauth_db->where('banned != ', 1); $this->aauth_db->where('banned != ', 1);
} }
// order_by
if ($sort) {
$this->aauth_db->order_by($sort);
}
// limit // limit
if ($limit) { if ($limit) {

Loading…
Cancel
Save