Index: /sandbox/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1648)
+++ /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1678)
@@ -27,4 +27,5 @@
 created %1	filemanager	pt-br	Criado %1
 You have no permission to access this file	filemanager	pt-br	Você não tem permissão para acessar este arquivo
+The file sent was considered infected	filemanager	pt-br	O arquivo enviado foi considerado infectado por vírus
 no comments	filemanager	pt-br	sem comentários
 created %1,%2	filemanager	pt-br	Criado %1, %2
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 1678)
@@ -0,0 +1,123 @@
+<?php
+	/**************************************************************************\
+	* -------------------------------------------------------------------------*
+	* This library is free software; you can redistribute it and/or modify it  *
+	* under the terms of the GNU Lesser General Public License as published by *
+	* the Free Software Foundation; either version 2.1 of the License,         *
+	* or any later version.                                                    *
+	\**************************************************************************/
+
+	class uiconfig
+	{
+		var $public_functions = array(
+			'search_dir' => True,
+			'update_quota' => True,
+			'load_quota' => True,
+			'quota' => True
+		 );
+
+		function vfs_functions(){
+		}
+
+		 function quota(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => False,
+					 'nonavbar' => False,
+					 'nofooter'      => False,
+					 'noappheader'   => False,
+					 'enable_browser_class'  => True
+				 );
+
+			 $GLOBALS['phpgw']->common->phpgw_header();
+			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>";
+		 
+			echo "<script type='text/javascript'>
+				function loadq_handler(data){
+					document.getElementById('quota_size').value = data;
+		 }
+		function load_quota(el){
+			cExecute('/index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler);
+		 }
+		function save_quota(){
+			var dirName = document.getElementById('search1').value;
+			var Qsize = document.getElementById('quota_size').value;
+			cExecute('/index.php?menuaction=filemanager.uiconfig.update_quota&dir='+base64_encode(dirName)+'&val='+Qsize,alert);
+		 }
+		function dir_handler(data){
+			document.getElementById('search1').innerHTML = data;
+		 }
+		function search_dir(el){
+			if (el.value.length < 4){
+				document.getElementById('span_searching1').innerHTML = '".lang('Type at least 4 chars')."';
+		 }
+else
+{
+	document.getElementById('span_searching1').innerHTML = '';
+	cExecute('/index.php?menuaction=filemanager.uiconfig.search_dir&name='+el.value,dir_handler);
+		 }
+		 }
+				</script>";
+			 echo "<b>".lang('Directory')."</b><br><font color='red'><span id='span_searching1'>&nbsp;</span></font><br>".lang('Search').":<input value='' size='30' onkeyup='search_dir(this)' type='text'><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select id='search1' style='width:200px;' onclick='load_quota(this)' size='5'></select><br><br>Quota:<input id='quota_size' size='10' type='text'>mb<br><br><input onclick='save_quota()' type=button value=".lang('save').">";
+		 }
+		 function search_dir(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => True,
+					 'nonavbar' => True,
+					 'nofooter'      => True,
+					 'noappheader'   => True,
+					 'enable_browser_class'  => True
+				 );
+			 $name = $GLOBALS['phpgw']->db->db_addslashes($_GET['name']);
+			 $GLOBALS['phpgw']->db->query('SELECT DISTINCT directory FROM phpgw_vfs WHERE directory like \'%'.$name.'%\' LIMIT 20',__LINE__,__FILE__);
+			 while ($GLOBALS['phpgw']->db->next_record()){
+				 $val = $GLOBALS['phpgw']->db->row();
+				 echo "<option>".$val['directory']."</option>";
+			 }
+		 }
+		 function update_quota(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => True,
+					 'nonavbar' => True,
+					 'nofooter'      => True,
+					 'noappheader'   => True,
+					 'enable_browser_class'  => True
+				 );
+			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+			 $size = ($_GET['val'])*1;
+			 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs_quota SET quota_size = '.$size.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
+			 if ($GLOBALS['phpgw']->db->Error)
+				 echo "Erro";
+			 else
+				 echo lang('entry updated sucessfully');
+			 return; 
+
+		 }
+		 function load_quota(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => True,
+					 'nonavbar' => True,
+					 'nofooter'      => True,
+					 'noappheader'   => True,
+					 'enable_browser_class'  => True
+				 );
+			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['name']));
+			 $GLOBALS['phpgw']->db->query('SELECT quota_size FROM phpgw_vfs_quota WHERE directory = \''.$name.'\' LIMIT 1',__LINE__,__FILE__);
+			 $GLOBALS['phpgw']->db->next_record();
+			 $val =$GLOBALS['phpgw']->db->row();
+			 echo $val['quota_size'];
+			 return;
+
+		 }
+
+
+	}
+?>
Index: /sandbox/filemanager/inc/hook_admin.inc.php
===================================================================
--- /sandbox/filemanager/inc/hook_admin.inc.php	(revision 1529)
+++ /sandbox/filemanager/inc/hook_admin.inc.php	(revision 1678)
@@ -26,4 +26,6 @@
 	$file = Array(
 		'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
+		'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota'),
+
 	);
 //Do not modify below this line
Index: /sandbox/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- /sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1654)
+++ /sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1678)
@@ -1142,5 +1142,5 @@
 						 $max_size .= "M";
 
-					 $upload_max_filesize = str_replace("M","",$max_size) * 1024 * 1024;
+					$upload_max_filesize = str_replace("M","",$max_size) * 1024 * 1024;
 
 					if ($_FILES['upload_file']['size'][$i] > $upload_max_filesize)
@@ -1148,5 +1148,16 @@
 						$this->messages[]=lang('The size of %1 has exceded the limit: %2', $this->disppath.'/'.$_FILES['upload_file']['name'][$i], $max_size);
 					}
-					else
+					else if(strlen($this->current_config['filemanager_antivirus_command']) > 0)
+					{
+						$command = "nice -n19 ".$this->current_config['filemanager_antivirus_command']." ".$_FILES['upload_file']['tmp_name'][$i];
+						exec("bash -c ".escapeshellcmd(escapeshellarg($command)),$output,$return);
+						if ($return == 1)
+						{
+							$this->messages[]=lang('Error:').lang('The file sent was considered infected');
+							$this->readFilesInfo();
+			                                $this->filelisting();
+							return true;
+						}
+					}
 					if($_FILES['upload_file']['size'][$i] > 0)
 					{
@@ -1283,5 +1294,5 @@
 					else
 					{
-						$this->messages[] = lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
+						$this->messages[] = lang('Error:').lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file);
 					}
 				}
Index: /sandbox/filemanager/templates/default/config.tpl
===================================================================
--- /sandbox/filemanager/templates/default/config.tpl	(revision 1556)
+++ /sandbox/filemanager/templates/default/config.tpl	(revision 1678)
@@ -7,16 +7,23 @@
 <!-- END header -->
 <!-- BEGIN body -->
-    <tr bgcolor="{row_on}"> 	 	 
-    <td>{lang_Max_file_size}</td> 	 	 
-    <td> 	 	 
+    <tr bgcolor="{row_on}">
+    <td>{lang_Max_file_size}</td>
+    <td>
     <input size="1" name="newsettings[filemanager_Max_file_size]" value="{value_filemanager_Max_file_size}">&nbsp;Mb
     </td>
     </tr>
-    <tr bgcolor="{row_off}">              
-    <td>{lang_quota_size}</td>                
-    <td>                 
+    <tr bgcolor="{row_off}">
+    <td>{lang_quota_size}</td>
+    <td>
     <input size="2" name="newsettings[filemanager_quota_size]" value="{value_filemanager_quota_size}">&nbsp;Mb
     </td>
     </tr>
+    <tr bgcolor="{row_on}">
+    <td>{lang_antivirus_command}</td>    
+    <td>
+    <input size="50" name="newsettings[filemanager_antivirus_command]" value="{value_filemanager_antivirus_command}">
+    </td>
+    </tr>
+
 <!-- END body -->
 <!-- BEGIN footer -->
