Index: sandbox/filemanager/inc/class.uiconfig.inc.php
===================================================================
--- sandbox/filemanager/inc/class.uiconfig.inc.php	(revision 1678)
+++ sandbox/filemanager/inc/class.uiconfig.inc.php	(revision 1726)
@@ -32,4 +32,5 @@
 
 			 $GLOBALS['phpgw']->common->phpgw_header();
+			include('load_lang.php');
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>";
Index: sandbox/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1719)
+++ sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1726)
@@ -31,4 +31,5 @@
 			'dir_ls' => True,
 			'get_permissions' => True,
+			'search' => True,
 			'uploadModel'=>True
 		);
@@ -52,12 +53,9 @@
 		var $groups_applications;
 
-		//originally post_vars
-		//		var $goto;
 		var $current_config;
-		var $goto_x;
+		var $dirs;
 		var $to;
 		var $changedir; // for switching dir.
 		var $cdtodir; // for switching dir.
-//		var $createdir;
 		var $newfile_or_dir;
 		var $newdir_x;
@@ -65,5 +63,4 @@
 		var $createfile_var;
 		var $move_to_x;
-//		var $copy_to;
 		var $copy_to_x;
 		var $edit_x;
@@ -252,5 +249,4 @@
 
 			}
-			
 		}
 		function fileModels()
@@ -407,27 +403,5 @@
 			}
 
-			# Get their readable groups to be used throughout the script
-			$acl = array();
-			$groups = array();
-			$acl = $GLOBALS['phpgw']->acl->get_ids_for_location($GLOBALS['phpgw_info']['user']['account_id'],1,'filemanager');
-	 		if (is_array($acl))
-				foreach($acl as $key => $value){
-					$info = array();
-					$info = $GLOBALS['phpgw']->accounts->get_account_data($value);
-					$groups[$key]['account_id'] = $value;
-					$groups[$key]['account_lid'] = $info[$value]['lid'];
-					$groups[$key]['account_name'] = $info[$value]['firstname'];
-					$groups[$key]['account_lastname'] = $info[$value]['lastname'];
-					$groups[$key]['account_fullname'] = $info[$value]['fullname'];
-				}
-			$this->readable_groups = array();
-			while(list($num, $account) = each($groups))
-			{
-				if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ)))
-				{
-					$this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']);
-				}
-			}
-
+			$this->update_groups();	
 			$this->groups_applications = array();
 
@@ -692,14 +666,11 @@
 
 				// selectbox for change/move/and copy to
-				$dirs=$this->all_other_directories_options();
-				foreach($dirs as $elem)
+				$this->dirs=$this->all_other_directories();
+				foreach($this->dirs as $elem)
 					$vars[folders].='<br><span onclick="load(\''.$elem['directory'].$elem['name'].'\')" class="l" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'">'.$elem['name'].'</span>';
 				
 
-				// copy and move buttons
-				//if($this->path != '/' && $this->path != $this->bo->fakebase){}
-
-				$dirs=$this->all_other_directories_options();
-				foreach($dirs as $dir)
+				$this->dirs=$this->all_other_directories();
+				foreach($this->dirs as $dir)
 					if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE))))
 					{
@@ -1054,6 +1025,8 @@
 
 				if(!in_array($mime_type,$editable)){
-					echo lang('Impossbile to edit this file');
-					return False;
+					$this->messages[] = lang('Error:').lang('Impossible to edit this file');
+					$this->readFilesInfo();
+					$this->fileListing();
+					return;
 				}
 			}
@@ -1106,5 +1079,4 @@
 				else
 				{
-					echo lang('Could not save %1', $this->path.'/'.$this->edit_file);
 					$this->messages[]=lang('Could not save %1', $this->path.'/'.$this->edit_file);
 				}
@@ -1236,6 +1208,8 @@
 			)))
 			{
-				echo lang("You have no permission to access this file");
-				return false;
+				$this->messages[] = lang("You have no permission to access this file");
+				header('Location:'.$this->encode_href('inc/index.php?menuaction=filemanager.uifilemanager.index','&path='.base64_encode($this->bo->homedir)));
+
+				return;
 			}
 			if($this->file) //FIXME
@@ -1247,8 +1221,4 @@
 					'nofiles'	=> True
 				));
-				if ($ls_array[0]['size'] > 4194304){
-					header('Location:'.$this->encode_href('inc/download.php','file='.base64_encode($this->file).'&path='.base64_encode($this->path)));
-					return;
-				}
 				if($ls_array[0]['mime_type'])
 				{
@@ -1265,17 +1235,17 @@
 					/*Note: if you put application/octet-stream you force download */
 					header('Content-type: ' . $mime_type);
-					header('Content-disposition: filename="' . $this->file . '"');//FIXME
+					header('Content-disposition: filename="' . addslashes($this->file) . '"');
 					Header("Pragma: public");
 				}
 				else
 				{
-					$GLOBALS['phpgw']->browser->content_header($this->file,$mime_type);//FIXME
-				}
- 
-
-				echo $this->bo->vfs->read(array(
-					'string'	=> $this->path.'/'.$this->file,//FIXME
-					'relatives'	=> array(RELATIVE_NONE)
-				));
+					$GLOBALS['phpgw']->browser->content_header($this->file,$mime_type,$ls_array[0]['size']);
+				}
+				$this->bo->vfs->print_content(array(
+					'string' => $this->path.'/'.$this->file,
+					'relatives' => array(RELATIVE_NONE)
+				)
+			);
+
 				$GLOBALS['phpgw']->common->phpgw_exit();
 			}
@@ -1299,5 +1269,5 @@
 				$formats = array('text/html');
 				if(!in_array($mime_type,$formats)){
-					echo lang('Impossbile to export this file');
+					echo lang('Impossible to export this file');
 					return False;
 				}
@@ -1318,5 +1288,5 @@
 
 		//give back an array with all directories except current and dirs that are not accessable
-		function all_other_directories_options()
+		function all_other_directories()
 		{
 			# First we get the directories in their home directory
@@ -1382,4 +1352,62 @@
 		}
 
+		function update_groups()
+		{
+			# Get their readable groups to be used throughout the script
+			$acl = array();
+			$groups = array();
+			$acl = $GLOBALS['phpgw']->acl->get_ids_for_location($GLOBALS['phpgw_info']['user']['account_id'],1,'filemanager');
+			if (is_array($acl))
+				foreach($acl as $key => $value){
+					$info = array();
+					$info = $GLOBALS['phpgw']->accounts->get_account_data($value);
+					$groups[$key]['account_id'] = $value;
+					$groups[$key]['account_lid'] = $info[$value]['lid'];
+					$groups[$key]['account_name'] = $info[$value]['firstname'];
+					$groups[$key]['account_lastname'] = $info[$value]['lastname'];
+					$groups[$key]['account_fullname'] = $info[$value]['fullname'];
+				}
+			$this->readable_groups = array();
+			while(list($num, $account) = each($groups))
+			{
+				if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ)))
+				{
+					$this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']);
+				}
+			}
+
+		}
+		function search()
+		{
+			/* TODO this is a primitive search */
+			$this->update_groups();
+       			$this->dirs = $this->all_other_directories();
+			$path = $this->path;
+			if (strlen($this->text) > 3)
+			{                                                                
+				$this->text = strtoupper($this->text);
+				foreach($this->dirs as $elem)
+				{
+					$this->path = $elem['directory'].$elem['name'];
+					reset($this->files_array);
+		                        $this->readFilesInfo();
+					for($i = 0; $i < count($this->files_array); $i++)
+					{
+						$comment = strtoupper($this->files_array[$i]['comment']);
+						$name = strtoupper($this->files_array[$i]['name']);
+						if (strstr($name,$this->text) ||
+						strstr($comment,$this->text) )
+							$return[$this->files_array[$i]['directory'].$name] = $this->files_array[$i];
+					}
+					if (count($return) > 50)
+					{
+						$return = array_slice($return,0,50);
+						break;
+					}
+				}	
+			}
+			echo serialize(array_values($return));
+		}
+
 		/* seek icon for mimetype else return an unknown icon */
 		function mime_icon($mime_type, $size=16)
Index: sandbox/filemanager/inc/.htaccess
===================================================================
--- sandbox/filemanager/inc/.htaccess	(revision 1704)
+++ sandbox/filemanager/inc/.htaccess	(revision 1726)
@@ -1,2 +1,2 @@
-php_value post_max_size 1G
-php_value upload_max_filesize 1G
+php_value post_max_size 1300M
+php_value upload_max_filesize 1300M
Index: sandbox/filemanager/inc/download.php
===================================================================
--- sandbox/filemanager/inc/download.php	(revision 1704)
+++ 	(revision )
@@ -1,27 +1,0 @@
-<?php
-/* This single file is used to increase memory_limit using .htaccess*/
-if(!isset($GLOBALS['phpgw_info'])){
-	$GLOBALS['phpgw_info']['flags'] = array(
-		'currentapp' => 'filemanager',
-		'nonavbar'   => true,
-		'noheader'   => true
-	);
-}
-require_once '../../header.inc.php';
-
-$bo = CreateObject('filemanager.bofilemanager');
-$path = base64_decode($_GET['path']);
-$file = base64_decode($_GET['file']);
-
-if($file)
-{
-	//$GLOBALS['phpgw']->browser->content_header($file);
-	header ("Content-Type: application/octet-stream");
-	header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
-	header("Pragma: public");
-	header("Expires: 0");
-	header ("Content-Disposition: attachment; filename=\"". addslashes($file)."\"");
-	$bo->vfs->print_content(array('string' => $file));
-	$GLOBALS['phpgw']->common->phpgw_exit();
-}
-?>
