From 7b27d03ec7592d8904f5d212cd25dd6bf81579e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Nov 2010 09:15:20 +0000 Subject: [PATCH] Updated handling of uploaded files, thanks to bcooksley git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20244 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../ldapmanager/addons/ldapmanager/class_import.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/ldapmanager/addons/ldapmanager/class_import.inc b/gosa-plugins/ldapmanager/addons/ldapmanager/class_import.inc index 38f0a5aba..f00e7b2fd 100644 --- a/gosa-plugins/ldapmanager/addons/ldapmanager/class_import.inc +++ b/gosa-plugins/ldapmanager/addons/ldapmanager/class_import.inc @@ -60,6 +60,8 @@ class ldifimport extends plugin $smarty->assign("type","importfile"); $handle = NULL; + $filename = gosa_file_name($_FILES['userfile']['tmp_name']); + // Check if there is a file submitted if(!$_FILES['userfile']['size'] > 0 ) { @@ -68,7 +70,7 @@ class ldifimport extends plugin } // Is there a tmp file, which we can use ? - elseif(!file_exists($_FILES['userfile']['tmp_name'])) + elseif(!file_exists($filename)) { msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not found")), ERROR_DIALOG); $smarty->assign("LDIFError",TRUE); @@ -76,7 +78,7 @@ class ldifimport extends plugin } // Can we open the tmp file, for reading - elseif(!$handle = @fopen($_FILES['userfile']['tmp_name'],"r")) + elseif(!$handle = @fopen($filename,"r")) { msg_dialog::display(_("Error"), sprintf(_("Cannot read uploaded file: %s"), _("file not readable")), ERROR_DIALOG); $smarty->assign("LDIFError",TRUE); -- 2.30.2