Changeset 4033 for branches/2.2/reports/inc/class.functions.inc.php
- Timestamp:
- 04/14/11 17:18:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/reports/inc/class.functions.inc.php
r3949 r4033 854 854 } 855 855 856 function get_count_user_sector($query, $contexts,$sizelimit) 857 { 858 $dn = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 859 $passwd = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 860 $ldap_conn = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 861 ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 862 ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 863 ldap_bind($ldap_conn,$dn,$passwd); 864 // counting users by sector. 865 foreach ($contexts as $index=>$context) { 866 if($context == $GLOBALS['phpgw_info']['server'] ["ldap_context"]) { 867 $contexts[$index] = null; 868 $justthese = array("dn"); 869 $filter="(objectClass=OrganizationalUnit)"; 870 $search = ldap_list($ldap_conn, $context, $filter, $justthese); 871 $entries = ldap_get_entries($ldap_conn, $search); 872 $contexts = array(); 873 for ($i=0; $i< $entries['count']; $i++){ 874 $contexts[] = $entries[$i]['dn']; 875 } 876 } 877 } 878 $filter="(&(phpgwAccountType=u)(|(uid=*)))"; 879 $justthese = array("uidnumber"); 880 $total_count = 0; 881 882 foreach ($contexts as $index=>$context) { 883 $search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit); 884 $total_count += ldap_count_entries($ldap_conn, $search); 885 } 886 ldap_close($ldap_conn); 887 return $total_count; 888 } 889 856 890 function get_list_user_sector_logon($query, $contexts,$sizelimit,$numacesso) 857 891 {
Note: See TracChangeset
for help on using the changeset viewer.