Index: branches/2.2/workflow/inc/class.WorkflowObjects.inc.php
===================================================================
--- branches/2.2/workflow/inc/class.WorkflowObjects.inc.php	(revision 3167)
+++ branches/2.2/workflow/inc/class.WorkflowObjects.inc.php	(revision 3729)
@@ -197,8 +197,9 @@
 	/**
 	 * Retorna um recurso de LDAP
+	 * @param bool $useCCParams Indica se deve usar os parâmetros do Contact Center
 	 * @return resource O recurso LDAP
 	 * @access public
 	 */
-	function &getLDAP()
+	function &getLDAP($useCCParams = false)
 	{
 		if (!isset($this->cache['ldap']))
@@ -207,13 +208,27 @@
 			$this->assureEnvironment();
 
-			/* check where the connection parameters are */
-			$connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ?
-				$GLOBALS['phpgw_info']['server'] :
-				$_SESSION['phpgw_info']['workflow']['server'];
-
-			/* load required information */
-			$ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => ''));
-			if (empty($ldapConfigValues['ldap_host']))
-				$ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host'];
+			if($useCCParams)
+			{
+				/* get the contact center's connection parameters */
+				$ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter');
+				$config = $ajaxConfig->read_repository();
+
+				$ldapConfigValues['ldap_host'] = $config['cc_ldap_host0'];
+				$ldapConfigValues['ldap_user'] = $config['cc_ldap_browse_dn0'];
+				$ldapConfigValues['ldap_password'] = $config['cc_ldap_pw0'];
+				$ldapConfigValues['ldap_follow_referrals'] = 1;
+			}
+			else
+			{
+				/* check where the connection parameters are */
+				$connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ?
+					$GLOBALS['phpgw_info']['server'] :
+					$_SESSION['phpgw_info']['workflow']['server'];
+
+				/* load required information */
+				$ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => ''));
+				if (empty($ldapConfigValues['ldap_host']))
+					$ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host'];
+			}
 
 			/* connect to the LDAP server */
Index: branches/2.2/workflow/inc/class.bo_participants.inc.php
===================================================================
--- branches/2.2/workflow/inc/class.bo_participants.inc.php	(revision 3704)
+++ branches/2.2/workflow/inc/class.bo_participants.inc.php	(revision 3729)
@@ -34,5 +34,7 @@
 	function bo_participants()
 	{
-		$this->ldap = &Factory::getInstance('WorkflowLDAP');
+		$useCCParams = (isset($_REQUEST['useCCParams']) && $_REQUEST['useCCParams'] !== 'false') ? (bool)$_REQUEST['useCCParams'] : false;
+
+		$this->ldap = &Factory::getInstance('WorkflowLDAP', $useCCParams);
 	}
 
Index: branches/2.2/workflow/inc/class.ui_participants.inc.php
===================================================================
--- branches/2.2/workflow/inc/class.ui_participants.inc.php	(revision 3720)
+++ branches/2.2/workflow/inc/class.ui_participants.inc.php	(revision 3729)
@@ -136,4 +136,5 @@
 		$smarty->assign('target', $_REQUEST['target_element']);
 		$smarty->assign('usePreffix', $usePreffix);
+		$smarty->assign('useCCParams', $_REQUEST['useCCParams']);
 		$smarty->assign('hideOrganizations', $hideOrganizations);
 		$smarty->assign('hideSectors', $hideSectors);
Index: branches/2.2/workflow/inc/class.WorkflowLDAP.inc.php
===================================================================
--- branches/2.2/workflow/inc/class.WorkflowLDAP.inc.php	(revision 3327)
+++ branches/2.2/workflow/inc/class.WorkflowLDAP.inc.php	(revision 3729)
@@ -48,7 +48,7 @@
 	 * @access public
 	 */
-	function WorkflowLDAP()
-	{
-		$this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP();
+	function WorkflowLDAP($useCCParams = false)
+	{
+		$this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP($useCCParams);
 
 		/* get the required parameters */
Index: branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_user.php
===================================================================
--- branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 3715)
+++ branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 3729)
@@ -38,4 +38,5 @@
 		'onlyVisibleAccounts' => true,
 		'useGlobalSearch' => false,
+		'useCCParams' => false,
 		'rows'=> 2);
 	$extractParams = array(
@@ -106,4 +107,6 @@
 	else
 		$extraParams .= "&useGlobalSearch=true";
+	if (!empty($params['useCCParams']) && $params['useCCParams'] !== 'false')
+		$extraParams .= "&useCCParams=true";
 
 	$image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png');
Index: branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_users.php
===================================================================
--- branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_users.php	(revision 3715)
+++ branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_users.php	(revision 3729)
@@ -28,4 +28,5 @@
 		'onlyVisibleAccounts' => true,
 		'useGlobalSearch' => false,
+		'useCCParams' => false,
 		'get_email' => false,
 		'value' => array());
@@ -72,4 +73,6 @@
 	else
 		$extraParams .= "&useGlobalSearch=true";
+	if (!empty($params['useCCParams']) && $params['useCCParams'] !== 'false')
+		$extraParams .= "&useCCParams=true";
 
 	$output = '<table border="0"><tr><td>';
Index: branches/2.2/workflow/js/jscode/participants.js
===================================================================
--- branches/2.2/workflow/js/jscode/participants.js	(revision 3167)
+++ branches/2.2/workflow/js/jscode/participants.js	(revision 3729)
@@ -27,5 +27,6 @@
 		entities: $F('entities'),
 		id: $F('id'),
-		usePreffix: $F('usePreffix')
+		usePreffix: $F('usePreffix'),
+		useCCParams: $F('useCCParams')
 	};
 	callAjax('bo_participants', 'getSectors', resultGetSectors, params);
@@ -39,5 +40,6 @@
 		entities: $F('entities'),
 		id: $F('id'),
-		usePreffix: $F('usePreffix')
+		usePreffix: $F('usePreffix'),
+		useCCParams: $F('useCCParams')
 	};
 	callAjax('bo_participants', 'getEntities', resultGetParticipants, params);
@@ -356,5 +358,6 @@
 		entities: $F('entities'),
 		id: $F('id'),
-		usePreffix: $F('usePreffix')
+		usePreffix: $F('usePreffix'),
+		useCCParams: $F('useCCParams')
 	};
 	callAjax('bo_participants', 'globalSearch', resultPerformGlobalSearch, params);
Index: branches/2.2/workflow/templates/default/participants.tpl
===================================================================
--- branches/2.2/workflow/templates/default/participants.tpl	(revision 3715)
+++ branches/2.2/workflow/templates/default/participants.tpl	(revision 3729)
@@ -14,4 +14,5 @@
 <input type="hidden" id="target" value="{$target}"/>
 <input type="hidden" id="usePreffix" value="{$usePreffix}"/>
+<input type="hidden" id="useCCParams" value="{$useCCParams}"/>
 <table border="0" width="400">
 {if !($hideOrganizations && $hideSectors)}
