$gliderBrandID=$_POST["gliderBrandID"]+0;
	if (!empty($CONF_require_glider) && (empty($glider) || empty($gliderBrandID))) {
		addFlightError(_YOU_HAVENT_ENTERED_GLIDER);
	}
	$category=$_POST['category']+0;
	$gliderCertCategory=$_POST['gliderCertCategory']+0;

	if ($CONF['NAC']['clubPerFlight'] ) {
		$NACclubID=$_POST['NACclubID']+0;
		$NACid=$_POST['NACid']+0;
	} else {
		$NACclubID=-1;
		$NACid=-1;
	}
		
	if (strtolower(substr($filename,-4))!=".zip") addFlightError(_FILE_DOESNT_END_IN_ZIP);


	if ($_POST['insert_as_user_id'] >0 && L_auth::isAdmin($userID) ) $flights_user_id=$_POST['insert_as_user_id']+0;
	else $flights_user_id=$userID;

	$randName=sprintf("%05d",rand(1, 10000) );
	
	$tmpZIPfolder=LEONARDO_ABS_PATH.'/'.$CONF['paths']['tmpigc'].'/zipTmp_'.$flights_user_id.'_'.$randName ;
	// $tmpZIPfolder=$flightsAbsPath."/".$flights_user_id."/flights/zipTmp".$randName ;
	$tmpZIPPath=LEONARDO_ABS_PATH.'/'.$CONF['paths']['tmpigc'].'/zipFile'.$flights_user_id.'_'.$randName.'.zip';
	//$tmpZIPPath=$flightsAbsPath."/".$flights_user_id."/flights/zipFile".$randName.".zip";
	
	move_uploaded_file($_FILES['zip_datafile']['tmp_name'], $tmpZIPPath );

	//delDir($tmpZIPfolder);
示例#2
0
        //$gliderBrandID=$_POST["gliderBrandID"]+0;
        $linkURL = $_POST["linkURL"];
        if ($CONF['NAC']['clubPerFlight']) {
            $NACclubID = $_POST['NACclubID'] + 0;
            $NACid = $_POST['NACid'] + 0;
        } else {
            $NACclubID = -1;
            $NACid = -1;
        }
        list($result, $flightID) = addFlightFromFile($filename, true, $flights_user_id, array('gliderBrandID' => $gliderBrandID, 'private' => $is_private, '$linkURL' => $linkURL, 'comments' => $comments, 'glider' => $glider, 'category' => $category, 'cat' => $gliderCat, 'allowDuplicates' => 1, 'gliderCertCategory' => $gliderCertCategory, 'startType' => $_POST["startType"] + 0, 'NACclubID' => $NACclubID, 'NACid' => $NACid, 'commentsEnabled' => $_POST['commentsEnabled'] + 0));
    }
    if ($result != 1) {
        // we must log the failure for debuging purposes
        @unlink($filename);
        $errMsg = getAddFlightErrMsg($result, $flightID);
        addFlightError($errMsg);
    } else {
        $flight = new flight();
        $flight->getFlightFromDB($flightID);
        if ($flight->takeoffVinicity > $takeoffRadious * 2) {
            ?>
<script language="javascript">
	 function user_add_takeoff(lat,lon,id) {	 
		MWJ_changeContents('takeoffBoxTitle',"Register Takeoff");
		document.getElementById('addTakeoffFrame').src='<?php 
            echo $moduleRelPath;
            ?>
/GUI_EXT_user_waypoint_add.php?refresh=0&lat='+lat+'&lon='+lon+'&takeoffID='+id;		
		MWJ_changeSize('addTakeoffFrame',720,345);
		MWJ_changeSize( 'takeoffAddID', 725,365 );
		toggleVisible('takeoffAddID','takeoffAddPos',-10,-50,725,435);
 $glider = $_POST["glider"];
 $gliderBrandID = $_POST["gliderBrandID"] + 0;
 if (!empty($CONF_require_glider) && (empty($glider) || empty($gliderBrandID))) {
     addFlightError(_YOU_HAVENT_ENTERED_GLIDER);
 }
 $category = $_POST['category'] + 0;
 $gliderCertCategory = $_POST['gliderCertCategory'] + 0;
 if ($CONF['NAC']['clubPerFlight']) {
     $NACclubID = $_POST['NACclubID'] + 0;
     $NACid = $_POST['NACid'] + 0;
 } else {
     $NACclubID = -1;
     $NACid = -1;
 }
 if (strtolower(substr($filename, -4)) != ".zip") {
     addFlightError(_FILE_DOESNT_END_IN_ZIP);
 }
 if ($_POST['insert_as_user_id'] > 0 && L_auth::isAdmin($userID)) {
     $flights_user_id = $_POST['insert_as_user_id'] + 0;
 } else {
     $flights_user_id = $userID;
 }
 $randName = sprintf("%05d", rand(1, 10000));
 $tmpZIPfolder = LEONARDO_ABS_PATH . '/' . $CONF['paths']['tmpigc'] . '/zipTmp_' . $flights_user_id . '_' . $randName;
 // $tmpZIPfolder=$flightsAbsPath."/".$flights_user_id."/flights/zipTmp".$randName ;
 $tmpZIPPath = LEONARDO_ABS_PATH . '/' . $CONF['paths']['tmpigc'] . '/zipFile' . $flights_user_id . '_' . $randName . '.zip';
 //$tmpZIPPath=$flightsAbsPath."/".$flights_user_id."/flights/zipFile".$randName.".zip";
 move_uploaded_file($_FILES['zip_datafile']['tmp_name'], $tmpZIPPath);
 //delDir($tmpZIPfolder);
 //exec("unzip -o -j ".$tmpZIPPath." -d '".$tmpZIPfolder."'" );
 makeDir($tmpZIPfolder);