From 788440b69dadf6dd1c8248e9275f7a2d6111b2df Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 25 Jul 2004 15:51:54 +0000 Subject: [PATCH] fixed get_list, which was only returning groups if 'both' were requested, which caused eg. in calender only groups to be selectable --- phpgwapi/inc/class.accounts_ldap.inc.php | 57 +----------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index bd43623f84..2308d56511 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -457,21 +457,8 @@ { //print "\$_type=$_type, \$start=$start , \$sort=$sort, \$order=$order, \$query=$query, \$offset=$offset, \$query_type=$query_type
"; $query = strtolower($query); - if($offset) - { - $limitclause = '';//$phpgw->db->limit($start,$offset); - } - elseif($start && !$offset) - { - $limitclause = '';//$phpgw->db->limit($start); - } - if(!$sort) - { - $sort = '';//"desc"; - } - - if($_type == 'accounts') + if($_type == 'accounts' || $_type == 'both') { $filter = "(&(uidnumber=*)(phpgwaccounttype=u)"; if (!empty($query) && $query != '*') @@ -524,7 +511,7 @@ } } } - elseif ($_type == 'groups') + if ($_type == 'groups' || $_type == 'both') { if(empty($query) || $query == '*') { @@ -554,46 +541,6 @@ } } } - else - { - if(empty($query) || $query == "*") - { - $filter = "(&(gidnumber=*)(phpgwaccounttype=*))"; - } - else - { - $filter = "(&(gidnumber=*)(phpgwaccounttype=*)(|(uid=*$query*)(sn=*$query*)(cn=*$query*)(givenname=*$query*)(mail=*$query*)))"; - } - $sri = ldap_search($this->ds, $this->group_context, $filter); - $allValues = ldap_get_entries($this->ds, $sri); - while (list($null,$allVals) = @each($allValues)) - { - settype($allVals,'array'); - - if($allVals['phpgwaccounttype'][0] == 'u') - { - $_uid = @$allVals['uid'][0]; - } - else - { - $_uid = $allVals['cn'][0]; - } - - if (!$GLOBALS['phpgw_info']['server']['global_denied_groups'][$_uid] && $_uid) - { - $accounts[] = Array( - 'account_id' => $allVals['gidnumber'][0], - 'account_lid' => $_uid, - 'account_type' => $allVals['phpgwaccounttype'][0], - 'account_firstname' => $allVals['givenname'][0], - 'account_lastname' => $allVals['sn'][0], - 'account_status' => $allVals['phpgwaccountstatus'][0], - 'account_email' => $allVals['mail'][0], - ); - } - } - } - // sort the array $arrayFunctions = CreateObject('phpgwapi.arrayfunctions'); if(empty($order))