Browse Source

Changed temp file write to from due to leftover file possiblity, At least they will all be in the same dir. Also clarified some instructions.

lbergman 25 years ago
parent
commit
fc46afcf9a
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/addressbook_csvimport.php

+ 5 - 5
src/addressbook_csvimport.php

@@ -81,7 +81,7 @@
    if($flag <= 1) {                                      // If first run of script, setup the filename to copy
    if($flag <= 1) {                                      // If first run of script, setup the filename to copy
       $tempfilename = ($username . (time()+2592000));
       $tempfilename = ($username . (time()+2592000));
       $nameholder = $tempfilename;
       $nameholder = $tempfilename;
-      if(copy($smusercsv, "$data_dir$tempfilename")) {	// Set up variable to use in printing status
+      if(copy($smusercsv, "$attachment_dir$tempfilename")) {	// Set up variable to use in printing status
          $goodcopy = true;
          $goodcopy = true;
       } else {
       } else {
          $goodcopy = false;
          $goodcopy = false;
@@ -105,7 +105,7 @@
 	   echo "   </TR>\n";
 	   echo "   </TR>\n";
 	   echo "   <TR>\n";
 	   echo "   <TR>\n";
 	   echo "      <TD>";
 	   echo "      <TD>";
-	   if(!$goodcopy && $flag == 0) {			// print correct status of file copying
+	   if(!$goodcopy && $flag == 0) {			            // print correct status of file copying
 	      echo _("Failed to create working copy, Please try again.");
 	      echo _("Failed to create working copy, Please try again.");
 	   } else {
 	   } else {
 	      echo _("Created working copy, continuing with process...");
 	      echo _("Created working copy, continuing with process...");
@@ -157,9 +157,9 @@
 
 
    // open the correct filename to work with
    // open the correct filename to work with
 	if($flag <= 1) {                            // before submit
 	if($flag <= 1) {                            // before submit
-	   $fp = fopen("$data_dir$tempfilename", "r");
+	   $fp = fopen("$attachment_dir$tempfilename", "r");
 	} elseif($flag >= 2) {                      // after submit
 	} elseif($flag >= 2) {                      // after submit
-	   $fp = fopen("$data_dir$nameholder", "r");
+	   $fp = fopen("$attachment_dir$nameholder", "r");
 	}
 	}
 
 
 	echo "<CENTER><TABLE WIDTH=\"95%\" FRAME=\"void\" CELLSPACING=\"1\">\n";	// user's data table
 	echo "<CENTER><TABLE WIDTH=\"95%\" FRAME=\"void\" CELLSPACING=\"1\">\n";	// user's data table
@@ -400,7 +400,7 @@
 
 
    // Clean up after ourselves.
    // Clean up after ourselves.
    if($finish) {
    if($finish) {
-      unlink ("$data_dir$tempfilename");
+      unlink ("$attachment_dir$tempfilename");
    }
    }
    
    
 ?>
 ?>