0) : $specialUserTypeIsLoggedIn = true; list($specialUserType, $specialUserHqId, $specialUserFTPServerList, $objType, $objId, $specialUserDirSpecialForObjType) = $userTypesSpecialArray; endif; // Check for authentication access $hasRightUpload = false; $hasRightDownload = false; $specialStaticDirActive = false; if ($specialUserTypeIsLoggedIn) : $specialStaticDirActive = true; $specialFTPServerList = $specialUserFTPServerList; // $hasRightUpload = true; // $hasRightDownload = true; elseif ($userType == $userTypeRAMP) : $specialStaticDirActive = true; $specialFTPServerList = "ITCS"; // $hasRightUpload = true; // $hasRightDownload = true; elseif ($userTypeName == "cs") : $usrAccessArray["cs"] = "1"; authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual); $hasRightDownload = authCheckEmployeeRights($emp_id, "11"); if (!$hasRightDownload) : gotoReferer("1"); endif; // Check existence of object type AND object id if ($objType == "" || $objId == "") : gotoReferer("1"); endif; // Set object type to "JB" in every case of customer access $objType = "JB"; // Deactivate menu (!!!!) $deactivateMenuStatic = "1"; elseif ($userTypeName == "hq") : $usrAccessArray["hq"] = "1"; authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual); $hasRightUpload = authCheckEmployeeRights($emp_id, "22"); $hasRightDownload = authCheckEmployeeRights($emp_id, "23"); if (!($hasRightUpload || $hasRightDownload)) : gotoReferer("1"); endif; endif; $empHasAdminRights = false; $empIdRootAdmin = getEmpIdOfRootAdmin($userTypeName); if ($empIdRootAdmin != "" && $emp_id == $empIdRootAdmin) : $empHasAdminRights = true; if ($userTypeName == "hq") : $hasRightUpload = true; $hasRightDownload = true; endif; endif; getLanguage(__FILE__); $pageTitel = getLngt("DATENIMPORT"); include_once ("../admin/menu.php"); include_once ("../include/html.inc.php"); include_once ("../include/ftp.inc.php"); getCurrentScript(__FILE__); $debug = false; if ($empIdRootAdmin == $emp_id) : $debug = false; endif; $statusMessage = ""; $importFileStatusMsg = ""; $pageHeadline = getLngt("Allgemeine Dokumente"); // Set root directory regarding the current mandator $rootDirDefault = "../import/upload/"; $rootDirDefaultLen = strlen($rootDirDefault); $mdRootDirDefault = getFieldValueFromId("mandator","md_id",$md_id,"md_doc_path"); if ($mdRootDirDefault != "" && substr($mdRootDirDefault, 0,$rootDirDefaultLen) == $rootDirDefault) : $rootDirDefault = $mdRootDirDefault; else : gotoReferer("1"); endif; $rootDirDefaultLen = strlen($rootDirDefault); // Set enforced object type regarding to some user types if object type is empty if ($userTypeName != "hq" && $objType == "") : if ($userTypeName == "cs") : $objType = "CS"; endif; if ($userTypeName == "cr") : $objType = "CR"; endif; if ($userTypeName == "crvh") : $objType = "CRVH"; endif; if ($userTypeName == "jb") : $objType = "JB"; endif; if ($userTypeName == "emp") : $objType = "EMP"; endif; if ($f_act == "uploadFile" && !$specialStaticDirActive) : $f_act = ""; endif; endif; // For form parameters only if ($f_act == "uploadFile") : $objType = $objType_upload; $objId = $objId_upload; endif; // Map $objType from "CSC" TO "CS" and change object ID containing the "csc_id" to the corresponding "cs_id" $objType = strtoupper(trim($objType)); if ($objType == "CSC_CS" && $objId != "" && is_numeric($objId)) : $objType = "CS"; $objId = getFieldValueFromId("costcenter","csc_id",$objId,"cs_id"); endif; // * SECURITY BEGIN * // Restriction: Set a fix object type regarding to the uset type if ($userType == $userTypeRAMP) : $objType = "RAMP"; endif; // * SECURITY END * if ($debug) : echo "objType : " . $objType . "
"; endif; // Set current directory and check for special object type (e.g. customer = "cs") to define a special subdirectory to be "root" if ($docLocalDirCurrentUpload != "") : if ($docLocalDirCurrentUpload != "" && substr($docLocalDirCurrentUpload, 0,$rootDirDefaultLen) == $rootDirDefault) : $docLocalDirCurrent = $docLocalDirCurrentUpload; else : gotoReferer("1"); endif; endif; if ($objType != "") : $dirSpecialForObjType = getParameterValue("0", "DATATRANSFER_DIRECTORY_" . $objType, $hq_id); if ($dirSpecialForObjType == "") : $dirSpecialForObjType = getParameterValue("0", "DATATRANSFER_DIRECTORY_" . $objType, "0"); endif; if ($dirSpecialForObjType == "") : if ($objType == "CS") : $dirSpecialForObjType = "90b1a8efc903576bbb2d6e2a79b00a5e"; endif; if ($objType == "CR") : $dirSpecialForObjType = "f697836ccbee1a08ff752f5510049f6e"; endif; if ($objType == "JB") : $dirSpecialForObjType = "a547bc4b2a91355a3aba3ed0827cf6f2"; endif; if ($objType == "EMP") : $dirSpecialForObjType = "yxj5fr3gz7uau378cf4gh2fcnh67i7gh"; endif; if ($objType == "CRVH") : $dirSpecialForObjType = "7bb0357ar00a5u89ob1e3c9b2d6e2a79"; endif; if ($objType == "RAMP") : $dirSpecialForObjType = "traffic_control"; endif; // Special user type logged in if ($specialUserTypeIsLoggedIn) : $dirSpecialForObjType = $specialUserDirSpecialForObjType; endif; endif; $dirSpecialForObjType .= "/"; // Get parameter for usage the headquarters as sub-paths $parUseHqPath = getParameterValue("0", "DATATRANSFER_HQ_PATH_" . $objType . "_ENABLED", $hq_id); if ($parUseHqPath == "") : $parUseHqPath = getParameterValue("0", "DATATRANSFER_HQ_PATH_" . $objType . "_ENABLED", "0"); endif; // Check for filter according to specified object type and object ID $fileFilterPrefix = ""; if ($objId != "" && is_numeric($objId)) : if ($objType == "CS") : $fileFilterPrefix = getFieldValueFromId("customer","cs_id",$objId,"cs_eid"); $cmpId = getFieldValueFromId("customer","cs_id",$objId,"cmp_id"); if ($cmpId != "") : $cmpComp = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp"); $cmpComp2 = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp2"); $pageHeadline = "" . getLngt("KUNDE") . "    " . $fileFilterPrefix . " :: " . $cmpComp . ($cmpComp2 != "" ? " :: " . $cmpComp2 : ""); endif; endif; if ($objType == "CR") : $fileFilterPrefix = getFieldValueFromId("courier","cr_id",$objId,"cr_eid"); $cmpId = getFieldValueFromId("courier","cr_id",$objId,"cmp_id"); if ($cmpId != "") : $cmpComp = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp"); $cmpComp2 = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp2"); $pageHeadline = "" . getLngt("TRANSPORTEUR") . "    " . $fileFilterPrefix . " :: " . $cmpComp . ($cmpComp2 != "" ? " :: " . $cmpComp2 : ""); endif; endif; if ($objType == "JB") : $fileFilterPrefix = $objId; endif; if ($objType == "EMP") : $fileFilterPrefix = $objId; endif; if ($objType == "CRVH") : $fileFilterPrefix = $objId; endif; if ($objType == "RAMP") : $fileFilterPrefix = $hq_id; endif; endif; // Check for headquartes if ($hq_id != "" && $parUseHqPath == "1") : $hqMnemonic = getFieldValueFromId("headquarters","hq_id",$hq_id,"hq_mnemonic"); if ($hqMnemonic == "") : $hqMnemonic = "MISC" ; endif; $dirSpecialForObjType .= $hqMnemonic . "/"; endif; endif; if ($docLocalDirCurrent == "") : $docLocalDirCurrent = $rootDirDefault; $docLocalDirCurrent .= $dirSpecialForObjType; endif; // Set current root dir $rootDirCurrent = $rootDirDefault . $dirSpecialForObjType; $rootDirCurrentLen = strlen($rootDirCurrent); $docLocalDirCurrentLen = strlen($docLocalDirCurrent); $dirSpecialForObjTypeLen = strlen($dirSpecialForObjType); $fileFilterPrefixLen = strlen($fileFilterPrefix); // Set FTP or SFTP if ($f_ftp_ssl == "") : $f_ftp_ssl = ""; endif; // Get existing FTP server names AND/OR import types if ($specialStaticDirActive) : $ftpServerList = $specialFTPServerList; else : $ftpServerList = getParameterValue("0", "FTP_IMPORT_SERVERLIST", $hq_id); if ($ftpServerList == "") : $ftpServerList = getParameterValue("0", "FTP_IMPORT_SERVERLIST", "0"); endif; endif; $ftpServerListArray = array(); $ftpCurrentSelectedServerAccess = false; if ($userTypeName == "hq" || $specialStaticDirActive) : if ($ftpServerList != "") : // Get the list of remote (S)FTP servers // $ftpServerListArray = spliti(",",$ftpServerList); // Check for accessability by admin only $tmpFtpServerListArray = spliti(",",$ftpServerList); $tmpFtpServerListArrayLen = count($tmpFtpServerListArray); for ($j = 0; $j < $tmpFtpServerListArrayLen; $j++) : // Check item to be displayed for all or for admin only $ftpAdminAccessState = getParameterValue("0", "FTP_DISPLAY_ADMIN_ONLY_" . $tmpFtpServerListArray[$j], "0"); if ($ftpAdminAccessState != "1" || $empHasAdminRights) : $ftpServerListArray[] = $tmpFtpServerListArray[$j]; endif; // Check parameter for current item to to have access rights for remote server if ($f_ftp_servername != "" && $tmpFtpServerListArray[$j] == $f_ftp_servername) : $ftpAdminAccessState = getParameterValue("0", "FTP_ACCESS_ADMIN_ONLY_" . $tmpFtpServerListArray[$j], "0"); if ($ftpAdminAccessState != "1" || $empHasAdminRights) : $ftpCurrentSelectedServerAccess = true; endif; endif; endfor; endif; endif; $ftpServerListArrayLen = count($ftpServerListArray); // If ONLY ONE item does exist AND this entry does NOT having an association to a FTP data set then preselect it if ($ftpServerListArrayLen == 1 && $f_ftp_servername == "" && $ftp_server == "") : $f_ftp_servername = $ftpServerListArray[0]; endif; // Get FTP access data // "$f_ftp_servername" contains the FTP server name AND/OR the "IMPORT TYPE" (UTA, APO, ...) NOT being associated to a FTP data set stringently (!!!) if ($f_ftp_servername != "" && $ftp_server == "") : $ftp_server = getParameterValue("0", "FTP_SERVER_" . $f_ftp_servername, $hq_id); if ($ftp_server == "") : $ftp_server = getParameterValue("0", "FTP_SERVER_" . $f_ftp_servername, "0"); endif; if ($ftp_server != "") : $ftp_user_name = getParameterValue("0", "FTP_USER_" . $f_ftp_servername, $hq_id); if ($ftp_user_name == "") : $ftp_user_name = getParameterValue("0", "FTP_USER_" . $f_ftp_servername, "0"); endif; $ftp_user_pass = getParameterValue("0", "FTP_PASSWORD_" . $f_ftp_servername, $hq_id); if ($ftp_user_pass == "") : $ftp_user_pass = getParameterValue("0", "FTP_PASSWORD_" . $f_ftp_servername, "0"); endif; $ftp_path_dest = ""; if ($ftpCurrentSelectedServerAccess) : $ftp_path_dest = getParameterValue("0", "FTP_REMOTEPATH_" . $f_ftp_servername, $hq_id); if ($ftp_path_dest == "") : $ftp_path_dest = getParameterValue("0", "FTP_REMOTEPATH_" . $f_ftp_servername, "0"); endif; if ($ftp_path_dest != "") : // Check subpath especially defined each customer $remoteSubPath = getParameterValue("0", "FTP_REMOTEPATH_" . $f_ftp_servername . "_" . $objType . "_" . $objId, "0"); if ($remoteSubPath != "") : $ftp_path_dest .= $remoteSubPath; endif; endif; endif; endif; endif; if ($debug) : echo "ftpServerList : " . $ftpServerList . "
"; echo "ftp_server : " . $ftp_server . "
"; echo "f_ftp_servername : " . $f_ftp_servername . "
"; echo "ftp_user_name : " . $ftp_user_name . "
"; echo "ftp_user_pass : " . $ftp_user_pass . "
"; echo "

"; endif; // !!!!!!! TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /* INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104137, 'FTP_SERVERNAME_UTA', 0, 0, 'UTA', 'FTP server name for UTA'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104127, 'FTP_SERVER_UTA', 0, 0, 'server', 'FTP server for UTA'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104128, 'FTP_USER_UTA', 0, 0, 'u1234567890', 'FTP user for UTA'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104129, 'FTP_PASSWORD_UTA', 0, 0, 'asds1234', 'FTP password for UTA'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104130, 'FTP_REMOTEPATH_UTA', 0, 0, '/uppath/', 'FTP upload path where files will be stored for UTA'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104138, 'FTP_SERVERNAME_AS2_TRANSFER', 0, 0, 'AS2_TRANSFER', 'FTP server name for AS2_TRANSFER'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104132, 'FTP_SERVER_AS2_TRANSFER', 0, 0, '172.16.0.155', 'FTP server for AS2_TRANSFER'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104133, 'FTP_USER_AS2_TRANSFER', 0, 0, 'anonymous', 'FTP user for AS2_TRANSFER'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104134, 'FTP_PASSWORD_AS2_TRANSFER', 0, 0, '', 'FTP password for AS2_TRANSFER'); INSERT INTO parameter (par_id, par_key, hq_id, emp_id, par_value, par_text) VALUES (104135, 'FTP_REMOTEPATH_AS2_TRANSFER', 0, 0, '/download/', 'FTP remote path where files will be stored for AS2_TRANSFER'); if ($f_ftp_servername == "") : $ftp_server = FTP_SERVER; $ftp_user_name = FTP_USER; $ftp_user_pass = FTP_PASSWORD; $ftp_path_dest = FTP_UPLOADPATH; endif; */ // !!!!!!! TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $ftp_path_dest = trim($ftp_path_dest); if ($ftp_path_dest != "") : $ftp_path_dest = urldecode($ftp_path_dest); endif; if (substr($ftp_path_dest,0,1) == "/" && substr($ftp_path_dest,-1) == "/") : $ftp_path_dest = substr($ftp_path_dest,1,-1); endif; // Get number of files in the upload folder $numOfFiles = getNumOfFilesInFolder($docLocalDirCurrent); if ($debug) : echo "rootDirDefault : " . $rootDirDefault . " [Länge: " . $rootDirDefaultLen . "]
"; echo "rootDirCurrent : " . $rootDirCurrent . " [Länge: " . $rootDirCurrentLen . "]
"; echo "docLocalDirCurrent : " . $docLocalDirCurrent . " [Länge: " . $docLocalDirCurrentLen . "]
"; echo "dirSpecialForObjType : " . $dirSpecialForObjType . " [Länge: " . $dirSpecialForObjTypeLen . "]
"; echo "fileFilterPrefix : " . $fileFilterPrefix . " [Länge: " . $fileFilterPrefixLen . "]
"; echo "numOfFiles : " . $numOfFiles . "
"; echo "f_ftp_servername_upload : " . $f_ftp_servername_upload . "
"; echo "ftpServerList : " . $ftpServerList . "
"; echo "f_ftp_servername : " . $f_ftp_servername . "
"; echo "ftp_path_dest : " . $ftp_path_dest . "
"; echo "
"; endif; // Process uploaded file per HTTP if ($f_act == "uploadFile") : $processUpload = true; // Check for max. of ALL files in path if ($processUpload) : $parMaxFiles = getParameterValue("0", "DATATRANSFER_MAX_ALL_FILES_DIRECTORY_" . $objType, $hq_id); if ($parMaxFiles == "" || !is_numeric($parMaxFiles)) : $parMaxFiles = getParameterValue("0", "DATATRANSFER_MAX_ALL_FILES_DIRECTORY_" . $objType, "0"); endif; if ($parMaxFiles == "" || !is_numeric($parMaxFiles)) : $parMaxFiles = 500; endif; if ($numOfFiles >= $parMaxFiles) : $processUpload = false; endif; endif; // Check for max. of files of the current customer in path if ($processUpload && $fileFilterPrefix != "") : $parMaxFiles = getParameterValue("0", "DATATRANSFER_MAX_FILES_SPECIAL_" . $objType, $hq_id); if ($parMaxFiles == "" || !is_numeric($parMaxFiles)) : $parMaxFiles = getParameterValue("0", "DATATRANSFER_MAX_FILES_SPECIAL_" . $objType, "0"); endif; if ($parMaxFiles == "" || !is_numeric($parMaxFiles)) : $parMaxFiles = 3; endif; $objNumOfFiles = getNumOfFilesByFilterInFolder($docLocalDirCurrent, $fileFilterPrefix, "1"); if ($objNumOfFiles >= $parMaxFiles) : $processUpload = false; endif; endif; // Check for employee rights. Administrators have no restrictions regarding the number of files if ($empHasAdminRights) : $processUpload = true; endif; if ($processUpload) : if ($_FILES['f_uploadFile']['size'] <= 4000000) : // Append filename for prefix if e.g. a special customer (courier, etc.) has been selected $uploadPrefix = ""; if ($fileFilterPrefix != "" && substr($_FILES['f_uploadFile']['tmp_name'],0,$fileFilterPrefixLen) != $fileFilterPrefix) : $uploadPrefix = $fileFilterPrefix . "_"; endif; // Target filename $uploadTargetFilename = $_FILES['f_uploadFile']['name']; // Check prefix of the imported file to be renamed automatically for script execution $parPrefixRename = getParameterValue("0", "DATATRANSFER_UPLOAD_PREFIX_RENAME", $hq_id); if ($parPrefixRename == "") : $parPrefixRename = getParameterValue("0", "DATATRANSFER_UPLOAD_PREFIX_RENAME", "0"); endif; if ($parPrefixRename != "") : $prefixArray = explode(",", $parPrefixRename); $uploadTargetFilename = str_replace($prefixArray[0], $prefixArray[1], $uploadTargetFilename); endif; if (!move_uploaded_file($_FILES['f_uploadFile']['tmp_name'], $docLocalDirCurrent . $uploadPrefix . $uploadTargetFilename)) : $statusMessage .= getLngt("Die Datei wurde leider nicht hochgeladen!"); writeToLogDB("97",$hq_id,"",$usr_id,"","","","FILE=" . $_FILES['f_uploadFile']['name'] . "|STATUS=NO_UPLOAD"); else : writeToLogDB("97",$hq_id,"",$usr_id,"","","","FILE=" . $_FILES['f_uploadFile']['name'] . "|STATUS=OK"); endif; else : $statusMessage .= getLngt("Die Datei ist für den Upload zu groß!"); writeToLogDB("97",$hq_id,"",$usr_id,"","","","FILE=" . $_FILES['f_uploadFile']['name'] . "|STATUS=TOO_LARGE"); // Delete real file if does exist $retVal = removeFile($_FILES['f_uploadFile']['name'], $docLocalDirCurrent, $pathSeparator); endif; // Delete temp file if does exist $retVal = removeFile($_FILES['f_uploadFile']['tmp_name'], $tempPath, $pathSeparator); // Insert or update in REDUNDANT structure ("gdc") because of performance by displaying lists (customer list, courier list, job list, etc.)! gdcSetNumberOfDocuments($docLocalDirCurrent, $objType, $objId, $fileFilterPrefix); else : $statusMessage .= getLngt("Bevor eine weitere Datei hochgeladen werden kann, muss das Verzeichnis bereinigt werden!"); endif; endif; // Manually removal of a specified importfile if ($f_act == "removeImportfile") : // Remove import file $retVal = removeFile($f_importFile, $docLocalDirCurrent, $pathSeparator); writeToLogDB("183",$hq_id,"",$usr_id,"","","","FILE=" . $f_importFile . "|STATUS=" . $retVal); if ($retVal == "0") : elseif ($retVal == "-1") : $statusMessage = getLngt("Es liegt kein Dateiname vor!"); elseif ($retVal == "-2") : $statusMessage = getLngt("Die Datei befindet sich nicht mehr in dem Verzeichnis!"); elseif ($retVal == "") : $statusMessage = getLngt("Es fand keine Löschung statt!"); endif; // Insert or update in REDUNDANT structure ("gdc") because of performance by displaying lists (customer list, courier list, job list, etc.)! gdcSetNumberOfDocuments($docLocalDirCurrent, $objType, $objId, $fileFilterPrefix); endif; // Upload FTP file if ($f_act == "ftpUpload") : if ($f_ftp_filename != "") : if ($ftp_server != "" && $ftp_user_name != "") : $tmpArray = ftpUpload($f_ftp_filename, "", $ftp_server, $ftp_user_name, $ftp_user_pass, $docLocalDirCurrent, $ftp_path_dest, $f_ftp_ssl); if ($tmpArray[0] == "0") : writeToLogDB("99",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=OK|ERR="); // Insert or update in REDUNDANT structure ("gdc") because of performance by displaying lists (customer list, courier list, job list, etc.)! gdcSetNumberOfDocuments($docLocalDirCurrent, $objType, $objId, $fileFilterPrefix); else : $statusMessage = $tmpArray[1]; writeToLogDB("99",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=NO_UPLOAD|ERR=" . $statusMessage); endif; else : $statusMessage = getLngt("Die Angaben für den Zugriff auf den FTP-Server sind unvollständig!"); // writeToLogDB("99",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=BAD_CONFIG"); endif; else : $statusMessage = getLngt("Die Datei wurde nicht gefunden!"); // writeToLogDB("99",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=FILE_NOT_FOUND"); endif; endif; // Download FTP file if ($f_act == "ftpDownload") : if ($f_ftp_filename != "") : if ($ftp_server != "" && $ftp_user_name != "") : $tmpArray = ftpDownload($f_ftp_filename, "", $ftp_server, $ftp_user_name, $ftp_user_pass, $docLocalDirCurrent, $ftp_path_dest, $f_ftp_ssl); if ($tmpArray[0] == "0") : writeToLogDB("100",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=OK|ERR="); // Insert or update in REDUNDANT structure ("gdc") because of performance by displaying lists (customer list, courier list, job list, etc.)! gdcSetNumberOfDocuments($docLocalDirCurrent, $objType, $objId, $fileFilterPrefix); else : $statusMessage = $tmpArray[1]; writeToLogDB("100",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=NO_DOWNLOAD|ERR=" . $statusMessage); endif; else : $statusMessage = getLngt("Die Angaben für den Zugriff auf den FTP-Server sind unvollständig!"); // writeToLogDB("100",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=BAD_CONFIG"); endif; else : $statusMessage = getLngt("Die Datei wurde nicht gefunden!"); // writeToLogDB("100",$hq_id,"",$usr_id,"","","","FILE=" . $f_ftp_filename . "|SERVER=" . $ftp_server . "|STATUS=FILE_NOT_FOUND"); endif; endif; // Delete FTP file if ($f_act == "ftpDelete") : if ($f_ftp_filename != "") : if ($ftp_server != "" && $ftp_user_name != "") : $tmpArray = ftpDelete($f_ftp_filename, $ftp_server, $ftp_user_name, $ftp_user_pass, $ftp_path_dest, $f_ftp_ssl); if ($tmpArray[0] != "0") : $statusMessage = $tmpArray[1]; endif; else : $statusMessage = getLngt("Die Angaben für den Zugriff auf den FTP-Server sind unvollständig!"); endif; else : $statusMessage = getLngt("Die Datei wurde nicht gefunden!"); endif; endif; if ($debug) : echo "rootDirDefault : " . $rootDirDefault . " [Länge: " . $rootDirDefaultLen . "]
"; echo "rootDirCurrent : " . $rootDirCurrent . " [Länge: " . $rootDirCurrentLen . "]
"; echo "docLocalDirCurrent : " . $docLocalDirCurrent . " [Länge: " . $docLocalDirCurrentLen . "]
"; echo "dirSpecialForObjType : " . $dirSpecialForObjType . " [Länge: " . $dirSpecialForObjTypeLen . "]
"; echo "fileFilterPrefix : " . $fileFilterPrefix . " [Länge: " . $fileFilterPrefixLen . "]
"; echo "numOfFiles : " . $numOfFiles . "
"; echo "f_ftp_servername_upload : " . $f_ftp_servername_upload . "
"; echo "ftpServerList : " . $ftpServerList . "
"; echo "f_ftp_servername : " . $f_ftp_servername . "
"; echo "ftp_path_dest : " . $ftp_path_dest . "
"; echo "ftp_server : " . $ftp_server . "
"; echo "ftp_user_name : " . $ftp_user_name . "
"; echo "ftp_user_pass : " . $ftp_user_pass . "
"; echo "

"; endif; // ************************************************** // * Read all of the local filenames to be imported * // ************************************************** if ($userTypeName == "hq" || $userTypeName == "cs" || $specialStaticDirActive) : $colspan = "3"; // * FILES ON LOCAL SERVER * // Get filenames $fileNames = getFilenamesInFolder($docLocalDirCurrent); $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; // Define table header $storedImportFiles .= ""; $storedImportFiles .= ""; // Link to parent directory $docLocalDirCurrentParent = dirname($docLocalDirCurrent) . "/"; if ($debug) : echo "docLocalDirCurrentParent : " . $docLocalDirCurrentParent . "
"; endif; if (strlen($docLocalDirCurrent) > $rootDirCurrentLen && substr($docLocalDirCurrentParent,0,$rootDirCurrentLen) == $rootDirCurrent && $docLocalDirCurrentParent != "../" && $docLocalDirCurrentParent != "./") : $storedImportFiles .= ""; $docLocalDirCurrentParent = dirname($docLocalDirCurrent) . "/"; $storedImportFiles .= ""; // Enable navigation for headquarter employees only !!!! if (!$specialStaticDirActive) : $parMasknavigate = getParameterValue("0", "MASK_DATATRANSFER_NAV2ROOTDIR_ENABLED", $hq_id); if ($parMasknavigate == "") : $parMasknavigate = getParameterValue("0", "MASK_DATATRANSFER_NAV2ROOTDIR_ENABLED", "0"); endif; if ($parMasknavigate == "1") : $storedImportFiles .= ""; endif; endif; $storedImportFiles .= ""; endif; // Define table body from array if (!is_array($fileNames)) : $fileNames = array(); endif; $fileNamesLen = count($fileNames); for ($j = 0; $j < $fileNamesLen; $j++) : // Check for predifined directories being not accessible if (!is_dir($docLocalDirCurrent . $fileNames[$j]) || $empHasAdminRights || checkForPredefinedDirectories($fileNames[$j])) : if (is_file($docLocalDirCurrent . $fileNames[$j])) : // Check for filter according to a specified object type and object ID // Display all files (e.g. of a specified customer, courier, etc.) only $showFile = true; if ($fileFilterPrefix != "") : if (substr($fileNames[$j],0,$fileFilterPrefixLen) != $fileFilterPrefix) : $showFile = false; endif; endif; if ($showFile) : $storedImportFiles .= ""; $storedImportFiles .= ""; // Check current filename is prefix of the name of the import script $activateImportLink = false; $phraseForActivatingImportScript = "import_" . $f_ftp_servername . "_"; $phraseForActivatingImportScriptLen = strlen($phraseForActivatingImportScript); if ($fileFilterPrefix == "") : if (substr($fileNames[$j],0,$phraseForActivatingImportScriptLen) == $phraseForActivatingImportScript) : $activateImportLink = true; endif; else : if (substr($fileNames[$j],($fileFilterPrefixLen + 1),$phraseForActivatingImportScriptLen) == $phraseForActivatingImportScript) : $activateImportLink = true; endif; endif; // Show thumbnail $displayThumbnail = ""; if (strtolower(substr($fileNames[$j],-4)) == ".jpg" || strtolower(substr($fileNames[$j],-4)) == ".png") : $displayThumbnail = "" . "    "; endif; // Check for existence of a corresponding import script if (($hasRightUpload || $specialStaticDirActive) && $f_ftp_servername != "" && $activateImportLink && file_exists("../import/import_" . $f_ftp_servername . ".php")) : $urlClause = ""; if ($objType != "") : $urlClause = "&objType=" . $objType . "&objId=" . $objId; endif; if ($debug) : echo "urlClause : " . $urlClause . "
"; endif; $storedImportFiles .= ""; else : $storedImportFiles .= ""; endif; $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; endif; elseif (is_dir($docLocalDirCurrent . $fileNames[$j])) : $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; $storedImportFiles .= ""; endif; endif; endfor; $storedImportFiles .= "
" . getLngt("votian") . "

" . getLngt("Verzeichnis") . ":  ./" . substr($docLocalDirCurrent, $dirSpecialForObjTypeLen + $rootDirDefaultLen) . "

" . getLngt("Löschen") . "    " . getLngt("Dateiname") . "    " . getLngt("WEB-Download") . "    " . getLngt("FTP-Upload") . "

 " . "[..]" . "" . "    
"; if ($specialStaticDirActive || $hasRightUpload) : $storedImportFiles .= ""; endif; $storedImportFiles .= "    " . $fileNames[$j] . "" . "    " . $displayThumbnail . "" . $fileNames[$j] . "    " . $displayThumbnail . ""; if ($specialStaticDirActive || $hasRightUpload || $hasRightDownload) : $storedImportFiles .= "" . ""; endif; $storedImportFiles .= "    "; if ($specialStaticDirActive || $hasRightUpload) : $storedImportFiles .= ""; endif; $storedImportFiles .= "    
 " . "[" . $fileNames[$j] . "]" . "" . "    
"; // * REMOTE FTP FILES * // Get filenames $fileNames = array(); $tmpErrNo = ""; $tmpErrDesc = ""; if ($ftpCurrentSelectedServerAccess) : if ($f_ftp_servername != "" && $ftp_server != "" && $f_ftp_ssl != "") : $tmpArray = ftpDir($ftp_server, $ftp_user_name, $ftp_user_pass, $ftp_path_dest, "", $f_ftp_ssl); $fileNames = $tmpArray[0]; $tmpErrNo = $tmpArray[1]; $tmpErrDesc = $tmpArray[2]; endif; endif; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; // Define table header $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; if ($ftpCurrentSelectedServerAccess) : if ($tmpErrNo == "0") : // Define table body from array $fileNamesLen = count($fileNames); for ($j = 0; $j < $fileNamesLen; $j++) : $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; $storedRemoteFiles .= ""; endfor; else : // "$f_ftp_servername" contains the FTP server name AND/OR the "IMPORT TYPE" (UTA, APO, ...) NOT being associated to a FTP data set stringently (!!!) if ($f_ftp_servername != "" && $ftp_server == "") : $storedRemoteFiles .= ""; else : $storedRemoteFiles .= ""; endif; endif; endif; $storedRemoteFiles .= "
" . getLngt("Externe Daten") . "       "; $storedRemoteFiles .= "   "; $storedRemoteFiles .= " "; $storedRemoteFiles .= "

" . getLngt("Verzeichnis") . ":  " . ($ftp_path_dest != "" ? "../" . $ftp_path_dest : "./") . "

" . getLngt("FTP-Download") . "    " . getLngt("Dateiname") . "    " . getLngt("Löschen") . "

" . "" . "" . "    " . $fileNames[$j] . "    " . "" . "" . "    
" . getLngt("Keine FTP-Konfigurationsdaten hinterlegt") . "
" . getLngt($tmpErrDesc) . "
"; endif; ?> <?php echo $pageTitel ?>
Keine Datei ausgewählt