NOF_mapPath($filePath),"{2}"=>$nof_suiteName)); exit(); } $flag = 1; for($i=0; $iNOF_mapPath($filePath),"{2}"=>$nof_suiteName)); exit; } for($i=0; $iNOF_mapPath($conf[$compIdent . "dbPath"]),"{1}"=>NOF_mapPath(dirname($conf[$compIdent . "dbPath"])))); exit(); } } function preprocess($arg) { $arg = trim($arg); $arg = preg_replace("/\s/"," ",$arg); $arg = str_replace('\"', "", $arg); $arg = preg_replace('/(\\\\)/', "" , $arg); $arg = '"' . $arg . '"'; return $arg; } function getExpectedDBFields($compIdent) { global $conf,$fieldsDBArray,$firstLineUD; $firstLineUD = trim($conf[$compIdent . "dbColumn"]); $fieldsDBArray = explode("," , $firstLineUD); } function getColumnPos($fieldName) { global $fieldsDBArray; $pos = -1; $fieldNameUQ = preg_quote($fieldName); for ($i=0; $i $conf[$maxSizeProperty] * 1000 ) { $label = $compIdent . $key . ".errorevent.filetoolarge.message" ; clubError($label,$key); $errorFoundFlag = TRUE; } //check if a disallowed extension is eing uploaded $extensionErrorEventActiveProperty = $compIdent . $key . ".errorevent.invalidextension.active"; $allowedExtensionsProperty = $compIdent . $key . ".errorevent.invalidextension.fileextension"; if($conf[$extensionErrorEventActiveProperty] == "true" && !empty($conf[$allowedExtensionsProperty]) && !empty($postFiles[$key]['name']) ) { $allowedExtensions = explode ( "|" , $conf[$allowedExtensionsProperty]); //get the extension of uploaded file $pathInfo = pathinfo($postFiles[$key]['name']); $extension = $pathInfo["extension"]; //check if the uploaded file extension is in the allowed extensions list if(!in_array($extension,$allowedExtensions) ) { $label = $compIdent . $key . ".errorevent.invalidextension.message" ; clubError($label,$key); $errorFoundFlag = TRUE; } } if( !empty($postFiles[$key]['name']) && $postFiles[$key]['size'] <=0 ) { $label = $compIdent . $key . ".errorevent.invalidfilename.message" ; clubError($label, $key); $errorFoundFlag = TRUE; } } return $errorFoundFlag; } function getUploadedFile($compIdent) { global $conf, $cgiDir; //if user left the upload directory empty then //lets assume he meant a "." meaning cgi-bin directory if(empty($conf[$compIdent. "dbFileUploadDir"])) { return; } if ($cgiDir!="") { $mycgiDir = $cgiDir . "/"; } else { $mycgiDir = ""; } //reset the $_FILES array $postFiles = GetFileVariable(''); reset($postFiles); if (file_exists($mycgiDir . $conf[$compIdent. "dbFileUploadDir"])) { //go through the uploaded files array foreach($postFiles as $key=>$value) { //transfer the file from the temporary directory to the upload directory //specified in the property file if(!empty($value['name'])) { //alter the file name in case a file with the same name exists $uploadFilePath = fhSetUploadFilePath($conf[$compIdent. "dbFileUploadDir"],$value['name'],$key); if (file_exists($value['tmp_name'])) { if(!@move_uploaded_file($value['tmp_name'],$uploadFilePath)) { NOF_throwError(702,array("{1}"=>NOF_mapPath($uploadFilePath),"{2}"=>NOF_mapPath($mycgiDir . $conf[$compIdent. "dbFileUploadDir"]))); exit(); } else { chmod($uploadFilePath,0666); } } else { NOF_throwError(302); exit(); } } } } else { NOF_throwError(701,array("{1}"=>NOF_mapPath($mycgiDir . $conf[$compIdent. "dbFileUploadDir"]),"{2}"=>NOF_mappath(getcwd()))); exit(); } } ?>