Index: trunk/phpgwapi/templates/classic/listUsers.php
===================================================================
--- trunk/phpgwapi/templates/classic/listUsers.php	(revision 1151)
+++ trunk/phpgwapi/templates/classic/listUsers.php	(revision 1559)
@@ -26,5 +26,5 @@
 	$t = &$GLOBALS['phpgw']->template;						
 	// seta o Template
-	$t->set_file(array('addUser_t' => '../../../phpgwapi/templates/celepar/listUsers.tpl'));
+	$t->set_file(array('addUser_t' => '../../../phpgwapi/templates/default/listUsers.tpl'));
 
 	$obj_account = CreateObject('phpgwapi.accounts',$owner);
@@ -33,7 +33,9 @@
 	$post_select_sector = $_POST['select_sector'];
 	$change_organization = $_POST['change_organization'];
+	$search_users = $_POST['search_users'];
 	
 	$obj_org_sector = CreateObject('phpgwapi.sector_search_ldap');
-	if ((!$post_select_organization) && (!$post_select_sector)) //primeira vez
+	$cn='*';
+	if ((!$post_select_organization) && (!$post_select_sector) && (!$search_users)) //primeira vez
 	{
 		$user_org = $obj_account->get_organization($GLOBALS['phpgw_info']['user']['account_dn']);
@@ -46,5 +48,5 @@
 		$sectors_info = $obj_org_sector->sector_search('ou='.$user_org.','.$GLOBALS['phpgw_info']['server']['ldap_context']);
 	}
-	else //mudou uma das combos
+	else if(($post_select_organization) && ($post_select_sector) && (!$search_users))//mudou uma das combos	
 	{
 		$user_org = $post_select_organization;
@@ -59,5 +61,16 @@
 		$sectors_info = $obj_org_sector->sector_search('ou='.$user_org.','.$GLOBALS['phpgw_info']['server']['ldap_context']);
 	}
-		
+	else if ($search_users)//foi preenchida a caixa de busca independente
+	{
+		$user_context = $GLOBALS['phpgw_info']['server']['ldap_context'];
+		system('echo "CONTEXT: '.$user_context.'" >/tmp/controle');
+		$organizations_info = $obj_org_sector->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
+		@asort($organizations_info);
+		@reset($organizations_info);
+		$sectors_info = $obj_org_sector->sector_search('ou='.$post_select_organization.','.$GLOBALS['phpgw_info']['server']['ldap_context']);
+		@reset($sector_info);
+		$cn='*'.$search_users.'*';
+	}
+	
 	foreach($organizations_info as $organization)
 	{
@@ -102,4 +115,5 @@
 	$users = Array();
 	$groups = Array();
+	$justthese = array("phpgwaccountvisible","uidNumber","cn");
 	
 	$typeAccount = 'u';
@@ -112,5 +126,5 @@
     if ($ds) 
     {
-		$sr=ldap_list($ds, $user_context, ("(&(cn=*)(phpgwaccounttype=".$typeAccount."))"));
+		$sr=ldap_search($ds, $user_context, ("(&(cn=$cn)(phpgwaccounttype=".$typeAccount."))"),$justthese);	
 		$info = ldap_get_entries($ds, $sr);
 		
Index: trunk/phpgwapi/templates/classic/listUsers.tpl
===================================================================
--- trunk/phpgwapi/templates/classic/listUsers.tpl	(revision 1151)
+++ trunk/phpgwapi/templates/classic/listUsers.tpl	(revision 1559)
@@ -13,12 +13,12 @@
 			  <div id="divAppboxHeader">{lang_Add_Participants}</div>
 			  <div id="divAppbox">
-			   <table border=0>
-				<tr><td>{lang_Organization}:</td></tr>
-				<tr><td><select name="select_organization" onchange="formAddUser.change_organization.value='True';formAddUser.submit()">.{combo_organization}.</select></td></tr>
-				<tr><td>{lang_Sector}:</td></tr>
-				<tr><td><select name="select_sector" onchange="formAddUser.submit()">.{combo_sector}.</select></td></tr>
-				<input type="hidden" name="change_organization" value="False">
+				<table border=0>
+				<tr><td>{lang_Organization}:</td><td>{lang_Sector}:</td></tr>
+				<tr><td><select name="select_organization" onchange="formAddUser.change_organization.value='True';formAddUser.submit()">.{combo_organization}.</select></td>
+				<td><select name="select_sector" onchange="formAddUser.submit()">.{combo_sector}.</select></td></tr>
+				<tr><td colspan="2"><input type="hidden" name="change_organization" value="False"></td></tr>
+				<tr><td colspan="2"><center>{lang_to_Search}:&nbsp;<input type="text" name="search_users"></center></td></tr>
 				<tr>
-				 <td>
+				 <td colspan="2">
 				  <select name="user_values" multiple style="width:250px" size="18" id="user_list_in">
 				  {options}
