Changeset 207


Ignore:
Timestamp:
03/10/08 09:19:29 (16 years ago)
Author:
niltonneto
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.sector_search_ldap.inc.php

    r170 r207  
    100100                 
    101101                // Retorna os organizações com os options prontos 
    102                 function get_organizations($context, $selected='', $referral=false ,$show_invisible_ou=false) 
    103                 { 
    104                         $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
    105                         $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
    106                         $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     102                // Parametro master: realiza ldap_connect utilizando dados do Contact Center, permitindo buscas completas em todos os ldaps. 
     103                function get_organizations($context, $selected='', $referral=false ,$show_invisible_ou=false, $master=false) 
     104                { 
     105                        if ($master) 
     106                        { 
     107                                $ldap_cc_info = CreateObject('contactcenter.bo_ldap_manager'); 
     108                                $ldap_cc_info = $ldap_cc_info ? $ldap_cc_info->srcs[1] : null; 
     109                                $dn                     = $ldap_cc_info['acc']; 
     110                                $passwd         = $ldap_cc_info['pw']; 
     111                                $host           = $ldap_cc_info['host']; 
     112                        } 
     113                        else 
     114                        { 
     115                                $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     116                                $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     117                                $host           = $GLOBALS['phpgw_info']['server']['ldap_host']; 
     118                        } 
     119                         
     120                        $ldap_conn      = ldap_connect($host); 
    107121                         
    108122                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     
    188202            return $options; 
    189203                } 
    190                  
     204 
    191205                // Retorna os setores (somente OUs de primeiro nivel) com as options prontas 
    192206                function get_sectors($selected='', $referral=false ,$show_invisible_ou=false) 
Note: See TracChangeset for help on using the changeset viewer.