diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index 5f42e0fe4b..8998f8e0a5 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -141,10 +141,33 @@ $this->db->query('DELETE FROM phpgw_accounts WHERE account_id='.$account_id); } - function get_list($_type='both') + function get_list($_type='both', $start = '',$sort = '', $order = '', $query = '', $offset = '') { global $phpgw; + if ($offset) + { + $limitclause = $phpgw->db->limit($start,$offset); + } + elseif ($start && !$offset) + { + $limitclause = $phpgw->db->limit($start); + } + + if (! $sort) + { + $sort = "desc"; + } + + if ($order) + { + $orderclause = "order by $order $sort"; + } + else + { + $orderclause = "order by account_lid,account_lastname,account_firstname asc"; + } + $ds = $phpgw->common->ldapConnect(); switch($_type) @@ -159,7 +182,7 @@ $whereclause = ""; } - $sql = "select * from phpgw_accounts $whereclause"; + $sql = "select * from phpgw_accounts $whereclause $orderclause $limitclause"; $this->db->query($sql,__LINE__,__FILE__); while ($this->db->next_record()) { // get user information from ldap only, if it's a user, not a group diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index ae8484c060..9a9a9f1b37 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -76,11 +76,15 @@ } - function get_list($_type='both',$start = '',$sort = '', $order = '', $query = '') + function get_list($_type='both',$start = '',$sort = '', $order = '', $query = '', $offset = '') { global $phpgw, $phpgw_info; - if ($start) + if ($offset) + { + $limitclause = $phpgw->db->limit($start,$offset); + } + elseif ($start && !$offset) { $limitclause = $phpgw->db->limit($start); }