Index: sandbox/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1543)
+++ sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1590)
@@ -29,4 +29,6 @@
 created directory %1	filemanager	pt-br	Criada pasta %1
 date	filemanager	pt-br	Data
+export	filemanager	pt-br	exportar
+This file is being edited right now by:	filemanager	pt-br	Este arquivo está sendo editado por: 
 default number of upload fields to show	filemanager	pt-br	Padrão para o número de campos de envio de arquivos a exibir
 delete	filemanager	pt-br	Remover
Index: sandbox/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1575)
+++ sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1590)
@@ -297,11 +297,5 @@
 			# Some hacks to set and display directory paths correctly
 			###
-/*
-			if($this->goto || $this->goto_x)
-			{
-				$this->path = $this->cdtodir;
-			}
- */
-			if(!$this->bo->vfs->acl_check(array(
+			if(!($this->edit_x || $this->edit_save_x || $this->edit_save_done_x) && !$this->bo->vfs->acl_check(array(
 				'string' => $this->path,
 				'relatives' => array(RELATIVE_NONE),
@@ -765,5 +759,5 @@
 									$link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.export','file='.$files['name'].'&path='.$this->path);
 									$image=$GLOBALS['phpgw']->common->image('filemanager','button_export');
-									$col_data.='<a href="'.$link.'"><img alt="'.lang("export").'" src="'.$image.'"></a>';
+									$col_data.='<a href="'.$link.'"><img alt="'.lang("export").'" title="'.lang("export").'" src="'.$image.'"></a>';
 								}
 							}
@@ -1347,14 +1341,14 @@
 					$this->messages[]=$GLOBALS['phpgw']->common->error_list(array(lang("File names cannot contain \\ or /")));
 				}
-				elseif(!$this->bo->vfs->mv(array(
+				elseif($this->verifyLock($from,RELATIVE_ALL) && $this->bo->vfs->mv(array(
 					'from'	=> $from,
 					'to'	=> $to
 				)))
 				{
+					$this->messages[]=lang('Renamed %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to);
+				}
+				else
+				{
 					$this->messages[]= $GLOBALS['phpgw']->common->error_list(array(lang('Could not rename %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to)));
-				}
-				else
-				{
-					$this->messages[]=lang('Renamed %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to);
 				}
 			}
@@ -1420,9 +1414,9 @@
 					{
 						$copied++;
-						$this->messages[] .= lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
+						$this->messages[] = lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
 					}
 					else
 					{
-						$this->messages[] .= lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
+						$this->messages[] = lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
 					}
 				}
@@ -1491,5 +1485,21 @@
 			}
 		}
-
+		function verifyLock($file,$relative){
+			$ls_array = $this->bo->vfs->ls(array(
+				'string'        => $file,
+				'relatives'     => array($relative),
+				'checksubdirs'  => False,
+				'nofiles'       => True
+			));
+			$timestamp = $this->dateString2timeStamp($ls_array[0]['modified']);
+			if (time() - $timestamp < 60 && $ls_array[0]['modifiedby_id'] != $GLOBALS['phpgw_info']['user']['account_id']) // recently than last minute: someone is editing
+			{
+				$this->messages[]=$GLOBALS['phpgw']->common->error_list(array(lang('This file is being edited right now by:').$GLOBALS['phpgw']->accounts->id2name($ls_array[0]['modifiedby_id'])));
+				return False;
+
+			}
+			else
+				return True;
+		}
 		function delete()
 		{
@@ -1498,5 +1508,5 @@
 				foreach($this->fileman as $filename)
 				{
-					if($this->bo->vfs->delete(array('string' => $filename)))
+					if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->delete(array('string' => $filename)))
 					{
 						$this->messages[]= lang('Deleted %1', $this->disppath.'/'.$filename).'<br/>';
@@ -1639,4 +1649,10 @@
 			if($this->file)
 			{
+				if (! $this->verifyLock($this->path.'/'.$this->file,RELATIVE_NONE)){
+					echo $this->messages['0'];
+					$GLOBALS['phpgw']->redirect('/index.php');
+
+					//$GLOBALS['phpgw']->common->phpgw_exit();
+				}
 				$ls_array = $this->bo->vfs->ls(array(
 					'string'        => $this->path.'/'.$this->file,
@@ -1645,11 +1661,5 @@
 					'nofiles'       => True
 				));
-				$timestamp = $this->dateString2timeStamp($ls_array[0]['modified']);
-				if (time() - $timestamp < 60 && $ls_array[0]['modifiedby_id'] != $GLOBALS['phpgw_info']['user']['account_id']) // recently than last minute: someone is editing
-				{
-					echo lang('This file is being edited right now by:').$GLOBALS['phpgw']->accounts->id2name($ls_array[0]['modifiedby_id']);
-					return False;
-					
-				}
+
 				$this->bo->vfs->touch(array(
 					'string'=> $this->path.'/'.$this->file,
@@ -1712,6 +1722,6 @@
 				//die( $content);
 				if($this->bo->vfs->write(array(
-					'string'	=> $this->edit_file,
-					'relatives'	=> array(RELATIVE_ALL),
+					'string'	=> $this->path.'/'.$this->edit_file,
+					'relatives'	=> array(RELATIVE_NONE),
 					'content'	=> $content
 				)))
Index: sandbox/filemanager/js/connector.js
===================================================================
--- sandbox/filemanager/js/connector.js	(revision 1575)
+++ sandbox/filemanager/js/connector.js	(revision 1590)
@@ -134,5 +134,5 @@
 				handler(Ajax.responseText);
 			else
-				alert("Erro temporario de conexÃ£o");
+				throw("Connection error!");
 	}
 
@@ -140,5 +140,5 @@
 	AjaxRequest();
 	if (!Ajax){
-		alert("Erro ao conectar-se");
+		throw("No connection");
 		return;
 	}
