Ignore:
Timestamp:
02/02/11 15:28:29 (13 years ago)
Author:
asaikawa
Message:

Ticket #1524 - Adicionado o parametro useCCParams nos componentes, indicando que serao usados os parametros do CC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/class.WorkflowObjects.inc.php

    r3167 r3729  
    197197        /** 
    198198         * Retorna um recurso de LDAP 
     199         * @param bool $useCCParams Indica se deve usar os parâmetros do Contact Center 
    199200         * @return resource O recurso LDAP 
    200201         * @access public 
    201202         */ 
    202         function &getLDAP() 
     203        function &getLDAP($useCCParams = false) 
    203204        { 
    204205                if (!isset($this->cache['ldap'])) 
     
    207208                        $this->assureEnvironment(); 
    208209 
    209                         /* check where the connection parameters are */ 
    210                         $connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ? 
    211                                 $GLOBALS['phpgw_info']['server'] : 
    212                                 $_SESSION['phpgw_info']['workflow']['server']; 
    213  
    214                         /* load required information */ 
    215                         $ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => '')); 
    216                         if (empty($ldapConfigValues['ldap_host'])) 
    217                                 $ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host']; 
     210                        if($useCCParams) 
     211                        { 
     212                                /* get the contact center's connection parameters */ 
     213                                $ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter'); 
     214                                $config = $ajaxConfig->read_repository(); 
     215 
     216                                $ldapConfigValues['ldap_host'] = $config['cc_ldap_host0']; 
     217                                $ldapConfigValues['ldap_user'] = $config['cc_ldap_browse_dn0']; 
     218                                $ldapConfigValues['ldap_password'] = $config['cc_ldap_pw0']; 
     219                                $ldapConfigValues['ldap_follow_referrals'] = 1; 
     220                        } 
     221                        else 
     222                        { 
     223                                /* check where the connection parameters are */ 
     224                                $connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ? 
     225                                        $GLOBALS['phpgw_info']['server'] : 
     226                                        $_SESSION['phpgw_info']['workflow']['server']; 
     227 
     228                                /* load required information */ 
     229                                $ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => '')); 
     230                                if (empty($ldapConfigValues['ldap_host'])) 
     231                                        $ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host']; 
     232                        } 
    218233 
    219234                        /* connect to the LDAP server */ 
Note: See TracChangeset for help on using the changeset viewer.