Index: /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl
===================================================================
--- /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl	(revision 5679)
+++ /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl	(revision 5864)
@@ -95,9 +95,4 @@
 						<label><xsl:value-of select="$Send"/></label>
 					</div>
-					<div>
-						<img title="{$hlp_msg_savelike_acl}" src="./templates/default/images/ajuda.jpg"/><label>-</label>
-						<input id="em_input_saveAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox" />
-						<label><xsl:value-of select="$Save"/></label>
-					</div>
 				</div>
 			</div>
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5862)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 5864)
@@ -4389,24 +4389,36 @@
 	{
 		$useracl = $params['user'];
-
-		$return = array();
-		$return[$useracl] = 'false';
-		$mbox_stream = $this->open_mbox();
-		$mbox_acl = imap_getacl($mbox_stream, 'INBOX');
-
-		foreach ($mbox_acl as $user => $acl)
-		{
-			if (($user != $this->username) && ($user == $useracl))
-			{
-				$return[$user] = $acl;
-			}
-		}
-		return $return;
-	}
-
-	function getacltouser($user)
-	{
 		$return = array();
 		$mbox_stream = $this->open_mbox();
+		if($params['getShared']){		
+			 $mbox_acl = imap_getacl($mbox_stream, 'user'.$this->imap_delimiter.$useracl); 		
+			foreach ($mbox_acl as $user => $acl)
+			{
+				if (($user == $this->username) && ($user != $useracl))
+				{
+					$return[$useracl] = $acl;
+				}
+			}			 
+		}else {	
+			$mbox_acl = imap_getacl($mbox_stream, 'INBOX');
+			foreach ($mbox_acl as $user => $acl)
+			{
+				if (($user != $this->username) && ($user == $useracl))
+				{
+					$return[$user] = $acl;
+				}
+			}
+		}
+		if(count($return) == 0)
+				$return[$useracl] = 'false';
+				
+		return $return;
+	}
+
+	function getacltouser($user)
+	{
+		$return = array();
+		$mbox_stream = $this->open_mbox();	
+		
 		//Alterado, antes era 'imap_getacl($mbox_stream, 'user'.$this->imap_delimiter.$user);
 		//Afim de tratar as pastas compartilhadas, verificandos as permissoes de operacao sobre as mesmas
@@ -4416,4 +4428,5 @@
 		else
 		  $mbox_acl = @imap_getacl($mbox_stream, $user);
+		
                 if(isset($mbox_acl[$this->username]))
 		return $mbox_acl[$this->username];
Index: /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5821)
+++ /trunk/expressoMail1_2/inc/class.ldap_functions.inc.php	(revision 5864)
@@ -883,5 +883,4 @@
 	function getSharedUsersFrom($params){
 		$filter = '';
-		$i = 0;		
 		//Added to save if must save sent messages in shared folder
 		$acl_save_sent_in_shared = array();
@@ -890,16 +889,20 @@
 			$uids = explode(";",$params['uids']);
 			$this->imap = new imap_functions();			
-			foreach($uids as $index => $uid){
+			foreach($uids as $index => $uid){		
+			
 				$params = array();
 				//Added to save if user has create permission 
 				$acl_create_message = array();
-				$acl = $this->imap->getacltouser($uid);
-				if ( preg_match("/a/",$acl )){				
-					$filter .= "(uid=$uid)";					
-					if ( preg_match("/p/",$acl )){				
-						$acl_save_sent_in_shared[ $i ] =$uid;
-						$i++;
-					}					
-				}							
+				$user_arr = array();
+				$user_arr['user'] = $uid;
+				$user_arr['getShared'] = true;
+				$acl = $this->imap->getaclfromuser( $user_arr );
+				
+				if($acl[$uid] != 'false'){
+					if ( preg_match("/[pa]+.*[pa]+/",$acl[$uid])){	
+						$filter .= "(uid=$uid)";							
+						$acl_save_sent_in_shared[] =$uid;			
+					}	
+				}
 			}			
 		}
@@ -946,5 +949,4 @@
 
 			$_SESSION['phpgw_info']['expressomail']['user']['shared_mailboxes'] = $info;
-			
 			return $info;
 		}
Index: /trunk/expressoMail1_2/js/sharemailbox.js
===================================================================
--- /trunk/expressoMail1_2/js/sharemailbox.js	(revision 5792)
+++ /trunk/expressoMail1_2/js/sharemailbox.js	(revision 5864)
@@ -39,7 +39,5 @@
 			Element('em_input_writeAcl').checked	= false;
 			Element('em_input_sendAcl').checked		= false;
-			Element('em_input_saveAcl').checked		= false;
-			
-			Element('em_input_saveAcl').disabled	= true;
+			
             Element('em_input_deleteAcl').disabled	= true;
             Element('em_input_writeAcl').disabled	= true;
@@ -63,5 +61,5 @@
 			}
 			
-			if (data[user].indexOf('wi',0) >= 0)
+			if (data[user].indexOf('w',0) >= 0)
 			{
 				Element('em_input_writeAcl').checked = true;
@@ -69,24 +67,10 @@
 			}
 			
-			if (data[user] != "false" && data[user].indexOf('a',0) >= 0)
+			if (data[user] != "false" && data[user].indexOf('p',0) >= 0)
 			{
 				Element('em_input_sendAcl').disabled = false;
 				Element('em_input_sendAcl').checked = true;
-			}
-			
-			if (data[user] != "false" && data[user].indexOf('p',0) >= 0)
-			{
-				Element('em_input_saveAcl').disabled = false;
-				Element('em_input_saveAcl').checked = true;
-			}
-			
-			if( data[user] != "false" && Element('em_input_writeAcl').checked && Element('em_input_sendAcl').checked )
-			{
-				Element('em_input_saveAcl').disabled = false;
-			}
-			else
-			{
-				Element('em_input_saveAcl').disabled = true;
-			}
+			}			
+
 		}
 		
@@ -126,21 +110,12 @@
 				
 		if (Element('em_input_deleteAcl').checked)
-			acl += 'd';
+			acl += 'ida';
 
 		if (Element('em_input_writeAcl').checked) {
-			acl += 'wi';			
+			acl += 'wc';			
 		}		
 		if (Element('em_input_sendAcl').checked){
-			acl += 'a';			
-		}
-		if (Element('em_input_sendAcl').checked && Element('em_input_writeAcl').checked){
-			Element('em_input_saveAcl').disabled = false;				
-		} else {
-			Element('em_input_saveAcl').disabled = true;
-			Element('em_input_saveAcl').checked = false;
-		}
-		
-		if (Element('em_input_saveAcl').checked)
-			acl += 'p';
+			acl += 'pa';			
+		}
 		
 		var handler_setaclfromuser = function(data) {
@@ -237,10 +212,8 @@
 												Element('em_input_writeAcl').checked	= false;
 												Element('em_input_sendAcl').checked		= false;
-												Element('em_input_saveAcl').checked		= false;
 												
 									            Element('em_input_deleteAcl').disabled	= true;
 									            Element('em_input_writeAcl').disabled 	= true;
 												Element('em_input_sendAcl').disabled	= true;
-												Element('em_input_saveAcl').disabled 	= true;
 
 												$("#sharemailbox").empty();
@@ -289,5 +262,4 @@
 		
 		Element('em_input_sendAcl').disabled	= true;
-		Element('em_input_saveAcl').disabled	= true;
 		Element('em_input_deleteAcl').disabled	= true;
 		Element('em_input_writeAcl').disabled	= true;
@@ -384,5 +356,4 @@
 		Element('em_input_writeAcl').checked = false;
 		Element('em_input_sendAcl').checked = false;
-		Element('em_input_saveAcl').checked = false;
 	}
 		
Index: /trunk/expressoMail1_2/js/messages_controller.js
===================================================================
--- /trunk/expressoMail1_2/js/messages_controller.js	(revision 5172)
+++ /trunk/expressoMail1_2/js/messages_controller.js	(revision 5864)
@@ -126,23 +126,23 @@
 
 	messages_proxy.prototype.proxy_rename_folder = function(){
-
-		if (ttree.FOLDER == 'local_Inbox') {
-			alert(get_lang("It's not possible rename the folder: ") + lang_folder(ttree.FOLDER.substr(6)) + '.');
+		var specialFolders = special_folders[ttree.getFolder().split(cyrus_delimiter)[ttree.getFolder().split(cyrus_delimiter).length-1]]; 
+		if (ttree.getFolder() == 'INBOX' || specialFolders ) {
+			alert(get_lang("It's not possible rename the folder: ") + lang_folder((specialFolders ? specialFolders : ttree.getFolder()))+ '.');
 			return false;
 		}
-		if(ttree.FOLDER == 'local_root') {
-				alert(get_lang("It's not possible rename this folder!"));
+		if(ttree.getFolder() == 'root') {
+			alert(get_lang("It's not possible rename this folder!"));
+			return false;
+		}
+		if(!specialFolders && ttree.getFolder() == get_current_folder()){
+				alert(get_lang("It's not possible rename this folder, because it is being used in the moment!"));
 				return false;
 		}
-                if(ttree.FOLDER.match("^local_.*$") && ttree.FOLDER == get_current_folder()){
-                        alert(get_lang("It's not possible rename this folder, because it is being used in the moment!"));
-						return false;
-                }
                 
-		if (this.is_local_folder(ttree.FOLDER)) {
+		if (this.is_local_folder(ttree.getFolder())) {
 			folder = prompt(get_lang("Enter a name for the box"), "");
-		        if(folder.match(/[\/\\\!\@\#\$\%\&\*\+\(\)]/gi)){
-			    alert(get_lang("It's not possible rename this folder. try other folder name"));
-			    return false;
+			if(folder.match(/[\/\\\!\@\#\$\%\&\*\+\(\)]/gi)){
+			alert(get_lang("It's not possible rename this folder. try other folder name"));
+			return false;
 			}
 			if(trim(folder) == "" || trim(folder) == null){
