Index: /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5209)
+++ /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5237)
@@ -104,5 +104,5 @@
 		else
 			$extendedinfo=false;
-		
+
 		// follow the referral
 		$this->ldapConnect(true);
@@ -112,5 +112,5 @@
                     $ldapService->connection = $this->ds;
 				if($extendedinfo)
-                	$justthese = array("cn", "mail", "telephonenumber", "mobile", "phpgwaccountvisible", "uid", "employeenumber", "ou");
+                	$justthese = array("cn", "mail", "telephonenumber", "uidNumber", "mobile", "phpgwaccountvisible", "employeenumber", "ou");
 				else 
 					$justthese = array("cn", "mail", "telephoneNumber", "phpgwAccountVisible", "uid");
@@ -135,5 +135,5 @@
 
 	    // New search only on user sector
-	    if ($count_entries == $this->max_result)
+	    if (true)
 	    {
                 $overload = $count_entries;
@@ -147,5 +147,5 @@
 						$filter="(|(cn=*$search_for*)(mail=*$search_for*))";
 						if($extendedinfo)
-                			$justthese = array("cn", "mail", "telephonenumber", "mobile", "phpgwaccountvisible", "uid", "employeenumber", "ou");
+                			$justthese = array("cn", "mail", "telephonenumber", "uidNumber", "mobile", "phpgwaccountvisible", "employeenumber", "ou");
 						else 
 							$justthese = array("cn", "mail", "telephoneNumber", "phpgwAccountVisible", "uid");
@@ -168,5 +168,5 @@
 			for ($i=0; $i<$info["count"]; $i++)
 			{
-		$key = $info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . 			$info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . 	$info[$i]["ou"][0];
+		$key = $info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uidnumber"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . 	$info[$i]["ou"][0];
 
 		if (/*(!$quickSearch_only_in_userSector) &&*/ preg_match("/$user_sector_dn/i", $info[$i]['dn']))
@@ -193,5 +193,5 @@
 					$contacts_result[$i] = array();
 					$contacts_result[$i]["cn"] = $cn;
-					list ($contacts_result[$i]["mail"], $contacts_result[$i]["phone"], $contacts_result[$i]["mobile"], $contacts_result[$i]["uid"], $contacts_result[$i]["jpegphoto"], $contacts_result[$i]["employeenumber"], $contacts_result[$i]["ou"]) = split ('%', $info);
+					list ($contacts_result[$i]["mail"], $contacts_result[$i]["phone"], $contacts_result[$i]["mobile"], $contacts_result[$i]["uidnumber"], $contacts_result[$i]["jpegphoto"], $contacts_result[$i]["employeenumber"], $contacts_result[$i]["ou"]) = split ('%', $info);
 					$i++;
 				}
@@ -492,5 +492,5 @@
 		    $extendedinfo=false;
 
-		list ($contacts_result["mail"], $contacts_result["phone"], $contacts_result["mobile"], $contacts_result["uid"], $contacts_result["jpegphoto"], $contacts_result["employeenumber"], $contacts_result["ou"]) = split ('%', $info);
+		list ($contacts_result["mail"], $contacts_result["phone"], $contacts_result["mobile"], $contacts_result["uidNumber"], $contacts_result["jpegphoto"], $contacts_result["employeenumber"], $contacts_result["ou"]) = split ('%', $info);
 
 		if ($contacts_result['jpegphoto'])
@@ -514,7 +514,11 @@
 		    }
 		    $empNumber = $contacts_result["employeenumber"];
+			$uidNumber = $contacts_result["uidNumber"];
 		    if($empNumber) {
 			    $empNumber = "$empNumber - ";
-		    }
+		    } 
+			else if($uidNumber){
+				$uidNumber = "$uidNumber - ";
+			}			
 		    $ou = $contacts_result["ou"];
 		    if($ou) {
@@ -539,5 +543,5 @@
 				'</td>' .
 				'<td class="cc">' .
-					'<span name="cn">' . $empNumber . $contacts_result['cn'] . '</span>' . '<br>' .
+					'<span name="cn">' . ($empNumber != "" ? $empNumber : $uidNumber) . $contacts_result['cn'] . '</span>' . '<br>' .
 					'<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' .
 						'<font color=blue>' .
