[20887] Fix attach file

Sigurd Nes <[email protected]>
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20887
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20887
Author:   sigurdne
Date:     2009-11-23 18:00:30 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Fix attach file

Modified Paths:
--------------
    modules/email/trunk/inc/class.boattach_file.inc.php

Modified: modules/email/trunk/inc/class.boattach_file.inc.php
===================================================================
--- modules/email/trunk/inc/class.boattach_file.inc.php	2009-11-23 08:33:35 UTC (rev 20886)
+++ modules/email/trunk/inc/class.boattach_file.inc.php	2009-11-23 18:00:30 UTC (rev 20887)
@@ -296,20 +296,21 @@
 					. lang('You must click %1 for the file to actually upload','"'.lang('Attach File').'"').'.<br />'
 					. '<br />';
 			}
-		
-			$dh = dir($uploaddir);
-			while ( false !== ($file = $dh->dir() ) )
+
+			$dh = dir($this->uploaddir);
+
+			while ( false !== ($file = $dh->read() ) )
 			{
 				if (($file != '.')
-				&& ($file != '..')
+					&& ($file != '..')
 					&& (preg_match('/\.info/', $file)))
 				{
-					$file_info = file("{$uploaddir}/{$file}");
-					
+					$file_info = file("{$this->uploaddir}/{$file}");
+
 					//get filesize in kb, but do not tell user a file is 0kb, because it is probably closer to 1kb
 					$real_file = str_replace('.info','',$file);
 
-					$real_file_size = (int) filesize("{$uploaddir}/{$real_file}");
+					$real_file_size = (int) filesize("{$this->uploaddir}/{$real_file}");
 					if ( $real_file_size / 1024 > 1 )
 					{
 						$real_file_size = ($real_file_size / 1024) . 'kb';
@@ -318,8 +319,8 @@
 					{
 						$real_file_size .= 'b';
 					}
-					
-					if ($fup_debug > 2) { echo 'FILE contents DUMP: <pre>'; print_r(file("{$uploaddir}/{$real_file}")); echo '</pre>'; } 
+
+					if ($fup_debug > 2) { echo 'FILE contents DUMP: <pre>'; print_r(file("{$this->uploaddir}/{$real_file}")); echo '</pre>'; } 
 					// for every file, fill the file list template with it
 					$GLOBALS['phpgw']->template->set_var('ckbox_delete_name', 'delete[]');
 					$GLOBALS['phpgw']->template->set_var('ckbox_delete_value', substr($file,0,-5));
@@ -438,4 +439,3 @@
 	
 	
 	}
-?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.