Index: /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 9)
+++ /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 13)
@@ -10,5 +10,10 @@
 	
 	function db_functions(){
-		$GLOBALS['phpgw_info']['server'] = $_SESSION['phpgw_info']['expresso']['server'];
+		
+		if (is_array($_SESSION['phpgw_info']['expresso']['server']))
+			$GLOBALS['phpgw_info']['server'] = $_SESSION['phpgw_info']['expresso']['server'];
+		else
+			$_SESSION['phpgw_info']['expresso']['server'] = $GLOBALS['phpgw_info']['server'];
+		
 		$this->db = new db();
 		$this->db->Halt_On_Error = 'no';
Index: /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 11)
+++ /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 13)
@@ -95,4 +95,5 @@
 				'context'					=> $context,
 				'context_display'			=> $context_display,
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter'], 
 				
 				'lang_create_user'			=> lang('Create User'),
@@ -153,5 +154,5 @@
 
 					if ($can_rename)
-						$p->set_var('row_rename',"<a href='#' onClick='javascript:rename_user(\"".$account['account_lid']."\",\"".$account['account_id']."\",\"".$context."\");'>Renomear</a>");						
+						$p->set_var('row_rename',"<a href='#' onClick='javascript:rename_user(\"".$account['account_lid']."\",\"".$account['account_id']."\",\"".$context."\");'>Renomear</a>");
 					else
 						$p->set_var('row_rename','&nbsp;');
Index: /trunk/expressoAdmin1_2/inc/class.functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 2)
+++ /trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 13)
@@ -30,5 +30,4 @@
 		function functions()
 		{
-			//$this->nextmatchs = createobject('phpgwapi.nextmatchs');
 			$this->db_functions = new db_functions;
 		}
Index: /trunk/expressoAdmin1_2/js/jscode/users.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/users.js	(revision 2)
+++ /trunk/expressoAdmin1_2/js/jscode/users.js	(revision 13)
@@ -543,7 +543,12 @@
 function rename_user(uid, uidnumber, context)
 {
+
+	if (document.getElementById('accounts_form_imapDelimiter').value == '/')
+		var reUid = /^([a-zA-Z0-9_\.\-])+$/;
+	else
+		var reUid = /^([a-zA-Z0-9_\-])+$/;
+
 	new_uid = prompt("Alterar login do usuário " + uid + " para: ", uid);
-	
-	var reUid = /^([a-zA-Z0-9_\-])+$/;
+
 	if(!reUid.test(new_uid)){
 		alert('Campo LOGIN comtém caracteres não permitidos.');
Index: /trunk/expressoAdmin1_2/templates/default/accounts.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/accounts.tpl	(revision 2)
+++ /trunk/expressoAdmin1_2/templates/default/accounts.tpl	(revision 13)
@@ -1,4 +1,4 @@
 <!-- BEGIN body -->
-
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
 {error_messages}
 <p>
Index: /trunk/contactcenter/doc/change_log.txt
===================================================================
--- /trunk/contactcenter/doc/change_log.txt	(revision 12)
+++ /trunk/contactcenter/doc/change_log.txt	(revision 13)
@@ -9,7 +9,11 @@
 se cria um template com nome diferente de celepar.
 
-02/04/2007 - [1.0.006]
+10/04/2007 - [1.0.006]
 - Código que carrega foto do usuário, vindo do LDAP, foi alterado para usar o cache do navegador,
 diminuindo o acesso ao LDAP;
 - Código que filtra para buscar os grupos de usuários foi comentado, pois dá problema na visualização.
 Atualmente o Catálogo de Endereços só lista usuários e listas.
+- Corrigido problema ao copiar um contato do catálogo geral para o pessoal, quando esse tinha mais que um
+resultado, procurado pelo UID. Agora a busca é feita através do seu DN, devido aos referrals.
+
+
Index: /trunk/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- /trunk/contactcenter/inc/class.ui_data.inc.php	(revision 12)
+++ /trunk/contactcenter/inc/class.ui_data.inc.php	(revision 13)
@@ -2338,29 +2338,20 @@
 
 			$array_participants = array();
-			$filter = null;			
-			$array_uid = explode(',',$id);
-			$uid = $array_uid[0];				
-			
-			$filter="(&(".$uid."))";
-			
-			if($filter) {
-				$filter = "(|".$filter.")";							
-				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'];
-				$justThese = array("givenname","givenname","sn","telephonenumber","mail");				
-				$sr = ldap_search($ds,$dn, $filter,$justThese);								
-				$info = ldap_get_entries($ds, $sr);							
-				for($z = 0; $z < 5; $z++) {
-					$participant = $info[0][$justThese[$z]];													
-					array_push($array_participants, $participant);
-				}
-
-				ldap_close($ds);
-			}
-			
+			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'];
+			$justThese = array("givenname","givenname","sn","telephonenumber","mail");
+			$sr = ldap_read($ds,$id, "objectClass=*",$justThese);							
+			$info = ldap_get_entries($ds, $sr);							
+			for($z = 0; $z < 5; $z++) {
+				$participant = $info[0][$justThese[$z]];													
+				array_push($array_participants, $participant);
+			}
+
+			ldap_close($ds);
 			echo serialize($array_participants);
 		}	
Index: /trunk/expressoMail1_2/docs/change_log.txt
===================================================================
--- /trunk/expressoMail1_2/docs/change_log.txt	(revision 12)
+++ /trunk/expressoMail1_2/docs/change_log.txt	(revision 13)
@@ -61,2 +61,8 @@
 em outro parametro não padrão.
 - Adicionada funcionalidade que compatibiliza mensagens encapsuladas, e com formato 7bit, serem visualizadas no ExpressoMail.
+
+09/04/2007 - [1.2030]
+- Implementado mesma funcionalidade do expandir Campo "Para" para o campo "CC", abrir uma mensagem. O objetivo é evitar travamento
+do navegador quando existem muito destinatários a serem expandidos com o plugin do Contact Center.
+- Corrigido problema de mensagens que têm nome de arquivos nos atributos "parameters" e "dparameters" de sua estrutura.
+
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 12)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 13)
@@ -588,9 +588,9 @@
 		*/
 		// HTML Filter
-		//$body = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=# onclick=\"javascript:new_message('new_by_message', '\\2@\\3')\">\\2@\\3</a>", $body); 	
-    	
+		//$body = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=# onclick=\"javascript:new_message('new_by_message', '\\2@\\3')\">\\2@\\3</a>", $body);
     	$body = str_replace("\r\n", "\n", $body);
 		if ($encoding == 'quoted-printable')
 	    {
+			
 			for($i=0;$i<256;$i++) {
 				$c1=dechex($i);
@@ -611,8 +611,8 @@
         	$body = base64_decode($body);
     	}
-    	else if ($encoding == '7bit') 
+    	/*else if ($encoding == '7bit') 
     	{
-        	$body = quoted_printable_decode($body);
-    	}
+        	$body = quoted_printable_decode($body);        	        	        	
+    	}*/
 		// All other encodings are returned raw.
 		if (strtolower($charset) == "utf-8")
@@ -692,5 +692,6 @@
 		// It no has exception,then open the link in new window.
 		if(!count($matches)){
-			$body = @eregi_replace("<a href=", "<a target='_blank' href=", $body);
+			$body = @eregi_replace("<a (.*) href=", "<a \\1 target='_blank' href=", $body);
+			$body = @str_replace("<a href=", "<a target='_blank' href=", $body);
 			$body = @eregi_replace("target=\"\"", "target='_blank'", $body);
 			$body = @eregi_replace("target=''", "target='_blank'", $body);
@@ -1501,4 +1502,5 @@
 		$str = ereg_replace('"', '&quot;', $str);
 		$str = ereg_replace('\'', '&#039;', $str);
+		
 		$str = ereg_replace('<', '&lt;', $str);
 		$str = ereg_replace('>', '&gt;', $str);
Index: /trunk/expressoMail1_2/inc/class.message_components.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 10)
+++ /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 13)
@@ -127,5 +127,5 @@
 						$this->charset[$mid][$n]   = $charset;
                         $this->fsize[$mid][$n]     = (!isset($parts[$p]->bytes) || empty($parts[$p]->bytes))? 0 : $parts[$p]->bytes;
-
+						$hasAttachment = false;
                         # Force inline disposition if none is present
                         //if ($parts[$p]->ifdisposition == true)
@@ -144,11 +144,12 @@
                                         {
                                             $this->fname[$mid][$n] = $param->value;
+                                            $hasAttachment = true;
                                             break;
-                                        }
+                                        }                                        
                                     }
                                 }
                                 
                                 // Alguns web-mails utilizam o parameters
-                                if ($parts[$p]->ifparameters == true)
+                                if ($parts[$p]->ifparameters == true && !$hasAttachment)
                                 {
                                     $params = $parts[$p]->parameters;
@@ -170,5 +171,5 @@
                                         if(strtolower($param->attribute) == 'charset'){
                                          	if($this->charset[$mid][$n] == '')
-                                         		$this->charset[$mid][$n] = $param->value;
+                                         		$this->charset[$mid][$n] = $param->value;                                         	
                                         }
                                     }
@@ -224,5 +225,5 @@
                 }
                 
-                $this->encoding[$mid][0]                = $this->encoding_types[$this->structure[$mid]->encoding];
+                $this->encoding[$mid][0]              = $this->encoding_types[$this->structure[$mid]->encoding];
                 if(!preg_match("/5./",phpversion()))
 					$this->charset[$mid][0] = $this->structure[$mid]->parameters[0]->value;
@@ -250,4 +251,18 @@
 					}
 				}
+				if (isset($this->structure[$mid]->ifparameters))
+				{
+					$params = $this->structure[$mid]->parameters;
+					$n = 0;
+					if($params)
+					foreach ($params as $param)
+					{
+						if(strtolower($param->attribute) == 'charset'){
+                        	if($this->charset[$mid][$n] == '')
+                            	$this->charset[$mid][$n] = $param->value;
+                        }
+						$n++;
+					}
+				}
 				$this->disposition[$mid][0] = $this->structure[$mid]->disposition;
                 //$this->disposition[$mid][0] = 'inline';
Index: /trunk/expressoMail1_2/js/globals.js
===================================================================
--- /trunk/expressoMail1_2/js/globals.js	(revision 2)
+++ /trunk/expressoMail1_2/js/globals.js	(revision 13)
@@ -13,4 +13,5 @@
 var array_lang = new Array();
 var cyrus_delimiter = '';
+var ccaddress_array = new Array();
 var toaddress_array = new Array();
 var tree_folders = '';
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 2)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 13)
@@ -956,5 +956,5 @@
 		div_toaddress.id = "div_toaddress_"+ID;
 		div_toaddress.style.display="";
-		div_toaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"');>"+get_lang('more')+"</a>)";
+		div_toaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','to');>"+get_lang('more')+"</a>)";
 		to.appendChild(div_toaddress);		
 	}
@@ -981,24 +981,14 @@
 		cc_values.value = info_msg.cc;
 		
-		var ccaddress_array = info_msg.cc.split(",");		
-		if (ccaddress_array.length > 1){
+		ccaddress_array[ID] = info_msg.cc.split(",");		
+		if (ccaddress_array[ID].length > 1){
 			var div_ccaddress = document.createElement("SPAN");
 			div_ccaddress.id = "div_ccaddress_"+ID;
 			var div_ccaddress_full = document.createElement("SPAN");
-			div_ccaddress_full.id = "div_ccaddress_full_"+ID;
-		
+			div_ccaddress_full.id = "div_ccaddress_full_"+ID;		
 			div_ccaddress.style.display="";
-			cc.innerHTML = draw_plugin_cc(ID, ccaddress_array[0]);
-			div_ccaddress.innerHTML += " (<a STYLE='color: RED;' onclick=document.getElementById('div_ccaddress_"+ID+"').style.display='none';document.getElementById('div_ccaddress_full_"+ID+"').style.display='';>"+get_lang('more')+"</a>)";
-			cc.appendChild(div_ccaddress);		
-			div_ccaddress_full.style.display="none";
-			
-			for(idx = 1 ; idx  < ccaddress_array.length;idx++) {
-				div_ccaddress_full.innerHTML += ', ';
-				div_ccaddress_full.innerHTML += draw_plugin_cc(ID, ccaddress_array[idx]);
-			}			
-			
-			div_ccaddress_full.innerHTML += " (<a STYLE='color: RED;' onclick=document.getElementById('div_ccaddress_full_"+ID+"').style.display='none';document.getElementById('div_ccaddress_"+ID+"').style.display='';>"+get_lang('less')+"</a>)";
-			cc.appendChild(div_ccaddress_full);
+			cc.innerHTML = draw_plugin_cc(ID, ccaddress_array[ID][0]);
+			div_ccaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','cc');>"+get_lang('more')+"</a>)";
+			cc.appendChild(div_ccaddress);
 		}
 		else{
@@ -2102,24 +2092,25 @@
 	
 }
-function show_div_address_full(id) {
-	var div_toaddress_full = Element("div_toaddress_full_"+id);
-	if(!div_toaddress_full) {
-		div_toaddress_full = document.createElement("SPAN");
-		div_toaddress_full.id = "div_toaddress_full_"+id;	
-		div_toaddress_full.style.display="none";	
-		var toaddress = toaddress_array[id];
-		var isOverLimit = (toaddress.length > 100);
+function show_div_address_full(id, type) {
+	var div_address_full = Element("div_"+type+"address_full_"+id);
+	if(!div_address_full) {
+		div_address_full = document.createElement("SPAN");
+		div_address_full.id = "div_"+type+"address_full_"+id;	
+		div_address_full.style.display="none";	
+		var _address = eval(type+"address_array['"+id+"']");
+		var isOverLimit = (_address.length > 100);
 		
 		if(isOverLimit) {
-			alert("Esse campo possui muitos endereços ("+toaddress.length+" destinatários).\r\n"+
+			alert("Esse campo possui muitos endereços ("+_address.length+" destinatários).\r\n"+
 			"Para evitar o travamento do navegador, o botão 'Adicionar Contato' foi desabilitado!");
 		}
-		for(var idx = 1 ; idx  < toaddress.length;idx++) {
-			div_toaddress_full.innerHTML += isOverLimit ?  '<br>'+toaddress[idx] : ','+draw_plugin_cc(id,toaddress[idx]);
+
+		for(var idx = 1 ; idx  < _address.length;idx++) {
+			div_address_full.innerHTML += isOverLimit ?  '<br>'+_address[idx] : ','+draw_plugin_cc(id,_address[idx]);
 		}		
-		div_toaddress_full.innerHTML += " (<a STYLE='color: RED;' onclick=document.getElementById('div_toaddress_full_"+id+"').style.display='none';document.getElementById('div_toaddress_"+id+"').style.display='';>"+get_lang('less')+"</a>)";
-		Element("to_"+id).appendChild(div_toaddress_full);
-	}
-	Element('div_toaddress_'+id).style.display='none';
-	div_toaddress_full.style.display='';
-}
+		div_address_full.innerHTML += " (<a STYLE='color: RED;' onclick=document.getElementById('div_"+type+"address_full_"+id+"').style.display='none';document.getElementById('div_"+type+"address_"+id+"').style.display='';>"+get_lang('less')+"</a>)";
+		Element(type+"_"+id).appendChild(div_address_full);
+	}
+	Element('div_'+type+'address_'+id).style.display='none';
+	div_address_full.style.display='';
+}
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 10)
+++ /trunk/expressoMail1_2/index.php	(revision 13)
@@ -4,5 +4,5 @@
 		'nonavbar' => False,
 		'currentapp' => 'expressoMail1_2',
-		'update_version'	=> '1.2029',
+		'update_version'	=> '1.2030',
 		'enable_nextmatchs_class' => True
 	);
@@ -82,5 +82,5 @@
 
 	// Is IE ??
-	echo "<SCRIPT>if ((!is_gecko) && (!is_ie6up)) {alert('OPSS !! Desculpe, mas seu navegador não suporta este WebMail. Instale o Mozilla FireFox 1.0+ ou Internet Explorer 6.0+. No momento, utilize a versão antiga do WebMail.');window.location=\"../email/\";}</SCRIPT>";
+	//echo "<SCRIPT>if ((!is_gecko) && (!is_ie6up)) {alert('OPSS !! Desculpe, mas seu navegador não suporta este WebMail. Instale o Mozilla FireFox 1.0+ ou Internet Explorer 6.0+. No momento, utilize a versão antiga do WebMail.');window.location=\"../email/\";}</SCRIPT>";
 	
 	// Get Preferences or redirect to preferences page.
