Пример #1
0
	$op=makeSane($_GET['op1']);

	if (!in_array($op,array("create_pdf")) ) return;

	// $SERVER_URL='';

	if ($op=="create_pdf") {
		$direct=$_GET['direct']+0;
		$remote=$_GET['remote']+0;
		
		if ($userID <=0 || $remote) {
			//echo "Not valid user";
			// exit;
			$userID =makeSane($_GET['userIDnotify']);
			
			$userEmail=makeSane($_GET['userEmailNotify'],2);
			unset($_GET['userIDnotify']);
			unset($_GET['userEmailNotify']);
		} else {			
			require_once "CL_user.php";
			$userEmail=LeoUser::getEmail($userID);
		}
		
		
		
		unset($_GET['op1']);
		unset($_GET['direct']);
		unset($_GET['remote']);

		$url="http://".urldecode($_GET['url']);
		foreach($_GET as $name=>$val ) {
Пример #2
0
     if ($res <= 0) {
         echo "</search>";
         return;
     }
     $i = 0;
     while ($row = mysql_fetch_assoc($res)) {
         $resWaypoint = new waypoint($row["ID"]);
         $resWaypoint->getFromDB();
         echo $resWaypoint->exportXML('XML');
         $i++;
     }
     mysql_freeResult($res);
     echo "</search>";
 } else {
     if ($op == 'get_country_takeoffs') {
         $countryCode = makeSane(substr($_REQUEST['countryCode'], 0, 2));
         if (!$countryCode) {
             echo "{ }";
             exit;
         }
         $query = "SELECT * from {$waypointsTable} WHERE type=1000 AND countryCode='{$countryCode}' ORDER BY name ASC";
         $res = $db->sql_query($query);
         if ($res <= 0) {
             echo "<H3>Error in geting takeoffs</H3>\n";
         }
         while ($row = mysql_fetch_assoc($res)) {
             // echo "<option value='".$row['ID']."' >".$row['ID'].' - '.$row['name']."</option>\n";
             $row2[$row['ID']] = $row['countryCode'] . ' - ' . $row['name'] . ' [' . $row['ID'] . ']';
         }
         $str = ' { ';
         if ($row2) {
Пример #3
0
                    $flightID = makeSane($_REQUEST['flightID'], 1);
                    //echo $_SERVER['QUERY_STRING'];
                    DEBUG("DL", 1, "Will serve flight {$flightID}<BR>");
                    $flight = new flight();
                    $flight->getFlightFromDB($flightID);
                    $xml = $flight->createGPXfile();
                    $file_name = $flight->filename . ".xml";
                    DEBUG("DL", 1, "GPX Filepath= {$file_path}<BR>");
                } else {
                    if ($type == "kml_wpt") {
                        $waypointID = makeSane($_REQUEST['wptID'], 1);
                        $xml = makeKMLwaypoint($waypointID);
                        $file_name = $waypointID . '.kml';
                    } else {
                        if ($type == "sites") {
                            $sites = makeSane($_GET['sites']);
                            $sitesList = explode(",", $sites);
                            //		$xml='<?xml version="1.0" encoding="'.$langEncodings[$currentlang].'"? >'.
                            $xml = '<?xml version="1.0" encoding="UTF-8"?>' . '<kml xmlns="http://earth.google.com/kml/2.1">\\n
		<Folder>
		<name>Leonardo Site List</name>';
                            foreach ($sitesList as $waypointID) {
                                list($xml_str, $countryCode) = makeWaypointPlacemark($waypointID, 1);
                                if (!is_array($takeoffs[$countryCode])) {
                                    $takeoffs[$countryCode] = array();
                                }
                                array_push($takeoffs[$countryCode], $xml_str);
                            }
                            foreach ($takeoffs as $countryCode => $countrySites) {
                                $xml .= "<Folder>\n<name>" . $countries[$countryCode] . "</name>\n";
                                foreach ($countrySites as $siteXml) {
Пример #4
0
         $countryCodeQuery = 1;
     } else {
         $pilotsTableQuery = 1;
         if (strpos($filter_clause, " countryCode")) {
             $countryCodeQuery = 1;
         } else {
             $countryCodeQuery = 0;
         }
     }
 }
 if (!strpos($filter_clause, $pilotsTable . ".Sex") === false) {
     $pilotsTableQuery = 1;
 }
 $where_clause .= $filter_clause;
 if ($clubID) {
     $add_remove_mode = makeSane($_REQUEST['admClub'], 1);
     $queryExtraArray += array("admClub" => $add_remove_mode);
     require dirname(__FILE__) . "/INC_club_where_clause.php";
 }
 if ($countryCodeQuery || $country) {
     $where_clause .= " AND {$flightsTable}.takeoffID={$waypointsTable}.ID ";
     $extra_table_str .= "," . $waypointsTable;
 } else {
     $extra_table_str .= "";
 }
 if ($pilotsTableQuery2 && !$pilotsTableQueryIncluded) {
     $where_clause2 = "  AND {$flightsTable}.userID={$pilotsTable}.pilotID AND {$flightsTable}.userServerID={$pilotsTable}.serverID  ";
     $extra_table_str2 .= ",{$pilotsTable}";
 }
 if ($pilotsTableQuery && !$pilotsTableQuery2 && !$pilotsTableQueryIncluded) {
     $where_clause .= "  AND {$flightsTable}.userID={$pilotsTable}.pilotID AND {$flightsTable}.userServerID={$pilotsTable}.serverID  ";
Пример #5
0
//
// $Id: EXT_processKML.php,v 1.6 2010/03/14 20:56:10 manolis Exp $
//
//************************************************************************
require_once dirname(__FILE__) . "/EXT_config_pre.php";
require_once "config.php";
require_once "EXT_config.php";
require_once "CL_flightData.php";
require_once "FN_functions.php";
require_once "FN_UTM.php";
require_once "FN_waypoint.php";
require_once "FN_output.php";
require_once "FN_pilot.php";
require_once "FN_flight.php";
setDEBUGfromGET();
$op = makeSane($_REQUEST['op']);
if (!$op) {
    $op = "getKML";
}
if (!in_array($op, array("getKML"))) {
    return;
}
$encoding = "iso-8859-1";
if ($op == "getKML") {
    require_once dirname(__FILE__) . '/lib/miniXML/minixml.inc.php';
    $XML_str = "<result>\n";
    $XML_path = $_GET['KMLfile'];
    $XML_str .= "<debug>Processing {$XML_path}</debug>\n";
    echo "Processing {$XML_path}<br>";
    $foundPoints = 0;
    $linesArray = file($XML_path);
Пример #6
0
function setDEBUGfromGET()
{
    global $DBGcat, $DBGlvl;
    if ($_GET['DBGcat']) {
        $DBGcat = makeSane($_GET['DBGcat']);
    }
    if ($_GET['DBGlvl']) {
        $DBGlvl = makeSane($_GET['DBGlvl'], 1);
    }
}
Пример #7
0
        echo $imagesHtml;
    }
} else {
    if ($op == 'comments') {
        // $flight=new flight();
        // $flight->getFlightFromDB($flightID);
        $flightComments = new flightComments($flightID);
        $commentRow = $flightComments->getFirstFromDB();
        //		echo "<table class='short_info' cellpadding='0' cellspacing='0' width='100%'>";
        //		echo '<tr><td>'.$flight->comments.'</td></tr></table>';
        $comment = leoHtml::cutString($commentRow['text'], 300);
        //$comment=$commentRow['text'];
        echo "<span class='short_info'>" . $comment . '</span>';
    } else {
        if ($op == 'info_short') {
            $extendedInfo = makeSane($_GET['ext'], 1);
            $flight = new flight();
            $flight->getFlightFromDB($flightID);
            if ($CONF_use_utf) {
                $CONF_ENCODING = 'utf-8';
            } else {
                $CONF_ENCODING = $langEncodings[$currentlang];
            }
            // google map cached
            $mapUrl = $flight->createStaticMap(0);
            header('Content-type: application/text; charset="' . $CONF_ENCODING . '"', true);
            //  echo "<pre class='short_info'>";
            echo "<table class='short_info' cellpadding='0' cellspacing='0' width='100%'>";
            echo "<tr><td valign='top'><img src='{$mapUrl}' width='250'></td><td valign='top'>";
            echo "<table class='short_info' cellpadding='0' cellspacing='0' width='100%'>";
            echo "<TR><TD width=150>" . _DATE_SORT . "</td><td>" . formatDate($flight->DATE) . "<td></tr>\n";
		  <script language="javascript">
			  function refreshParent() {
				  topWinRef=top.location.href;
				  top.window.location.href=topWinRef;
			  }
		  </script>
		<?php 
        echo "<div align=center><BR><BR>" . _WAYPOINT_ADDED . "<BR><BR>";
        echo "<a href='javascript:refreshParent();'>Update flight takeoff and RETURN </a>";
        echo "<br></div>";
    } else {
        echo "<H3> Error in inserting waypoint info query! </H3>\n";
    }
    return;
}
$query = "SELECT  countryCode from {$waypointsTable} WHERE ID=" . makeSane($_REQUEST['takeoffID'], 1);
$res = $db->sql_query($query);
if ($res <= 0) {
    echo "<H3>" . _NO_KNOWN_LOCATIONS . "</H3>\n";
    exit;
}
$row = mysql_fetch_assoc($res);
//if (!$row) { echo "##############" ;}
$nearestCountryCode = $row["countryCode"];
mysql_freeResult($res);
//echo $nearestCountryCode."^^";
?>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $CONF_ENCODING;
?>
Пример #9
0
require_once "config.php";
require_once "EXT_config.php";
/*require_once "CL_flightData.php";
	require_once "FN_functions.php";	
	require_once "FN_UTM.php";
	require_once "FN_waypoint.php";	
	require_once "FN_output.php";
	require_once "FN_pilot.php";
	require_once "FN_flight.php";	
	*/
// setDEBUGfromGET();
$op = makeSane($_REQUEST['op']);
if ($op == 'getCategoriesForCertID') {
    $gliderCertID = makeSane($_REQUEST['gliderCertID']);
    $showAll = makeSane($_REQUEST['showAll']);
    $gliderCat = makeSane($_REQUEST['gliderCat']);
    if ($gliderCat != 1) {
        $showAll = 1;
    }
    $str = " { [";
    if (!empty($CONF_addflight_js_validation)) {
        $str .= " [\"0\", \"-\"],";
        if ($CONF['gliderClasses'][$gliderCat]['classes']) {
            foreach ($CONF['gliderClasses'][$gliderCat]['classes'] as $gl_id => $gl_type) {
                if ($showAll || in_array($gl_id, $CONF_cert_avalable_categories[$gliderCertID])) {
                    $str .= " [\"{$gl_id}\", \"{$gl_type}\"],";
                }
            }
        }
    } else {
        if ($CONF['gliderClasses'][$gliderCat]['classes']) {
Пример #10
0
?>
</a>
		<br><br>
      </div>
     </td>
  </tr>

</table>
<?		

	closeMain();return;	
}  // $_GET['rkey'];

if($_POST['registerForm']==1){
	$civlid=$_POST['civlid']+0;
	$username=makeSane($_POST['username']);
	
	// various queries in order of searching civlid, email through all database to avoid doubles;
	if($r=_search($_POST['email'],$civlid,$username,'temp')) { 
 
		if ( ($r['user_civlid']==$civlid || $civlid==0) && $r['user_email']==$_POST['email'] ){
			$actkey=$r['user_actkey'] ;       
			$msg= "<p align ='center'>".sprintf(_Pilot_civlid_email_pre_registration,$r['user_name'])."</p>";
			print "<p align ='center'>"._Pilot_have_pre_registration."</p>";
			$email_body=sprintf(_Pilot_confirm_subscription,$CONF['site']['name'],$r['user_name'],
			$_SERVER['SERVER_NAME'],
			str_replace('//','/',$_SERVER['SERVER_NAME'].getRelMainDir().'/'.$CONF_mainfile),
			$actkey );
			LeonardoMail::sendMail('[Leonardo] - Confirmation email',utf8_decode($email_body),$r['user_email'],addslashes($_POST['firstname']));
			unset($actkey);
		} else if($r['user_email']==$_POST['email']  ){
		document.location=linkStr;	  
	});

});
</script>
<?php 
$workTable = "temp_leonardo_gliders";
//  $workTable=$flightsTable;
open_inner_table("ADMIN AREA :: Resolve Duplicate takeoffs", 850);
open_tr();
echo "<td align=left>";
if (!L_auth::isAdmin($userID)) {
    echo "<br><br>You dont have access to this page<BR>";
    exitPage();
}
$admin_op = makeSane($_GET['admin_op']);
?>
	<form><BR />&nbsp;&nbsp;&nbsp;
    Method: 
<select name="compareMethod" id="compareMethod">
  <option value="1">Same Name</option>
  <option value="2">Soundex Similarity</option>      
  <option value="3">Location Proximity (very slow)</option>
</select> 
Select only takeoffs from country: <input type="text" name='countryCode' id='countryCode' size="5" 
value='<?php 
echo $_GET['countryCode'];
?>
' /> (give country code)
<input name='intName' id='intName' type="checkbox" value='1' /> Use 'international Name'
</form>
Пример #12
0
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_validation_review.php,v 1.9 2010/03/14 20:56:11 manolis Exp $
//
//************************************************************************
if (L_auth::isAdmin($userID)) {
    $flight = new flight();
    $flight->getFlightFromDB($flightID);
    if ($_REQUEST["changeFlight"]) {
        // make changes
        $flight->cat = makeSane($_REQUEST["gliderCat"]);
        $flight->glider = $_REQUEST["glider"];
        $flight->comments = $_REQUEST["comments"];
        $flight->linkURL = $_REQUEST["linkURL"];
        if (substr($flight->linkURL, 0, 7) == "http://") {
            $flight->linkURL = substr($flight->linkURL, 7);
        }
        if ($_REQUEST['is_private'] == "1") {
            $flight->private = 1;
        } else {
            $flight->private = 0;
        }
        for ($i = 1; $i <= $CONF_photosPerFlight; $i++) {
            $var_name = "photo" . $i . "Filename";
            if ($_REQUEST["photo" . $i . "Delete"] == "1") {
                // DELETE photo
  <meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $CONF_ENCODING;
?>
">
  <style type="text/css">
  body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
  body {margin:0px}
  </style>
</head>
<?php 
$area_id = makeSane($_REQUEST['area_id'], 1);
// echo $area_id;
if ($_POST['updateComment'] == 1) {
    // CHANGE waypoint
    $Comments = prep_for_DB($_POST['Comments']);
    $disabled = makeSane($_POST['disabled'], 1);
    $query = "UPDATE {$airspaceTable} SET Comments='{$Comments}' , disabled={$disabled} WHERE id={$area_id}";
    // echo $query;
    $res = $db->sql_query($query);
    # Error checking
    if ($res > 0) {
        ?>
			  <script language="javascript">
				  function refreshParent() {
					  topWinRef=top.location.href;
					  top.window.location.href=topWinRef;
				  }
			  </script>
			<?php 
        echo "<center>" . _THE_CHANGES_HAVE_BEEN_APPLIED . "<br><br>";
        echo "<a href='javascript:refreshParent();'>RETURN </a>";
Пример #14
0
     $pilot = new pilot(0, $user_id);
     $pilot->deletePilot(1, 1);
     exit;
 } else {
     if ($op == 'edit') {
         $user_id = makeSane($_POST['id']);
         $sql = "UPDATE {$pilotsTable} SET \n\t\t\tcountryCode='" . makeSane($_POST['countryCode']) . "',\n\t\t\tCIVL_ID='" . makeSane($_POST['CIVL_ID']) . "',\n\t\t\tCIVL_NAME='" . makeSane($_POST['CIVL_NAME'], 2) . "',\n\t\t\tFirstName='" . makeSane($_POST['FirstName'], 2) . "',\n\t\t\tLastName='" . makeSane($_POST['LastName'], 2) . "',\n\t\t\tSex='" . makeSane($_POST['Sex']) . "',\n\t\t\tBirthdate='" . makeSane($_POST['Birthdate']) . "' \n\t\t\tWHERE pilotID={$user_id} AND serverID=0";
         if (!$db->sql_query($sql)) {
             echo "Error in query : {$sql}<BR>";
         }
         $sql = "UPDATE " . $CONF['userdb']['users_table'] . " SET \n\t\t\tusername='******'username'], 2) . "',\n\t\t\tuser_email='" . makeSane($_POST['user_email'], 2) . "'\t\t\n\t\t\tWHERE user_id={$user_id} ";
         if (!$db->sql_query($sql)) {
             echo "Error in query : {$sql}<BR>";
         }
         // change password ?
         $user_password = makeSane($_POST['user_password'], 2);
         if ($user_password) {
             require_once dirname(__FILE__) . "/CL_user.php";
             $res = LeoUser::changePassword($user_id, $user_password);
             if ($res > 0) {
                 echo _PwdChanged;
             } else {
                 echo _PwdChangeProblem;
                 if ($res == -2) {
                     printf(': ' . _PwdTooShort, $CONF_password_minlength);
                 }
             }
         }
         exit;
     }
 }
Пример #15
0
<?php

//************************************************************************
// Leonardo XC Server, http://www.leonardoxc.net
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_flight_delete.php,v 1.12 2010/03/14 20:56:11 manolis Exp $
//
//************************************************************************
$flightID = makeSane($_REQUEST["flightID"], 1);
$confirmed = makeSane($_REQUEST["confirmed"]);
$flight = new flight();
$flight->getFlightFromDB($flightID);
if ($confirmed && ($flight->belongsToUser($userID) || L_auth::isAdmin($userID))) {
    $flight->deleteFlight();
    echo "<br><span class='ok'>" . _THE_FLIGHT_HAS_BEEN_DELETED . "</span><br><br>";
    echo "<a href='" . getLeonardoLink(array('op' => 'list_flights')) . "'>" . _RETURN . "</a><br></div>";
} else {
    $location = formatLocation(getWaypointName($flight->takeoffID), $flight->takeoffVinicity, $takeoffRadious);
    openMain(_CAUTION_THE_FLIGHT_WILL_BE_DELETED, 0, "delete_icon.png");
    echo "<div align=center><br><b>" . _PILOT . ": " . $flight->userName . " &nbsp;&nbsp; " . _THE_DATE . ": " . formatDate($flight->DATE) . "  &nbsp;&nbsp; " . _TAKEOFF_LOCATION . ": " . $location . "</b> ";
    echo "<br><br><a href='" . getLeonardoLink(array('op' => 'delete_flight', 'flightID' => $flightID, 'confirmed' => '1')) . "'>" . _YES . "</a> | <a href='javascript:history.go(-1)'>" . _NO . "</a>";
    echo "<br></div>";
    closeMain();
}
Пример #16
0
function setLeonardoPaths()
{
    global $baseInstallationPath, $baseInstallationPathSet;
    global $module_name, $moduleAbsPath, $moduleRelPath;
    global $waypointsRelPath, $waypointsAbsPath, $waypointsWebPath;
    global $flightsRelPath;
    global $CONF_arg_name, $CONF_mainfile, $CONF, $opMode;
    global $isExternalFile;
    if (!isset($module_name)) {
        if (isset($_GET[$CONF_arg_name])) {
            $module_name = makeSane($_GET[$CONF_arg_name]);
        } else {
            $tmpDir = dirname(__FILE__);
            $tmpParts = split("/", str_replace("\\", "/", $tmpDir));
            $module_name = $tmpParts[count($tmpParts) - 1];
            // $module_name="leonardo";
        }
    }
    $moduleRelPath = moduleRelPath($isExternalFile);
    // if ($opMode==3 || $opMode==4) $moduleRelPath="./";
    // detect if the installation in not on the root
    $baseInstallationPath = "";
    $moduleRelPathTemp = moduleRelPath(!$isExternalFile);
    // compute baseInstallationPath
    $parts = explode("/", str_replace($moduleRelPathTemp, '', dirname($_SERVER['SCRIPT_NAME'])));
    // print_r($parts);
    if (count($parts) > 1) {
        for ($i = 0; $i < count($parts); $i++) {
            if ($parts[$i] != '') {
                $baseInstallationPath .= "/" . $parts[$i];
            }
        }
    }
    if (!defined('CONF_MODULE_ARG')) {
        if ($CONF['links']['type'] == 3 && $opMode != 2) {
            $preDir = $CONF['links']['baseURL'];
        } else {
            $preDir = $baseInstallationPath;
        }
        $lnk = $preDir . '/' . $CONF_mainfile . "?{$CONF_arg_name}={$module_name}";
        define('CONF_MODULE_ARG', $lnk);
        //	setModuleArg();
    }
    if ($CONF['links']['type'] == 3) {
        $baseInstallationPath = "";
    }
    if (0) {
        echo "@" . substr($_SERVER['SCRIPT_NAME'], 0, -$queryLen) . "@";
        echo "queryLen : {$queryLen}#";
        echo "&& _SERVER['SCRIPT_NAME'] : " . $_SERVER['SCRIPT_NAME'] . "&&";
        echo dirname($_SERVER['SCRIPT_NAME']);
        echo "#moduleRelPath={$moduleRelPath}#moduleRelPathTemp={$moduleRelPathTemp}#";
        echo "baseInstallationPath={$baseInstallationPath}#<BR>";
        echo "CONF_MODULE_ARG=" . CONF_MODULE_ARG . "<BR>";
    }
    $moduleAbsPath = dirname(__FILE__);
    $flightsRelPath = "flights";
    $waypointsRelPath = "waypoints";
    $waypointsAbsPath = dirname(__FILE__) . "/" . $waypointsRelPath;
    $waypointsWebPath = $moduleRelPath . "/" . $waypointsRelPath;
    $flightsAbsPath = dirname(__FILE__) . "/" . $flightsRelPath;
    // $flightsWebPath=$moduleRelPath."/".$flightsRelPath;
}
Пример #17
0
<?php

require_once "settings.php";
function makeSane($var)
{
    return htmlspecialchars(stripcslashes(trim($var)));
}
$senderEmail = filter_var($_POST["Email"], FILTER_SANITIZE_EMAIL);
$senderName = makeSane($_POST["Name"]);
$emailSubject = makeSane($_POST["Subject"]);
$emailMessage = makeSane($_POST["Message"]);
$headers = "From: {$sentFromEmail}" . "\r\n" . "Reply-To: {$senderEmail}" . "\r\n" . "X-Mailer: PHP/" . phpversion();
if ($_POST && !$_POST["Phone"]) {
    //Phone is the HoneyPot
    if (filter_var($senderEmail, FILTER_VALIDATE_EMAIL)) {
        $emailMessageOut = "From: {$senderName} - {$senderEmail} \n" . "Subject: {$emailSubject} \n\n" . "Message: \n" . "---------------- \n" . $emailMessage;
        mail($email, $emailSubject, $emailMessageOut, $headers);
    }
}
die;
Пример #18
0
"hash": "' . $row['hash'] . '", ' . '
"pilot" : {
"userID":' . $row['userID'] . ',
"userServerID":' . $row['userServerID'] . ',
"lName":"' . $pilotNames[$pilotID]['lname'] . '",
"fName":"' . $pilotNames[$pilotID]['fname'] . '",
}	' . '	}} ';
                $item_num++;
            }
        }
        $RSS_str = '{ "log_item_num": ' . $item_num . ', "log": [ ' . $RSS_str . ' ] } ';
    } else {
        if ($op == "latest") {
            $sync_type = makeSane($_GET['sync_type'], 1);
            $getIGCfiles = $sync_type & SYNC_INSERT_FLIGHT_LOCAL;
            $zip = makeSane($_GET['use_zip'], 1);
            if ($getIGCfiles) {
                $zip = 1;
            }
            $query = "SELECT * FROM {$logTable}  WHERE  transactionID>={$startID}  AND result=1 {$where_clause} ORDER BY transactionID {$limit}";
            // echo $query;
            $res = $db->sql_query($query);
            if ($res <= 0) {
                echo "<H3> Error in query! </H3>\n";
                exit;
            }
            $item_num = 0;
            $flightsToServe = array();
            while ($row = mysql_fetch_assoc($res)) {
                $desc = htmlspecialchars($desc);
                $actionTime = $row['actionTime'] - date('Z');
require_once dirname(__FILE__) . "/EXT_config_pre.php";
require_once dirname(__FILE__) . "/config.php";
require_once dirname(__FILE__) . "/EXT_config.php";
require_once dirname(__FILE__) . "/CL_flightScore.php";
require_once dirname(__FILE__) . "/CL_flightData.php";
require_once dirname(__FILE__) . "/FN_functions.php";
require_once dirname(__FILE__) . "/FN_UTM.php";
require_once dirname(__FILE__) . "/FN_waypoint.php";
require_once dirname(__FILE__) . "/FN_output.php";
require_once dirname(__FILE__) . "/FN_pilot.php";
require_once dirname(__FILE__) . "/FN_flight.php";
require_once dirname(__FILE__) . "/templates/" . $PREFS->themeName . "/theme.php";
setDEBUGfromGET();
require_once dirname(__FILE__) . "/language/" . CONF_LANG_ENCODING_TYPE . "/lang-" . $currentlang . ".php";
require_once dirname(__FILE__) . "/language/" . CONF_LANG_ENCODING_TYPE . "/countries-" . $currentlang . ".php";
$flightID = makeSane($_GET['flightID'], 1);
if ($flightID <= 0) {
    exit;
}
$flight = new flight();
$flight->getFlightFromDB($flightID);
$flightComments = new flightComments($flight->flightID);
$flightComments->getFromDB();
$commentsEnabled = $flight->commentsEnabled + 0;
// now the access rights :
$moderatorRights = false;
if ($flight->userID == $userID && $flight->userServerID == $userServerID || L_auth::isModerator($userID)) {
    $moderatorRights = true;
}
?>
  
Пример #20
0
        }
        $xRow[] = $row;
        $gotEntries++;
        $item_num++;
    }
    // print_r($xRow);
    if ($tableType != 'deleted') {
        $lastActionTm = $actionTm;
        $lastActionTimeStr = $actionTimeStr;
    }
}
$item_num = 0;
$item_ok = 0;
$max_time = 0;
foreach ($xRow as $row) {
    if (makeSane($row['CivlId'], 1) > 0 || $zerocivl) {
        if ($max_time < $row['LastTimestamp']) {
            $max_time = $row['LastTimestamp'];
        }
        $row['CommentInternal'] = htmlspecialchars(html_entity_decode($row['checkedBy'], ENT_NOQUOTES, "UTF-8"));
        // this should be filled from a $CONF[''] variable... defined in site/config_custom.php
        $row['CivlIdApprovedBy'] = $CONF['WXC']['CivlIdApprovedBy'] + 0;
        // disable any private/disabled and airspace invalid flight from WXC score
        if ($row['private'] > 0) {
            $row['NacStatus'] = "d";
        }
        //in case of detected airspace violation, pilot might still have approval for that airspace... so we allow sync when word "approved" is set at comment first
        if ($row['airspaceCheckFinal'] == "-1" && strtolower(substr($row['airspaceCheckMsg'], 0, 8) != "approved")) {
            $row['NacStatus'] = "d";
        }
        $row['GliderCat'] = convertCat($row['cat'], $row['category']);
Пример #21
0
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $CONF_ENCODING;
?>
">
  <style type="text/css">
  body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
  body {margin:0px}
  </style>
<script language="javascript" src="<?php 
echo $moduleRelPath;
?>
/js/DHTML_functions.js"></script>
</head>
<?php 
$waypointIDview = makeSane($_GET['wID'], 1);
$wpInfo = new waypoint($waypointIDview);
$wpInfo->getFromDB();
//  $wpName= getWaypointName($waypointIDview);
$wpName = selectWaypointName($wpInfo->name, $wpInfo->intName, $wpInfo->countryCode);
$wpLocation = selectWaypointLocation($wpInfo->location, $wpInfo->intLocation, $wpInfo->countryCode);
if (L_auth::isAdmin($userID)) {
    $opString = "<a href='" . getLeonardoLink(array('op' => 'edit_waypoint', 'waypointIDedit' => $waypointIDview)) . "'><img src='" . $moduleRelPath . "/img/change_icon.png' border=0 align=bottom></a>";
}
$titleString = _Waypoint_Name . " : " . $wpName . " (" . $countries[$wpInfo->countryCode] . ") &nbsp;";
//$opString="<a href='#' onclick=\"toggleVisible('takeoffID','takeoffPos',14,-20,0,0);return false;\">
//<img src='".$moduleRelPath."/templates/".$PREFS->themeName."/img/exit.png' border=0></a>";
open_inner_table("<table class=main_text width=100% cellpadding=0 cellspacing=0><tr><td>" . $titleString . "</td><td align=right width=50><div align=right>" . $opString . "</div></td></tr></table>", 705, "icon_pin.png");
open_tr();
echo "<td>";
?>
Пример #22
0
require_once dirname(__FILE__) . "/FN_flight.php";
$msg = '';
if (isset($_REQUEST['updatePrefs'])) {
    // submit form
    $PREFS->themeName = makeSane($_REQUEST['PREFS_themeName'], 0);
    $PREFS->itemsPerPage = makeSane($_REQUEST['PREFS_itemsPerPage'], 1);
    $PREFS->metricSystem = makeSane($_REQUEST['PREFS_metricSystem']);
    $PREFS->googleMaps = makeSane($_REQUEST['PREFS_googleMaps'], 1);
    $PREFS->nameOrder = makeSane($_REQUEST['PREFS_nameOrder'], 1);
    $PREFS->useEditor = makeSane($_REQUEST['PREFS_useEditor'], 1);
    $PREFS->showNews = makeSane($_REQUEST['PREFS_showNews'], 1);
    $PREFS->language = makeSane($_REQUEST['PREFS_language']);
    $_SESSION["lng"] = $PREFS->language;
    $PREFS->viewCat = makeSane($_REQUEST['PREFS_viewCat'], 1);
    $_SESSION["cat"] = $PREFS->viewCat;
    $PREFS->viewCountry = makeSane($_REQUEST['PREFS_viewCountry']);
    $_SESSION["country"] = $PREFS->viewCountry;
    if (!is_dir(dirname(__FILE__) . "/templates/" . $PREFS->themeName) || !$PREFS->themeName) {
        $PREFS->themeName = $CONF_defaultThemeName;
    }
    $PREFS->setToCookie();
    echo "<span class='ok'>" . _Your_settings_have_been_updated . " <a href='javascript:location.reload(true)'>OK</a></span>";
    return;
}
?>

<div id="userPrefsMsg"></div>
<form name="userPrefs" id="userPrefs" method="POST" >
<table  width="100%" border="0" bgcolor="#F4F3F1" cellpadding="3" align="left" class="box main_text" style="background-color:#F4F3F1">
  	<tr> 
      <td colspan="5" >&nbsp;</td>
Пример #23
0
// the Free Software Foundation; either version 2 of the License.
//
// $Id: EXT_google_maps_track.php,v 1.57 2012/09/07 21:54:04 manolis Exp $
//
//************************************************************************
require_once dirname(__FILE__) . "/EXT_config_pre.php";
require_once dirname(__FILE__) . "/config.php";
$CONF_use_utf = 1;
require_once dirname(__FILE__) . "/EXT_config.php";
require_once dirname(__FILE__) . "/CL_flightData.php";
require_once dirname(__FILE__) . "/FN_functions.php";
require_once dirname(__FILE__) . "/FN_waypoint.php";
require_once dirname(__FILE__) . "/FN_output.php";
require_once dirname(__FILE__) . "/FN_pilot.php";
//	setDEBUGfromGET();
$flightID = makeSane($_GET['id'], 1);
if ($flightID <= 0) {
    exit;
}
$flight = new flight();
$flight->getFlightFromDB($flightID, 0);
$flight->makeJSON(0);
// no force
// we dont use png files any more
//$flight->updateCharts(0,1); // no force update, raw charts
if ($flight->is3D() && is_file($flight->getChartfilename("alt", $PREFS->metricSystem, 1))) {
    $chart1 = $flight->getChartRelPath("alt", $PREFS->metricSystem, 1);
    $title1 = _Altitude . ' (' . ($PREFS->metricSystem == 1 ? _M : _FT) . ')';
} else {
    if (is_file($flight->getChartfilename("takeoff_distance", $PREFS->metricSystem, 1))) {
        $chart1 = $flight->getChartRelPath("takeoff_distance", $PREFS->metricSystem, 1);
Пример #24
0
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_area_admin.php,v 1.15 2010/04/21 07:55:50 manolis Exp $
//
//************************************************************************
if (!L_auth::isAdmin($userID)) {
    echo "go away";
    return;
}
require_once dirname(__FILE__) . '/CL_area.php';
$areaID = makeSane($_GET['areaID'], 1);
$areaAction = makeSane($_GET['areaAction']);
if (!$areaID && $areaAction != 'Add') {
    openMain("Administer Area (group of takeoffs)", 0, '');
    echo "<a href='" . getLeonardoLink(array('op' => 'area_admin', 'areaAction' => 'Add', 'areaID' => 0)) . "'>Add new Area</a><BR><BR>";
    ?>


  <table class=main_text width="564"  border="0" align="center" cellpadding="1" cellspacing="1">
    <tr> 
      <td>ID</td>
      <td>Name</td>
      <td>Type</td>
	  <td>Actions</td>
   </tr>
<?php 
    $query = "SELECT * FROM {$areasTable}\tORDER BY ID";
Пример #25
0
<?php

//************************************************************************
// Leonardo XC Server, http://www.leonardoxc.net
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_list_clubs.php,v 1.8 2010/03/14 20:56:11 manolis Exp $
//
//************************************************************************
$sortOrder = makeSane($_REQUEST["sortOrder"]);
if ($sortOrder == "") {
    $sortOrder = "CountryCode";
}
$page_num = $_REQUEST["page_num"] + 0;
if ($page_num == 0) {
    $page_num = 1;
}
if ($cat == 0) {
    $where_clause = "";
} else {
    $where_clause = " AND cat={$cat} ";
}
$query_str = "";
$legend = _MSG_MENU_CLUBS_MSG_;
/*
if ($year && !$month ) {
Пример #26
0
//
// $Id: EXT_thermal_map.php,v 1.3 2010/03/14 20:56:10 manolis Exp $
//
//************************************************************************
//$module_name = basename(dirname(__FILE__));
//	$moduleAbsPath=dirname(__FILE__);
//	$moduleRelPath=".";
// require "config.php";
require_once dirname(__FILE__) . "/EXT_config_pre.php";
require_once dirname(__FILE__) . "/config.php";
$CONF_use_utf = 1;
require_once dirname(__FILE__) . "/EXT_config.php";
$wpLon = makeSane($_GET['lon'], 1);
$wpLat = makeSane($_GET['lat'], 1);
$wpName = makeSane($_GET['wpName']);
$wpID = makeSane($_GET['wpID'], 1);
# martin jursa 22.06.2008: enable configuration of map type
$GMapType = 'G_SATELLITE_MAP';
if (in_array($CONF['google_maps']['default_maptype'], array('G_NORMAL_MAP', 'G_HYBRID_MAP', 'G_PHYSICAL_MAP', 'G_SATELLITE_MAP'))) {
    $GMapType = $CONF['google_maps']['default_maptype'];
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <title>Google Maps</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script src="http://maps.google.com/maps?file=api&v=2&key=<?php 
echo $CONF_google_maps_api_key;
?>
" type="text/javascript"></script>
   	<script src="<?php 
Пример #27
0
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_group_admin.php,v 1.10 2010/03/14 20:56:11 manolis Exp $
//
//************************************************************************
if (!L_auth::isAdmin($userID)) {
    echo "go away";
    return;
}
require_once dirname(__FILE__) . '/CL_area.php';
$areaID = makeSane($_GET['areaID'], 1);
$pilotsList = array();
$pilotsID = array();
list($pilotsList, $pilotsID) = getPilotList();
list($takeoffs, $takeoffsID) = getTakeoffList();
list($countriesCodes, $countriesNames) = getCountriesList();
if ($_REQUEST["addTakeoffForm"]) {
    // form submitted
    $takeoffToAdd = $_POST['takeoff_select'] + 0;
    $query = "INSERT INTO {$areasTakeoffsTable}\t(areaID,takeoffID) VALUES ({$areaID},{$takeoffToAdd})";
    // echo $query;
    $res = $db->sql_query($query);
    if ($res <= 0) {
        echo "Problem in inserting takeoff to area";
    } else {
        echo "Takeoff added to area<br>";
Пример #28
0
$board_config['sitename'] = $_SERVER['SERVER_NAME'];
$lang['ENCODING'] = $langEncodings[$currentlang];
// set page title
$page_title = 'LEONARDO';
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$mode = request_var('mode', '');
// print_r($user);
if (!function_exists('is_user')) {
    function is_user($user)
    {
        if ($user->data['userID']) {
            return true;
        } else {
            return false;
        }
    }
}
require_once dirname(__FILE__) . '/functions.php';
setVarFromRequest("clubID", 0, 1);
$clubID = makeSane($clubID, 1);
if ($clubID) {
    // some things we do when first in club
    if (is_array($clubsList[$clubID]['gliderCat'])) {
        setVar("cat", 0);
    }
    setVar("lng", $clubsList[$clubID]['lang']);
    $currentlang = $lng;
}
Пример #29
0
//
//************************************************************************
require_once dirname(__FILE__) . "/EXT_config_pre.php";
require_once "config.php";
$op = makeSane($_GET['op']);
if ($op == "get_info") {
    $CONF_use_utf = 1;
}
require_once "EXT_config.php";
require_once "CL_flightData.php";
require_once "FN_functions.php";
require_once "FN_UTM.php";
require_once "FN_waypoint.php";
require_once "FN_output.php";
setDEBUGfromGET();
$op = makeSane($_GET['op']);
if (!in_array($op, array("find_wpt", "get_nearest", "get_latest", "get_info", "getTakeoffsForArea"))) {
    return;
}
if ($op == "get_info") {
    $wpID = $_GET['wpID'] + 0;
    $inPageLink = $_GET['inPageLink'] + 0;
    echo '{ "takeoffID": ' . $wpID . ' , "html": "';
    $query = "SELECT intName , countryCode from {$waypointsTable} WHERE ID={$wpID} ";
    $res = $db->sql_query($query);
    if ($res > 0) {
        if ($row = mysql_fetch_assoc($res)) {
            $description = $row['intName'];
        } else {
            echo "no results inquery :{$query}";
        }
Пример #30
0
      padding:10px;
      font-size:14px;
      font-weight: bold;}

  #similarGliders {
      display: none;
  }
  -->
</style>
</head>
<body>
<?php 
if ($_POST['gliderBrandID']) {
    //check for correct values
    $gliderBrandID = $_POST['gliderBrandID'] + 0;
    $gliderName = makeSane($_POST['gliderName']);
    $gliderSize = $_POST['gliderSize'];
    $gliderCert = $_POST['gliderCert'] + 0;
    $error = '';
    if (!$gliderBrandID) {
        $error .= _Please_provide_the_Brand_of_the_Glider . "<BR>";
    }
    if (!$gliderName) {
        $error .= _Please_provide_the_Name_of_the_Glider . "<BR>";
    }
    $gliderSizeInt = $gliderSize + 0;
    $gliderSize = strtoupper($gliderSize);
    $gliderSizes = array("XXS", "XS", "S", "MS", "M", "ML", "L", "XL", "XLL");
    $isSizeOK = $gliderSizeInt >= 10 && $gliderSizeInt <= 40 || in_array($gliderSize, $gliderSizes);
    if (!$isSizeOK) {
        $error .= _Please_provide_the_Glider_Size . "<BR>";