Index: trunk/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- trunk/contactcenter/inc/class.ui_data.inc.php	(revision 4717)
+++ trunk/contactcenter/inc/class.ui_data.inc.php	(revision 4753)
@@ -19,5 +19,4 @@
 		var $public_functions = array(
 			'data_manager' => true,
-                        'advanced_searh_fields' => true
 		);
 
@@ -83,13 +82,4 @@
 				$this -> typeContact = 'contacts';
 			$this->preferences = $_SESSION['phpgw_info']['user']['preferences']['contactcenter'];
-		}
-		
-		function lg( $message, $path = '/tmp/natan.log' )
-		{
-		    ob_start();
-		    print_r( $message );
-		    echo( "\n" );
-		    $output = ob_get_clean();
-		    file_put_contents( $path, file_get_contents( $path ) . $output );
 		}
 
@@ -269,53 +259,6 @@
 			$GLOBALS['phpgw']->template->set_var('cc_msg_expresso_default_csv', lang('Export as Expresso (Default) CSV.'));
 			$GLOBALS['phpgw']->template->set_var('cc_msg_copy_to_catalog', lang('Copy to personal catalog.'));
-			$GLOBALS['phpgw']->template->set_var('cc_msg_show_extra_detail', lang("Show extra contact's details."));
 			$GLOBALS['phpgw']->template->set_var('cc_msg_add_contact_to_group', lang('You did not add any contact for this group.'));
 			$GLOBALS['phpgw']->template->set_var('cc_msg_fill_field_name', lang('Fill the field Full Name'));
-
-			/*
-			    * Monta Contactcenter Busca Avancada
-			    */
-			$c = CreateObject('phpgwapi.config','contactcenter');
-			$c->read_repository();
-			$current_config = $c->config_data;
-			$this->lg( $current_config );
-
-			$arraySearch = array();
-			foreach ($current_config as $index => $value)
-			{
-
-			    if(substr($index, 0, 24) == 'cc_attribute_searchable_')
-			    {
-				if($value == 'true')
-				    $arraySearch[] = substr($index, 24, strlen($index));
-			    }
-			}
-			$advanceSearchArray = array();
-			foreach ($arraySearch as $value)
-			{
-			    foreach ($current_config as $index => $value2)
-			    {
-				if($value == substr($index, 22, strlen($index)) && substr($index, 0, 22) == 'cc_attribute_ldapname_')
-				{
-				    foreach ($current_config as $index2 => $value3)
-				    {
-					if($value == substr($index2, 18, strlen($index2)) && substr($index2, 0, 18) == 'cc_attribute_name_')
-						$advanceSearchArray[$value2] =  $value3;
-				    }
-				}
-
-			    }
-			}
-
-			$advanceSearch = array();
-			foreach ($advanceSearchArray as $index => $value)
-			    $advanceSearch[] ='"'.$index.'":"'.$value.'"';
-
-			$advancedFields =  "{".implode(',',$advanceSearch)."}";
-			
-			$this->lg( $advancedFields );
-
-
-                        $GLOBALS['phpgw']->template->set_var('cc_config_advanced_search', $advancedFields);
 
 			$select_groups = '';
@@ -339,5 +282,4 @@
 				$GLOBALS['phpgw']->template->set_var('cc_contact_type', 'default');
 			}
-
 			$GLOBALS['phpgw']->template->parse('out','index');
 
@@ -347,5 +289,4 @@
 			$main .= $api->get_quick_add_plugin();
 			$main .= $api->get_add_group();
-			$main .= $api->get_contact_details();
 			$main .= $GLOBALS['phpgw']->template->get_var('out');
 
@@ -504,10 +445,6 @@
 					return $this->export_contacts($_POST['typeExport']);
 				
-				case 'get_contact_details':
-					return $this->get_contact_details($_GET['id']);
-
 				case 'get_qtds_compartilhado':
 					return $this->get_qtds_compartilhado();
-
 				case 'get_list_owners_perms_add':
 					echo $this->get_list_owners_perms_add();
@@ -1386,8 +1323,5 @@
 					)
 				);
-				//verifica se esta habilitado a opcao de exibir os detalhes extras
-				$objconfig = CreateObject('phpgwapi.config', 'contactcenter');
-				$config = $objconfig->read_repository();
-				$final[12] = isset($config['cc_allow_details'])? $config['cc_allow_details'] : false;
+
 				//echo 'Page: '.$page.'<br>';
 				$n_entries = count($this->page_info['actual_entries']);
@@ -1748,16 +1682,11 @@
 			
 			$boGroup = CreateObject('contactcenter.bo_group');
-			
-			$all_contacts = $boGroup->get_all_contacts(false,$shared_from);
-			
+
+			$all_contacts = $boGroup->get_all_contacts('only_email',$shared_from);
 			
 			$contact_options = "";
 			if(count($all_contacts)) {					
 				foreach($all_contacts as $idx => $contact) {				
-					$contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered'];
-					if (isset($contact['connection_value']))
-						$contact_options .= " (".$contact['connection_value'].")</OPTION>";
-					else
-						$contact_options .= " (". $contact['phone'].")</OPTION>";
+					$contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>";
 				}
 			}
@@ -1869,31 +1798,5 @@
 
 			/* Relations */
-			
-			/* Groups */
-			/*
-			 * Criado uma estrutura no data que conterá os grupos do
-			 * contato. O formato é:
-			 * data['groups'] = array(
-			 * 						'id_group' => array(
-			 * 										'id_group', 'title', 'short_name'
-			 * 										)
-			 * 						);
-			 */
-			$boGroup = CreateObject('contactcenter.bo_group');
-			$groups = $boGroup->get_contact_groups($id);
-			
-			$i = 0;
-			$data['groups'] = array();
-			foreach($groups as $group)
-			{
-				$idGroup = $group['id_group'];
-				$data['groups'][$idGroup] = array(
-					'title' 		=> $group['title'],
-					'id_group' 		=> $idGroup,
-					'short_name' 	=> $group['short_name']
-				);
-				$i++;
-			}
-				
+
 			echo serialize($data);
 		}
@@ -1914,15 +1817,5 @@
 			$predata[] = $boPeopleCatalog -> get_all_countries();
 			$predata[] = $boPeopleCatalog -> get_all_connections_types();
-			$boGroup = CreateObject('contactcenter.bo_group');
-			if ($this->typeContact == 'shared_contacts') { 
-				$so_contact = CreateObject('contactcenter.so_contact',  $GLOBALS['phpgw_info']['user']['account_id']);
-                $relacionados = $so_contact->get_relations();
-			
-                foreach($relacionados as $uid_relacionado => $tipo_relacionamento) {	
-					$predata[] = $boGroup->get_groups_by_user($uid_relacionado);						
-				}	
-			} else {
-						$predata[] = $boGroup->get_groups_by_user();
-					}
+			//$predata[] = $this->bo->catalog->get_all_relations_types();
 
 			$i = 0;
@@ -2094,40 +1987,4 @@
 			$data['contact_in_list'] = $new_tdata[1];
 			$data['id_group'] = $new_tdata[2];
-			$data['old_contacts_in_list'] = $new_tdata[3];
-			
-			foreach ($data['old_contacts_in_list'] as $id_connection)
-			{
-				$boConn = CreateObject('contactcenter.bo_connection');
-
-				$id_contact = $boConn->get_contact_id_by_connection($id_connection);
-				$contact = CreateObject('contactcenter.so_contact', $id_contact);
-				$contact->set_field("last_status", 'U');
-				$contact->set_field("last_update",time()."000");
-				$contact->commit();
-			}
-						
-			$contactWOemail = false;
-
-			foreach ($data['contact_in_list'] as $id_connection)
-			{
-				$boConn = CreateObject('contactcenter.bo_connection');
-				
-				$id_contact = $boConn->get_contact_id_by_connection($id_connection);
-				$contact = CreateObject('contactcenter.so_contact', $id_contact);
-				$contact->set_field("last_status", 'U');
-				$contact->set_field("last_update",time()."000");
-				$contact->commit();
-				
-				if (!$contactWOemail)
-				{
-					$type = $boConn->get_connection_type_by_conn_id($id_connection);
-					if ($type != 1)
-					{
-						$contactWOemail = true;
-					}
-				}
-			}
-
- 
                         $acumulatedErrors = '';
 
@@ -2181,20 +2038,15 @@
 			{
 				$this->page_info['changed'] = true;
-				
-				if (!$contactWOemail)
-					echo serialize(array(
-						'msg'    => lang('Entry added with success!'),
-						'status' => 'ok'
-						));
-				else
-					echo serialize(array(
-						'msg'    => lang('Entry added with success. But some contacts will not receive or send messages.'),
-						'status' => 'warning'
-						));
+
+				echo serialize(array(
+					'msg'    => lang('Entry added with success!'),
+					'status' => 'ok'
+				));
 			}
 			else
 			{
 				echo serialize(array(
-					'msg'    => lang('Problems on adding your Contact. No Contact added!'),
+					'msg'    => lang("Problems on adding your Group. Be sure that a group with this name do not exists").
+                                            "\n".$acumulatedErrors,
 					'status' => 'error'
 				));
@@ -2224,5 +2076,5 @@
 				else {
 					echo serialize(array(
-						'msg'    => lang('Problems on adding your Contact. No Contact added!'),
+						'msg'    => lang("Could\'nt remove group with id: %1", $id),
 						'status' => 'error'
 					));
@@ -2567,8 +2419,4 @@
 						/* Does nothing... */
 						break;
-					case 'groups':
-						$groups = $data['groups'];
-						unset($data['groups']);
-						break;
 
 					default:
@@ -2583,6 +2431,5 @@
 			if (!is_null($id) and $id !== '')
 			{
-				$old_connections = $this->bo->catalog->get_connections($id);
-				$id = $this->bo->catalog->update_single_info($id, $data);
+				$id = $this->bo->catalog->update_single_info($id, $data); 
 				$result = array(
 					'msg' => lang('Updated Successfully!'),
@@ -2606,11 +2453,4 @@
 					'status' => 'fail'
 				);
-			}
-			else
-			{
-				if (isset($old_connections))
-					$this->bo->catalog->update_contact_groups($id, $groups, $old_connections);
-				else
-					$this->bo->catalog->update_contact_groups($id, $groups);
 			}
 
@@ -3058,16 +2898,4 @@
 
 			header('Content-type: image/jpeg');
-
-			$tmpDir = $GLOBALS['phpgw_info']['server']['temp_dir'];
-			$imagem_temp = fopen("$tmpDir/img_tmp","wb+");
-			fwrite($imagem_temp,$contact['photo']);
-			fclose($imagem_temp);			
-			$exif = exif_read_data("$tmpDir/img_tmp","IDF0");
-			$ort = 1;
-			if ($exif['Orientation'] != '') {
-				$ort = $exif['Orientation'];
-			}
-			unlink("$tmpDir/img_tmp");			
-
 			$photo = imagecreatefromstring ($contact['photo']);
 			$width = imagesx($photo);
@@ -3077,24 +2905,5 @@
 			$small_photo = imagecreatetruecolor ($twidth, $theight);
 			imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height);
-			
-			if ($ort != 1){
-				switch($ort)
-				{
-					case 3: 
-						$rotate = imagerotate($small_photo, 180, 0);
-						break;
-					case 6:
-						$rotate = imagerotate($small_photo, 270, 0);
-						break;
-					case 8:
-						$rotate = imagerotate($small_photo, 90, 0);
-						break;
-				}
-			} else $rotate = imagerotate($small_photo, 0, 0);
-	
-			imagejpeg($rotate,"",100);
-			ImageDestroy($rotate);
-			ImageDestroy($small_photo);
-
+			imagejpeg($small_photo,"",100);
 			return;
 		}
@@ -3233,10 +3042,10 @@
 			if (!is_array($data) || (!$data['search_for'] && !$full_search) || !is_array($data['fields']))
 			{
-			    echo serialize(array(
-				    'msg'    => lang('Invalid parameters'),
-				    'status' => 'abort'
-			    ));
-
-			    return array('error' => lang('Invalid parameters'));
+				echo serialize(array(
+					'msg'    => lang('Invalid parameters'),
+					'status' => 'abort'
+				));
+
+				return array('error' => lang('Invalid parameters'));
 			}
 
@@ -3255,5 +3064,5 @@
 			{
 
-				$data['search_for'] = ($data['search_for']);
+				$data['search_for'] = utf8_encode($data['search_for']);
 			}
 
@@ -3272,19 +3081,19 @@
 			else
 			{
-			    $names = explode(' ', $data['search_for']);
-
-			    if (!is_array($names))
-			    {
-				    if(!$full_search) {
-					    echo serialize(array(
-						    'msg'    => lang('Invalid Search Parameter'),
-						    'status' => 'abort'
-					    ));
-					    exit;
-				    }
-				    else 
-					    $names = array();
-
-			    }
+				$names = explode(' ', $data['search_for']);
+
+				if (!is_array($names))
+				{
+					if(!$full_search) {
+						echo serialize(array(
+							'msg'    => lang('Invalid Search Parameter'),
+							'status' => 'abort'
+						));
+						exit;
+					}
+					else 
+						$names = array();
+
+				}
 
 				if (!$external && $this->page_info['actual_catalog']['class'] != 'bo_people_catalog' &&
@@ -3330,14 +3139,14 @@
 					);
 
-					if($full_search) {
-						foreach($full_search as $field => $value) {
-							if(trim($value)!='')
-								array_push($rules,array(
-												'field' => $this->aux_full_search($field,true),
-												'type' => 'LIKE',
-												'value' => '*'.$value.'*'
-												));
-						}
-					}
+                                        if($full_search) {
+                                            foreach($full_search as $field => $value) {
+                                                    if(trim($value)!='')
+                                                            array_push($rules,array(
+                                                                                            'field' => $this->aux_full_search($field,true),
+                                                                                            'type' => 'LIKE',
+                                                                                            'value' => '*'.$value.'*'
+                                                                                            ));
+                                            }
+                                        }
 
 				}
@@ -3348,8 +3157,8 @@
 							array_push($rules,array(
 											'field' => $this->aux_full_search($field,false),
-											'type'  => 'LIKE and ~=',
-											'value' => $name
+											'type' => 'iLIKE',
+											'value' => '%'.$value.'%'
 											));
-            					}
+					}
 				
 				}
@@ -3361,6 +3170,6 @@
 						array_push($rules, array(
 							'field' => $data['fields']['search'],
-							'type'  => 'LIKE and ~=',
-							'value' => $name
+							'type'  => 'iLIKE',
+							'value' => '%'.$name.'%'
 						));
 					}
@@ -3380,5 +3189,5 @@
 				// Get only this attributes: dn, cn for external catalogs,
 				// used to restrict the attributes used in filters
-				$ids = $this->bo->find(array($data['fields']['id'], $data['fields']['search']), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC', 'customFilter' => $data['custom_filter'], 'CN' => $data['CN'], 'exact' => $data['exact']), $data['search_for'] != null);
+				$ids = $this->bo->find(array($data['fields']['id'], $data['fields']['search']), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC'), $data['search_for'] != null);
 			}
 			else
@@ -3394,5 +3203,5 @@
 					'contact.connection.mail',
 					'contact.connection.phone'
-					), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC', 'customFilter' => $data['custom_filter'], 'CN' => $data['CN'], 'exact' => $data['exact']), $data['search_for_area'], $data['search_for'] != null );
+					), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC'), $data['search_for_area'], $data['search_for'] != null );
 			}
 
@@ -3776,5 +3585,4 @@
 			for($z = 0; $z < 5; $z++) {
 				$participant = $info[0][$justThese[$z]];
-				$participant[0] = utf8_decode($participant[0]);
 				array_push($array_participants, $participant);
 			}
@@ -4036,10 +3844,11 @@
 					"Office Location,Organizational ID Number,PO Box,Priority,Private,Profession,Referred By,Sensitivity,Spouse,User 1,User 2,User 3,User 4,Web Page\r\n";
 
-					foreach($contacts as $index => $object){
-						if( array_key_exists("phone", $object) )
-							$phone = $object['phone'];
-						else
-                            $phone = $object['business-phone'];
-					
+				foreach($contacts as $index => $object)
+                                {
+                                        if( array_key_exists("phone", $object) )
+                                           $phone = $object['phone'];
+                                        else
+                                           $phone = $object['business-phone'];
+
 						$streamBuffer.= "\"".$object[ 'alias' ] . "\","
 							. "\"".$object[ 'names_ordered'] . "\","
@@ -4064,5 +3873,5 @@
 							.",,,,,,,,"
 							. "\"".$object[ 'business-fax' ] . "\","
-							. "\"".$phone . "\","
+                                                        . "\"".$phone . "\","
 							. "\"".$object[ 'business-mobile' ] . "\","
 							.",,,"
@@ -4103,5 +3912,5 @@
 							. "\"".$object[ 'alternative-mail' ] . "\","
 							.","
-							. "\"".$phone . "\","
+                                                        . "\"".$phone . "\","
 							. "\"".$object[ 'home-phone' ] . "\","
 							. "\"".$object[ 'business-fax' ] . "\","
@@ -4182,5 +3991,5 @@
 
 			$file = "contacts_".md5(microtime()).".swp";
-			$tempDir = $GLOBALS['phpgw_info']['server']['temp_dir'];
+			$tempDir = ini_get("session.save_path");
 			$f = fopen($tempDir.'/'.$file,"w");
 			if(!$f)
@@ -4230,5 +4039,5 @@
 		//sobrenome, notas e e-mail;
 		//em 19/06/2009 - Rommel Cysne (rommel.cysne@serpro.gov.br);
-		function import_contacts($typeImport, $id_group=false){ 
+		function import_contacts($typeImport, $id_group=false){
 			$this->so_group = CreateObject('contactcenter.so_group');
 			if($file = $_SESSION['contactcenter']['importCSV']) {
@@ -4387,5 +4196,5 @@
 								case 'Telefone principal':
 								case 'Telefone comercial':
-								case 'Telefone Comercial':
+                                                                case 'Telefone Comercial':                                                                    
 									$phone_pos = $index;
 									break;
@@ -4451,8 +4260,7 @@
 
 						$sdata['connections']['default_phone']['connection_name'] = lang('Main');
-					
-						$sdata['connections']['default_phone']['connection_value'] = $phone;
-
-                                                if( trim($row[$header[$home_phone_pos]]) != "" )
+                                                $sdata['connections']['default_phone']['connection_value'] = $phone;
+
+						if( trim($row[$header[$home_phone_pos]]) != "" )
                                                 {
                                                     $sdata['connections']['aditional_phone']['home_phone']['connection_name'] = 'Casa';
@@ -4504,20 +4312,20 @@
                                                     }
                                                 }
-					
+
 						$sdata['addresses']['address_corporative']['address1'] = trim($row[$header[$corporate_street_pos]]);
 						$sdata['addresses']['address_corporative']['address2'] = trim($row[$header[$corporate_street_2_pos]]);
 						$sdata['addresses']['address_corporative']['complement'] = trim($row[$header[$corporate_comp_pos]]);
-						$sdata['addresses']['address_corporative']['postal_code'] = trim($row[$header[$corporate_cep_pos]]);						
+						$sdata['addresses']['address_corporative']['postal_code'] = trim($row[$header[$corporate_cep_pos]]);
 						$sdata['addresses']['address_corporative']['id_country'] = "BR";
-						$sdata['addresses']['address_corporative']['id_state'] = trim($row[$header[$corporate_state_pos]]);	
+						$sdata['addresses']['address_corporative']['id_state'] = trim($row[$header[$corporate_state_pos]]);
 						$sdata['addresses']['address_corporative']['id_city'] = trim($row[$header[$corporate_city_pos]]);
-						
-													
+
+
 						$sdata['addresses']['address_personal']['address1'] = trim($row[$header[$street_pos]]);
 						$sdata['addresses']['address_personal']['address2'] = trim($row[$header[$street_2_pos]]);
 						$sdata['addresses']['address_personal']['complement'] = trim($row[$header[$comp_pos]]);
 						$sdata['addresses']['address_personal']['postal_code'] = trim($row[$header[$cep_pos]]);
-						$sdata['addresses']['address_personal']['id_country'] = "BR";							
-						$sdata['addresses']['address_personal']['id_state'] = trim($row[$header[$state_pos]]);	
+						$sdata['addresses']['address_personal']['id_country'] = "BR";
+						$sdata['addresses']['address_personal']['id_state'] = trim($row[$header[$state_pos]]);
 						$sdata['addresses']['address_personal']['id_city'] =  trim($row[$header[$city_pos]]);
 
@@ -4531,9 +4339,7 @@
 					$sdata['connections']['default_phone']['connection_value'] = $phone;
 
-					//	verifica se email já existe!
+					// 	verifica se email já existe!
 					$email = addslashes($email);
-					// Foi modificado o método que fazia a verificação se um contato já existe.
-					// Antes era verificado somente com base no email do contato.
-					$contact = $boGroup->verify_contact($email, $full_name, $phone);
+					$contact = $boGroup->verify_contact($email);
 
 					if(!$sdata['given_names'] && $email){
@@ -4546,8 +4352,6 @@
 					if($contact){
 						$return['_existing']++;
-					}								
-				    // Modificada a expressão regular para aceitar endereços de email fora do padrão nome@provedor.com.br. 
-				    // Aceita casos de domínios internos como c0000@mail.caixa.					
-					else if((!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$", $email)) && $email) {
+					}
+					else if((!eregi("^[/_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) && $email) {
 						$return['_failure']++;
 						$return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid E-Mail address: " . $email ."<br>";
@@ -4557,8 +4361,8 @@
 						$return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid Name: " . $sdata['given_names'] ."<br>";
 					}
-					else{	
-							if($id_group != 0){								
+					else{
+							if($id_group != 0){
 								$this->so_group->add_user_by_name($id_group,$full_name);
-							}						
+							}
 							$return['_new']++;
 		   				}
@@ -4572,68 +4376,4 @@
 			echo serialize($return);
 		}
-	
-		/*!
-		 * @function get_contact_details
-		 * @abstract Retorna os detalhes extras de um contato
-		 * @author Luiz Carlos Viana Melo - Prognus
-		 * @param (string) O ID do usuário do LDAP
-		 */
-		function get_contact_details($id)
-		{
-			$data = array();
-			
-			if(!$this->bo->catalog->src_info) {
-				$ldap = CreateObject('contactcenter.bo_ldap_manager');
-				$this->bo->catalog->src_info = $ldap->srcs[1];
-			}
-			
-			$ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true);				
-			$dn=$this->bo->catalog->src_info['dn'];
-			
-			//buscar os atributos do ldap
-			$configobj = CreateObject('phpgwapi.config', 'contactcenter');
-			$prefs = $configobj->read_repository();
-			$attr_names = array();
-			$attr_types = array();
-			$justThese = array();
-			foreach ($prefs as $pref_key => $pref_value)
-			{
-				if (stripos($pref_key, "cc_attribute_name_") !== false)
-				{
-					$num = substr($pref_key, strlen("cc_attribute_name_"));
-					$attr_names[] = $prefs["cc_attribute_name_$num"];
-					$attr_types[] = $prefs["cc_attribute_type_$num"];
-					$justThese[] = strtolower($prefs["cc_attribute_ldapname_$num"]);
-				}
-			}
-			$sr = ldap_read($ds,$id, "objectClass=*",$justThese);							
-			$info = ldap_get_entries($ds, $sr);
-			if ($info)
-			{
-				for ($i = 0; $i < count($justThese); $i++)
-				{
-					$attr = array();
-					$attr['name'] = $attr_names[$i];
-					if ($attr_types[$i] == 'multivalues')
-					{
-						$attr['type'] = 'multivalues';
-						$attr['value'] = array();
-						for ($j = 0; $j < $info[0][$justThese[$i]]['count']; $j++)
-							$attr['value'][] = utf8_decode($info[0][$justThese[$i]][$j]);
-					}
-					else
-					{
-						$attr['type'] = 'text';
-						$attr['value'] = utf8_decode($info[0][$justThese[$i]][0]);
-					}
-					$data[] = $attr;
-				}
-			}
-			else
-				$data = 'error';
-			ldap_close($ds);
-			
-			echo serialize($data);
-		}
 	}
 
