fix import of ical files

redirect after import still not working(tested with IE6)
This commit is contained in:
Lars Kneschke 2003-10-11 19:17:50 +00:00
parent d8692a29f7
commit 3e6870eb77

View File

@ -2895,7 +2895,7 @@ class boicalendar
function import_file() function import_file()
{ {
if($GLOBALS['uploadedfile'] == 'none' || $GLOBALS['uploadedfile'] == '') if($_FILES['uploadedfile']['tmp_name'] == 'none' || $_FILES['uploadedfile']['tmp_name'] == '')
{ {
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php', Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',
Array( Array(
@ -2910,12 +2910,12 @@ class boicalendar
srand((double)microtime()*1000000); srand((double)microtime()*1000000);
$random_number = rand(100000000,999999999); $random_number = rand(100000000,999999999);
$newfilename = md5($GLOBALS['uploadedfile'].", ".$uploadedfile_name.", " $newfilename = md5($_FILES['uploadedfile']['tmp_name'].", ".$uploadedfile_name.", "
. time() . getenv("REMOTE_ADDR") . $random_number ); . time() . getenv("REMOTE_ADDR") . $random_number );
$filename = $uploaddir . $newfilename; $filename = $uploaddir . $newfilename;
copy($GLOBALS['uploadedfile'], $filename); move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filename);
// $ftp = fopen($uploaddir . $newfilename . '.info','wb'); // $ftp = fopen($uploaddir . $newfilename . '.info','wb');
// fputs($ftp,$uploadedfile_type."\n".$uploadedfile_name."\n"); // fputs($ftp,$uploadedfile_type."\n".$uploadedfile_name."\n");
// fclose($ftp); // fclose($ftp);
@ -2924,7 +2924,7 @@ class boicalendar
function import($mime_msg='') function import($mime_msg='')
{ {
if($GLOBALS['uploadedfile'] != 'none' && $GLOBALS['uploadedfile'] != '') if($_FILES['uploadedfile']['tmp_name'] != 'none' && $_FILES['uploadedfile']['tmp_name'] != '')
{ {
$filename = $this->import_file(); $filename = $this->import_file();
$fp=fopen($filename,'rt'); $fp=fopen($filename,'rt');