Index: /sandbox/2.2.0.2/contactcenter/inc/class.bo_ldap_manager.inc.php
===================================================================
--- /sandbox/2.2.0.2/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 4305)
+++ /sandbox/2.2.0.2/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 4352)
@@ -269,5 +269,5 @@
 			}
 			
-			$ldap = $GLOBALS['phpgw']->common->ldapConnect($this->srcs[$id_source]['host'], $this->srcs[$id_source]['acc'],$this->srcs[$id_source]['pw'], false);
+			$ldap = $GLOBALS['phpgw']->common->ldapConnect($this->srcs[$id_source]['host'], $this->srcs[$id_source]['acc'],$this->srcs[$id_source]['pw'], true);
 			if (!$ldap)
 			{
@@ -467,10 +467,4 @@
 		function get_ldap_tree_level($id_source, $resource, $context, $objectClass, $branch_dn, $external = 0)
 		{
-			if(strstr($context, "ldap://")){
-				$refer_context = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $context));
-				$host	= preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $context);
-				$resource = ldap_connect($host);
-				ldap_bind($resource);
-			}
 
 			/*
@@ -492,5 +486,5 @@
 				$filter = '(&(!(objectClass='.$objectClass.')) (!(phpgwAccountVisible=-1)))';
 			}
-			$result_res = @ldap_list($resource,  ($refer_context ? $refer_context : $context), $filter, array(), 0, 0);
+			$result_res = @ldap_list($resource,  $context, $filter, array(), 0, 0);
 			@ldap_sort($resource, $result_res, 'ou');
 
@@ -509,5 +503,5 @@
 				$filter = '(objectClass='.$objectClass.')';
 				// Get only one attribute of the source's objectClass
-				$result_res2 = @ldap_list($resource, ($refer_context ? $refer_context : $context), $filter, Array('cn'), 0, 1);
+				$result_res2 = @ldap_list($resource, $context, $filter, Array('cn'), 0, 1);
 				$entries_count = ldap_count_entries($resource, $result_res2);
 
@@ -551,5 +545,5 @@
 						'name'  => $this->translate_accentuation($dn_parts_1[0]),
 						'type'  => 'unknown',
-						'value' =>  ($refer_context ? $host."/" : "").$dn,
+						'value' =>  $dn,
 						'sub_branch' => false
 					);
@@ -559,13 +553,7 @@
 			}
 
-			if(! $refer_context) {
-				$array_referral = $this -> get_ldap_sub_branches_referrals($resource, $context,'(objectClass=organizationalUnit)');
-				for($z = 0; $z < count($array_referral); $z++) {
-					$tree['sub_branch'][$i++] = $array_referral[$z];
-				}
-			}
 
 			$filter = 'objectClass='.$objectClass;
-			$result_res2 = @ldap_list($resource, ($refer_context ? $refer_context : $context), $filter, Array('cn'), 0, 1);
+			$result_res2 = @ldap_list($resource, $context, $filter, Array('cn'), 0, 1);
 			$entries_count = ldap_count_entries($resource, $result_res2);
 
Index: /sandbox/2.2.0.2/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
===================================================================
--- /sandbox/2.2.0.2/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 4274)
+++ /sandbox/2.2.0.2/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 4352)
@@ -152,25 +152,4 @@
 			$filter = "(&".$filter."(mail=*))";
 
-                        if(strstr($this->src_info['context'], "ldap://")) {
-                                $refer_context  = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $this->src_info['context']));
-                                $host   = preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $this->src_info['context']);
-                                $this->src_info['host'] = $host;
-                        }
-                        if($refer_context || "ou" === strtolower(substr($this->src_info['context'], 0, 2)))
-                        {
-                                $followReferral = false;
-                        }
-                        elseif(trim($rules[4]['value']) != "inetOrgPerson")
-                        {
-                                $followReferral = true;
-                        }
-			else
-			{				
-				return false;
-			}
-			
-			$ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], $followReferral);
-			$result_r = $recursive ? ldap_search($ldap ,($refer_context  ? $refer_context  : $this->src_info['context']), $filter, $fields, 0, $this->src_info['max_results']) :
-						ldap_list($ldap , ($refer_context  ? $refer_context  : $this->src_info['context']), $filter, $fields, 0, $this->src_info['max_results']);
 
 			if (!$result_r)
