Index: sandbox/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1791)
+++ sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1804)
@@ -31,4 +31,5 @@
 			'dir_ls' => True,
 			'search' => True,
+			'showUploadboxes' => True,
 			'uploadModel'=>True
 		);
@@ -69,5 +70,4 @@
 		var $edit_save_done_x;
 		var $edit_cancel_x;
-		var $upload_x;
 
 		// this ones must be checked thorougly;
@@ -78,5 +78,4 @@
 		var $sortby;
 		var $messages;
-		var $show_upload_boxes;
 
 		var $now;
@@ -347,4 +346,5 @@
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/draw_api.js'></script>";
+			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/drag_area.js'></script>";
 			include('load_lang.php');
 
@@ -412,41 +412,14 @@
 			}
 
-			# We determine if they're in their home directory or a group's directory,
-			# and set the VFS working_id appropriately
-			if((preg_match('+^'.$this->bo->fakebase.'\/(.*)(\/|$)+U', $this->path, $matches)) && $matches[1] != $this->bo->userinfo['account_lid']) //FIXME matches not defined
-
-			{
-				$this->bo->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id($matches[1]);//FIXME matches not defined
-
-			}
-			else
-			{
-				$this->bo->vfs->working_id = $this->bo->userinfo['username'];
-			}
-
-			# Check available permissions for $this->path, so we can disable unusable operations in user interface
-			$path = explode('/',$this->path);
-			$owner_id = $this->bo->vfs->ownerOf($this->bo->fakebase,$path[2]);
-			$user_id = $GLOBALS['phpgw_info']['user']['account_id'];
-			if ($owner_id == $user_id)
+			/*Check permission*/
+			if($this->bo->vfs->acl_check(array(
+				'string' => $this->path,
+				'relatives' => array(RELATIVE_NONE),
+				'operation' => PHPGW_ACL_READ
+			)))
 			{
 				$this->can_read = True;
-				$this->can_add = True;
-				$this->can_edit = True;
-				$this->can_delete = True;
-				$this->can_private = True;
-			}else
-			{
-				$acl = CreateObject ('phpgwapi.acl', $owner_id);
-				$acl->account_id = $owner_id;
-				$acl->read_repository();
-				$rights = $acl->get_rights($user_id);
-				$this->can_read = $rights & PHPGW_ACL_READ;
-				$this->can_add = $rights & PHPGW_ACL_ADD;
-				$this->can_edit = $rights & PHPGW_ACL_EDIT;
-				$this->can_delete = $rights & PHPGW_ACL_DELETE;
-				$this->can_private = $rights & PHPGW_ACL_PRIVATE;
-			}
-	
+			}
+
 			# if is different path than home and no permission allowed
 			if($this->path != $this->bo->homedir && $this->path != $this->bo->fakebase && $this->path != '/' && !$this->can_read)
@@ -503,8 +476,4 @@
 			{
 				$this->createdir();
-			}
-			elseif($this->upload_x || $this->show_upload_boxes)
-			{
-				$this->showUploadboxes();
 			}
 			elseif($this->copy_to_x)
@@ -907,4 +876,14 @@
 		function showUploadboxes()
 		{
+			$GLOBALS['phpgw_info']['flags'] = array
+				(
+					'currentapp'    => 'filemanager',
+					'noheader'      => True,
+					'nonavbar' => True,
+					'nofooter'      => True,
+					'noappheader'   => True
+				);
+			$GLOBALS['phpgw']->common->phpgw_header();
+
 			$this->t->set_file(array('upload' => 'upload.tpl'));
 			$this->t->set_block('upload','upload_header','upload_header');
@@ -912,5 +891,5 @@
 			$this->t->set_block('upload','upload_footer','upload_footer');
 
-			if($this->path != '/' && $this->path != $this->bo->fakebase && $this->can_add)
+			if($this->path != '/' && $this->path != $this->bo->fakebase)
 			{
 				$vars[max_size]=lang('Note: Uploaded is limited to %1MB',($this->current_config['filemanager_Max_file_size']));
Index: sandbox/filemanager/inc/upload.php
===================================================================
--- sandbox/filemanager/inc/upload.php	(revision 1745)
+++ sandbox/filemanager/inc/upload.php	(revision 1804)
@@ -31,5 +31,5 @@
 	if ($return == 1)
 	{
-		$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('One of the files sent was considered infected');
+		$_SESSION['response'] = serialize(array(0 => lang('Error:').lang('One of the files sent was considered infected')));
 		return;
 	}
@@ -41,5 +41,5 @@
 		if($badchar = $bo->bad_chars($_FILES['upload_file']['name'][$i], True, True))
 		{
-			$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('File names cannot contain "%1"', $badchar);
+			$return[] = lang('Error:').lang('File names cannot contain "%1"', $badchar);
 			continue;
 		}
@@ -59,5 +59,5 @@
 			if($fileinfo['mime_type'] == 'Directory')
 			{
-				$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']);
+				$return[] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']);
 				continue;
 			}
@@ -66,5 +66,5 @@
 		if ($_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024))
 		{
-			$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size);
+			$return[] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size);
 			continue;
 		}
@@ -94,6 +94,4 @@
 				);
 				$bo->vfs->cp($tmp_arr);
-
-				$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n";
 			}
 			else
@@ -114,9 +112,8 @@
 				));
 				else{
-					$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Your quota has exceeded the limit');
+					$return[] = lang('Error:').lang('Your quota has exceeded the limit');
 					return false;
 				}
 
-				 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($_FILES['upload_file']['size'][$i]))."\n";
 			}
 		}
@@ -137,7 +134,9 @@
 			));
 
-			 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($file_size[$i]))."\n";
-
 		}
 	}
+	if (count($return) > 0)
+		$_SESSION['response'] = serialize($return);
+	else
+		 $_SESSION['response'] = serialize( array( 0 => 'Ok' ) );
 ?>
