Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
manolis committed Nov 12, 2007
1 parent 8460e41 commit 06b8c38
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 18 deletions.
12 changes: 10 additions & 2 deletions CL_flightData.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ function flight() {
}
}

function belongsToUser($userID) {
global $CONF_server_id ;
if ( $this->userID == $userID &&
($this->userServerID==$CONF_server_id || $this->userServerID==0 )
) return 1;
else return 0;

}

function toXML(){
/* maybe also include these
Expand Down Expand Up @@ -959,7 +967,7 @@ function createKMLfile($lineColor="ff0000",$exaggeration=1,$lineWidth=2,$extende

$kml_file_contents.="</Document>\n</kml>";

if (! $CONF_use_utf) {
if (! $CONF_use_utf ) {
require_once dirname(__FILE__)."/lib/ConvertCharset/ConvertCharset.class.php";
$NewEncoding = new ConvertCharset;
$FromCharset=$langEncodings[$currentlang];
Expand Down Expand Up @@ -2502,7 +2510,7 @@ function putFlightToDB($update=0) {
$this->airspaceCheck, $this->airspaceCheckFinal, '".prep_for_DB($this->airspaceCheckMsg)."','".prep_for_DB($this->checkedBy)."',
$this->NACclubID, $this->NACid,
'".prep_for_DB($this->comments)."', '".prep_for_DB($this->glider)."', $this->gliderBrandID , '".prep_for_DB($this->linkURL)."', $this->timesViewed ,
'".prep_for_DB($this->comments)."', '".prep_for_DB($this->glider)."', ".($this->gliderBrandID+0)." , '".prep_for_DB($this->linkURL)."', $this->timesViewed ,
$p2
'$this->takeoffID', $this->takeoffVinicity, '$this->landingID', $this->landingVinicity,
'$this->DATE',
Expand Down
2 changes: 1 addition & 1 deletion FN_flight.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function addFlightFromFile($filename,$calledFromForm,$userIDstr,
// and see if the flight is in the current year (as defined in the NAclist array
if ( $CONF_use_NAC ) {
require_once dirname(__FILE__)."/CL_NACclub.php";
list($pilotNACID,$pilotNACclubID)=NACclub::getPilotClub();
list($pilotNACID,$pilotNACclubID)=NACclub::getPilotClub($userIDforFlight);
if ( $CONF_NAC_list[$pilotNACID]['use_clubs'] ) {
// check year -> we only put the club for the current season , so that results for previous seasons cannot be affected
$currSeasonYear=$CONF_NAC_list[$pilotNACID]['current_year'];
Expand Down
15 changes: 8 additions & 7 deletions FN_waypoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ function getKMLrelPath($waypointID) {
}

function makeKMLwaypoint($waypointID) {
global $langEncodings,$currentlang;

global $langEncodings,$currentlang, $CONF_use_utf ;
$placemarkString=makeWaypointPlacemark($waypointID) ;

// $xml_text='<?xml version="1.0" encoding="'.$langEncodings[$currentlang].'"? >'.
Expand All @@ -276,11 +276,12 @@ function makeKMLwaypoint($waypointID) {
'.$placemarkString.'
</kml>
';
require_once dirname(__FILE__)."/lib/ConvertCharset/ConvertCharset.class.php";
$NewEncoding = new ConvertCharset;
$FromCharset=$langEncodings[$currentlang];
$xml_text = $NewEncoding->Convert($xml_text, $FromCharset, "utf-8", $Entities);

if (! $CONF_use_utf ) {
require_once dirname(__FILE__)."/lib/ConvertCharset/ConvertCharset.class.php";
$NewEncoding = new ConvertCharset;
$FromCharset=$langEncodings[$currentlang];
$xml_text = $NewEncoding->Convert($xml_text, $FromCharset, "utf-8", $Entities);
}
return $xml_text;
}

Expand Down
2 changes: 1 addition & 1 deletion GUI_EXT_flight_set_bounds.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$flight=new flight();
$flight->getFlightFromDB($flightID);

if ( $userID!=$flight->userID && !auth::isAdmin($userID) && !in_array($userID,$mod_users)) {
if ( ! $flight->belongsToUser($userID) && !auth::isAdmin($userID) && !in_array($userID,$mod_users)) {
echo "go away";
return;
}
Expand Down
2 changes: 1 addition & 1 deletion GUI_flight_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$flight=new flight();
$flight->getFlightFromDB($flightID);

if ($confirmed && ( $flight->userID == $userID || auth::isAdmin($userID) ) ) {
if ($confirmed && ( $flight->belongsToUser($userID) || auth::isAdmin($userID) ) ) {

$flight->deleteFlight();
echo "<div align=center><br>"._THE_FLIGHT_HAS_BEEN_DELETED."<br><br>";
Expand Down
2 changes: 1 addition & 1 deletion GUI_flight_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$flight=new flight();
$flight->getFlightFromDB($flightID);

if ( $flight->userID == $userID || auth::isAdmin($userID) ) {
if ( $flight->belongsToUser($userID) || auth::isAdmin($userID) ) {


if ($_REQUEST["changeFlight"]) { // make changes
Expand Down
10 changes: 5 additions & 5 deletions GUI_flight_show.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
return;
}

if ( $flight->private && $flight->userID!=$userID && ! auth::isAdmin($userID) ) {
if ( $flight->private && ! $flight->belongsToUser($userID) && ! auth::isAdmin($userID) ) {
echo "<TD align=center>"._FLIGHT_IS_PRIVATE."</td>";
return;
}
Expand Down Expand Up @@ -215,14 +215,14 @@ function user_add_takeoff(lat,lon,id) {
$legendRight.="<div id='setBoundsPos'></div><a href='javascript:set_flight_bounds($flightID)'><img src='".$moduleRelPath."/img/icon_clock.png' title='Set Start-Stop Time for flight' border=0 align=bottom></a> ";
}

if ( $flight->userID==$userID || auth::isAdmin($userID) ) {
if ( $flight->belongsToUser($userID) || auth::isAdmin($userID) ) {
$legendRight.="<a href='".CONF_MODULE_ARG."&op=delete_flight&flightID=".$flightID."'><img src='".$moduleRelPath."/img/x_icon.gif' border=0 align=bottom></a>
<a href='".CONF_MODULE_ARG."&op=edit_flight&flightID=".$flightID."'><img src='".$moduleRelPath."/img/change_icon.png' border=0 align=bottom></a>";
}

$legend="<img src='$moduleRelPath/img/icon_cat_".$flight->cat.".png' align='absmiddle'> ".
_PILOT.": <a href=\"javascript:pilotTip.newTip('inline', 60, 19, 'pilot_pos', 200, '".
$flight->userID."','".addslashes(prepare_for_js($flight->userName))."' )\" onmouseout=\"pilotTip.hide()\">".
$flight->userServerID."_".$flight->userID."','".addslashes(prepare_for_js($flight->userName))."' )\" onmouseout=\"pilotTip.hide()\">".
$flight->userName."</a>&nbsp;&nbsp; "._DATE_SORT.": ".formatDate($flight->DATE);

$Ltemplate->assign_vars(array(
Expand Down Expand Up @@ -389,10 +389,10 @@ function user_add_takeoff(lat,lon,id) {
echo "[ <a href='$olc_url/map/".$olcName.".jpg' target='_blank'>"._OLC_MAP."</a> ] ";
echo "[ <a href='$olc_url/ENL/".$olcName.".png' target='_blank'>"._OLC_BARO."</a> ] ";
echo "[".substr($flight->olcDateSubmited,0,10)."] ";
if ( auth::isAdmin($userID) || $flight->userID==$userID ) echo "(Ref: ".$flight->olcRefNum.") ";
if ( auth::isAdmin($userID) || $flight->belongsToUser($userID) ) echo "(Ref: ".$flight->olcRefNum.") ";
echo "<img src='".$moduleRelPath."/img/olc_icon_submited.gif' border=0 align=bottom>";
// echo _SUBMITED_SUCCESSFULLY_ON." ".$flight->olcDateSubmited;
if ($flight->insideOLCsubmitWindow() && ( auth::isAdmin($userID) || $flight->userID==$userID ) ) {
if ($flight->insideOLCsubmitWindow() && ( auth::isAdmin($userID) || $flight->belongsToUser($userID) ) ) {
echo "<a href='".CONF_MODULE_ARG."&op=olc_remove&flightID=".$flight->flightID."'>";
echo "<img src='".$moduleRelPath."/img/x_icon.gif' border=0 align=bottom></a>";
}
Expand Down
1 change: 1 addition & 0 deletions download.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
require_once dirname(__FILE__)."/language/".CONF_LANG_ENCODING_TYPE."/countries-".$currentlang.".php";

setDEBUGfromGET();


$type=makeSane($_REQUEST['type']);
if (!in_array($type,array("kml_task","kml_trk","kml_trk_color","kml_wpt","sites")) ) return;
Expand Down
2 changes: 2 additions & 0 deletions site/config_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

$CONF_main_page="index_full";

// use utf language files
$CONF_use_utf=0;

// the native language of the server
$nativeLanguage="english";
Expand Down

0 comments on commit 06b8c38

Please sign in to comment.