Completed
Push — master ( e2bf33...2d6f57 )
by Yannick
89:36 queued 58:21
created
install/index.php 3 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 			<p>
205 205
 				<label for="siteurl">Site directory</label>
206 206
 				<?php
207
-				    // Try to detect site directory
208
-				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) {
207
+					// Try to detect site directory
208
+					if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) {
209 209
 					if (isset($_SERVER['REQUEST_URI'])) {
210 210
 						$URL = $_SERVER['REQUEST_URI'];
211 211
 						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL)));
212 212
 					}
213
-				    }
213
+					}
214 214
 				?>
215 215
 				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
216 216
 				<p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
@@ -389,17 +389,17 @@  discard block
 block discarded – undo
389 389
 				</tr>
390 390
 				
391 391
 		<?php
392
-		    if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') {
392
+			if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') {
393 393
 		?>
394 394
 		<!--
395 395
 		<?php
396
-			    require_once(dirname(__FILE__).'/../require/class.Connection.php');
397
-			    $Connection = new Connection();
396
+				require_once(dirname(__FILE__).'/../require/class.Connection.php');
397
+				$Connection = new Connection();
398 398
 		?>
399 399
 		-->
400 400
 		<?php
401 401
 			if ($Connection->db != NULL) {
402
-			    if ($Connection->tableExists('source_location')) {
402
+				if ($Connection->tableExists('source_location')) {
403 403
 				require_once(dirname(__FILE__).'/../require/class.Source.php');
404 404
 				$Source = new Source();
405 405
 				//$alllocations = $Source->getAllLocationInfo();
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
 		
420 420
 		<?php
421 421
 				}
422
-			    }
422
+				}
423
+			}
423 424
 			}
424
-		    }
425 425
 		?>
426 426
 
427 427
 				<tr>
@@ -549,12 +549,12 @@  discard block
 block discarded – undo
549 549
 ?>
550 550
 							<tr>
551 551
 								<?php
552
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
552
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
553 553
 								?>
554 554
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
555 555
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
556 556
 								<?php
557
-								    } else {
557
+									} else {
558 558
 									$hostport = explode(':',$source['host']);
559 559
 									if (isset($hostport[1])) {
560 560
 										$host = $hostport[0];
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
568 568
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td>
569 569
 								<?php
570
-								    }
570
+									}
571 571
 								?>
572 572
 								<td>
573 573
 									<select name="format[]" id="format">
@@ -711,9 +711,9 @@  discard block
 block discarded – undo
711 711
 			    </thead>
712 712
 			    <tbody>
713 713
 				<?php
714
-				    if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) {
714
+					if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) {
715 715
 					foreach ($globalNewsFeeds as $type => $feedslng) {
716
-					    foreach ($feedslng as $lng => $feeds) {
716
+						foreach ($feedslng as $lng => $feeds) {
717 717
 						foreach ($feeds as $feed) {
718 718
 				?>
719 719
 				<tr>
@@ -738,9 +738,9 @@  discard block
 block discarded – undo
738 738
 				
739 739
 				<?php
740 740
 						}
741
-					    }
741
+						}
742
+					}
742 743
 					}
743
-				    }
744 744
 				?>
745 745
 				<tr>
746 746
 				    <td><input type="url" name="newsurl[]" /></td>
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 				<p class="help-block">tsk file can be loaded using http://yourflightairmap/tsk=http://yourtskfile</p>
1146 1146
 			</p>
1147 1147
 			<?php 
1148
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
1148
+				if (extension_loaded('gd') && function_exists('gd_info')) {
1149 1149
 			?>
1150 1150
 			<br />
1151 1151
 			<p>
@@ -1176,14 +1176,14 @@  discard block
 block discarded – undo
1176 1176
 			</p>
1177 1177
 			<?php
1178 1178
 				}
1179
-			    } else {
1179
+				} else {
1180 1180
 			?>
1181 1181
 			<br />
1182 1182
 			<p>
1183 1183
 				<b>PHP GD is not installed, you can't change color of aircraft icon on map</b>
1184 1184
 			</p>
1185 1185
 			<?php
1186
-			    }
1186
+				}
1187 1187
 			?>
1188 1188
 			<br />
1189 1189
 			<p>
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 	</p>
1207 1207
 <?php
1208 1208
 	require('../footer.php');
1209
-        exit;
1209
+		exit;
1210 1210
 }
1211 1211
 // '	
1212 1212
 $settings = array();
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 	
1308 1308
 	$sources = array();
1309 1309
 	foreach ($source_name as $keys => $name) {
1310
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1311
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1310
+		if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1311
+		else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1312 1312
 	}
1313 1313
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1314 1314
 
@@ -1318,13 +1318,13 @@  discard block
 block discarded – undo
1318 1318
 	
1319 1319
 	$newsfeeds = array();
1320 1320
 	foreach($newsurl as $newskey => $url) {
1321
-	    if ($url != '') {
1321
+		if ($url != '') {
1322 1322
 		$type = $newstype[$newskey];
1323 1323
 		$lng = $newslng[$newskey];
1324 1324
 		if (isset($newsfeeds[$type][$lng])) {
1325
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1325
+			$newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1326 1326
 		} else $newsfeeds[$type][$lng] = array($url);
1327
-	    }
1327
+		}
1328 1328
 	}
1329 1329
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1330 1330
 
@@ -1796,14 +1796,14 @@  discard block
 block discarded – undo
1796 1796
 
1797 1797
 	// Set some defaults values...
1798 1798
 	if (!isset($globalAircraftImageSources)) {
1799
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1800
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1799
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1800
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1801 1801
 	}
1802 1802
 
1803 1803
 	if (!isset($globalSchedulesSources)) {
1804
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1805
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1806
-    	}
1804
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1805
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1806
+		}
1807 1807
 
1808 1808
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1809 1809
 
@@ -1851,21 +1851,21 @@  discard block
 block discarded – undo
1851 1851
 	$popi = false;
1852 1852
 	$popw = false;
1853 1853
 	foreach ($_SESSION['done'] as $done) {
1854
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1855
-	    if ($done == 'Create database') $pop = true;
1856
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1857
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1858
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1854
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1855
+		if ($done == 'Create database') $pop = true;
1856
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1857
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1858
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1859 1859
 	}
1860 1860
 	if ($pop) {
1861
-	    sleep(5);
1862
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1861
+		sleep(5);
1862
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1863 1863
 	} else if ($popi) {
1864
-	    sleep(5);
1865
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1864
+		sleep(5);
1865
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1866 1866
 	} else if ($popw) {
1867
-	    sleep(5);
1868
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1867
+		sleep(5);
1868
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1869 1869
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1870 1870
 	print '</div></ul>';
1871 1871
 	print '<div id="error"></div>';
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 	unset($_COOKIE['install']);
1932 1932
 	print '<div class="info column"><ul>';
1933 1933
 	foreach ($_SESSION['done'] as $done) {
1934
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1934
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1935 1935
 	}
1936 1936
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1937 1937
 	print '</ul></div>';
Please login to merge, or discard this patch.
Spacing   +307 added lines, -307 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 require_once(dirname(__FILE__).'/class.create_db.php');
23 23
 require_once(dirname(__FILE__).'/class.update_schema.php');
24 24
 require_once(dirname(__FILE__).'/class.settings.php');
25
-$title="Install";
25
+$title = "Install";
26 26
 require(dirname(__FILE__).'/../require/settings.php');
27 27
 require_once(dirname(__FILE__).'/../require/class.Common.php');
28 28
 require(dirname(__FILE__).'/header.php');
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 	if (!extension_loaded('curl')) {
94 94
 		$error[] = "Curl is not loaded.";
95 95
 	}
96
-	if(function_exists('apache_get_modules') ){
97
-		if(!in_array('mod_rewrite',apache_get_modules())) {
96
+	if (function_exists('apache_get_modules')) {
97
+		if (!in_array('mod_rewrite', apache_get_modules())) {
98 98
 			$error[] = "mod_rewrite is not available.";
99 99
 		}
100 100
 	/*
@@ -113,22 +113,22 @@  discard block
 block discarded – undo
113 113
 		$alllng = $Language->listLocaleDir();
114 114
 		if (count($alllng) != count($availablelng)) {
115 115
 			$notavailable = array();
116
-			foreach($alllng as $lng) {
116
+			foreach ($alllng as $lng) {
117 117
 				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
118 118
 			}
119
-			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
119
+			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ', $notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
120 120
 		}
121 121
 	}
122 122
 	print '<div class="alert alert-info">If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some tables can fail.</div>';
123 123
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
124 124
 		if (function_exists('get_headers')) {
125 125
 			//$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'search',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
126
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'live/geojson?test',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
127
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
126
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/', 'install'), 'live/geojson?test', str_replace('index.php', '', $_SERVER["REQUEST_URI"])));
127
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
128 128
 				print '<div class="alert alert-danger"><strong>Error</strong> Check your configuration, rewrite don\'t seems to work well. If using Apache, you need to desactivate MultiViews <a href="https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration">https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration</a></div>';
129 129
 			} else {
130
-				$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/','install'),'search',str_replace('index.php','',$_SERVER["REQUEST_URI"])));
131
-				if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
130
+				$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace(array('install/', 'install'), 'search', str_replace('index.php', '', $_SERVER["REQUEST_URI"])));
131
+				if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
132 132
 					print '<div class="alert alert-danger"><strong>Error</strong> Check your configuration, rewrite don\'t seems to work well. If using Apache, you need to desactivate MultiViews <a href="https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration">https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration</a></div>';
133 133
 				}
134 134
 			}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) {
209 209
 					if (isset($_SERVER['REQUEST_URI'])) {
210 210
 						$URL = $_SERVER['REQUEST_URI'];
211
-						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL)));
211
+						$globalURL = str_replace('/install', '', str_replace('/install/', '', str_replace('/install/index.php', '', $URL)));
212 212
 					}
213 213
 				    }
214 214
 				?>
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
 ?>
550 550
 							<tr>
551 551
 								<?php
552
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
552
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
553 553
 								?>
554 554
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
555 555
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
556 556
 								<?php
557 557
 								    } else {
558
-									$hostport = explode(':',$source['host']);
558
+									$hostport = explode(':', $source['host']);
559 559
 									if (isset($hostport[1])) {
560 560
 										$host = $hostport[0];
561 561
 										$port = $hostport[1];
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 									<select name="timezones[]" id="timezones">
607 607
 								<?php
608 608
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
609
-									foreach($timezonelist as $timezones){
609
+									foreach ($timezonelist as $timezones) {
610 610
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
611 611
 											print '<option selected>'.$timezones.'</option>';
612 612
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 									<select name="timezones[]" id="timezones">
663 663
 								<?php
664 664
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
665
-									foreach($timezonelist as $timezones){
665
+									foreach ($timezonelist as $timezones) {
666 666
 										if ($timezones == 'UTC') {
667 667
 											print '<option selected>'.$timezones.'</option>';
668 668
 										} else print '<option>'.$timezones.'</option>';
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			<br />
1132 1132
 			<p>
1133 1133
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1134
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1134
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1135 1135
 			</p>
1136 1136
 			<br />
1137 1137
 			<p>
@@ -1214,14 +1214,14 @@  discard block
 block discarded – undo
1214 1214
 $error = '';
1215 1215
 
1216 1216
 if (isset($_POST['dbtype'])) {
1217
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1218
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1219
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1220
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1221
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1222
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1223
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1224
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1217
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1218
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1219
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1220
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1221
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1222
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1223
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1224
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1225 1225
 
1226 1226
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1227 1227
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1241,59 +1241,59 @@  discard block
 block discarded – undo
1241 1241
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1242 1242
 	*/
1243 1243
 	
1244
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1244
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1245 1245
 
1246
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1247
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1248
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1249
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1250
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1246
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1247
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1248
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1249
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1250
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1251 1251
 
1252
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1253
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1254
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1255
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1256
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1257
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1258
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1259
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1260
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1261
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1252
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1253
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1254
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1255
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1256
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1257
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1258
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1259
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1260
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1261
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1262 1262
 	
1263
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1264
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1265
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1266
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1267
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1268
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1263
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1264
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1265
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1266
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1267
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1268
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1269 1269
 
1270
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1271
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1270
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1271
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1272 1272
 
1273
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1274
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1275
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1273
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1274
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1275
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1276 1276
 
1277
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1277
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1278 1278
 	if ($acars == 'acars') {
1279
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1279
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1280 1280
 	} else {
1281
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1281
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1282 1282
 	}
1283
-	$updatecheck = filter_input(INPUT_POST,'updatecheck',FILTER_SANITIZE_STRING);
1283
+	$updatecheck = filter_input(INPUT_POST, 'updatecheck', FILTER_SANITIZE_STRING);
1284 1284
 	if ($updatecheck == 'updatecheck') {
1285
-		$settings = array_merge($settings,array('globalDisableUpdateCheck' => 'TRUE'));
1285
+		$settings = array_merge($settings, array('globalDisableUpdateCheck' => 'TRUE'));
1286 1286
 	} else {
1287
-		$settings = array_merge($settings,array('globalDisableUpdateCheck' => 'FALSE'));
1287
+		$settings = array_merge($settings, array('globalDisableUpdateCheck' => 'FALSE'));
1288 1288
 	}
1289 1289
 
1290
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1291
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1292
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1290
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1291
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1292
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1293 1293
 	
1294
-	$sailawayemail = filter_input(INPUT_POST,'sailawayemail',FILTER_SANITIZE_STRING);
1295
-	$sailawaypass = filter_input(INPUT_POST,'sailawaypassword',FILTER_SANITIZE_STRING);
1296
-	$settings = array_merge($settings,array('globalSailaway' => array('email' => $sailawayemail,'password' => $sailawaypass)));
1294
+	$sailawayemail = filter_input(INPUT_POST, 'sailawayemail', FILTER_SANITIZE_STRING);
1295
+	$sailawaypass = filter_input(INPUT_POST, 'sailawaypassword', FILTER_SANITIZE_STRING);
1296
+	$settings = array_merge($settings, array('globalSailaway' => array('email' => $sailawayemail, 'password' => $sailawaypass)));
1297 1297
 	
1298 1298
 	$source_name = $_POST['source_name'];
1299 1299
 	$source_latitude = $_POST['source_latitude'];
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 	
1308 1308
 	$sources = array();
1309 1309
 	foreach ($source_name as $keys => $name) {
1310
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1311
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1310
+	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]);
1311
+	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]);
1312 1312
 	}
1313 1313
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1314 1314
 
@@ -1317,16 +1317,16 @@  discard block
 block discarded – undo
1317 1317
 	$newstype = $_POST['newstype'];
1318 1318
 	
1319 1319
 	$newsfeeds = array();
1320
-	foreach($newsurl as $newskey => $url) {
1320
+	foreach ($newsurl as $newskey => $url) {
1321 1321
 	    if ($url != '') {
1322 1322
 		$type = $newstype[$newskey];
1323 1323
 		$lng = $newslng[$newskey];
1324 1324
 		if (isset($newsfeeds[$type][$lng])) {
1325
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1325
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1326 1326
 		} else $newsfeeds[$type][$lng] = array($url);
1327 1327
 	    }
1328 1328
 	}
1329
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1329
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1330 1330
 
1331 1331
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1332 1332
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1337,28 +1337,28 @@  discard block
 block discarded – undo
1337 1337
 	$sbsurl = $_POST['sbsurl'];
1338 1338
 	*/
1339 1339
 
1340
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1341
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1342
-	$globalvm = filter_input(INPUT_POST,'globalvm',FILTER_SANITIZE_STRING);
1343
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1344
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1345
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1346
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1347
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1348
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1340
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1341
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1342
+	$globalvm = filter_input(INPUT_POST, 'globalvm', FILTER_SANITIZE_STRING);
1343
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1344
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1345
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1346
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1347
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1348
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1349 1349
 
1350
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1351
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1352
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1353
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1354
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1355
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1356
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1357
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1358
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1359
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1360
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1361
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1350
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1351
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1352
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1353
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1354
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1355
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1356
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1357
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1358
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1359
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1360
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1361
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1362 1362
 
1363 1363
 /*	
1364 1364
 	$globalSBS1Hosts = array();
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 	}
1375 1375
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1376 1376
 */
1377
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1377
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1378 1378
 	$host = $_POST['host'];
1379 1379
 	$port = $_POST['port'];
1380 1380
 	$name = $_POST['name'];
@@ -1391,115 +1391,115 @@  discard block
 block discarded – undo
1391 1391
 		else $cov = 'FALSE';
1392 1392
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1393 1393
 		else $arch = 'FALSE';
1394
-		if (strpos($format[$key],'_callback')) {
1395
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1394
+		if (strpos($format[$key], '_callback')) {
1395
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1396 1396
 		} elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) {
1397
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1397
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1398 1398
 		}
1399 1399
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1400 1400
 	}
1401
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1401
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1402 1402
 
1403 1403
 /*
1404 1404
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1405 1405
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1406 1406
 */
1407
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1408
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1409
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1407
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1408
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1409
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1410 1410
 
1411
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1412
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1411
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1412
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1413 1413
 
1414
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1415
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1414
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1415
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1416 1416
 
1417
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1418
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1417
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1418
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1419 1419
 
1420
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1421
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1422
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1423
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1420
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1421
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1422
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1423
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1424 1424
 
1425
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1426
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1427
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1425
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1426
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1427
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1428 1428
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1429
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1430
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1429
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1430
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1431 1431
 
1432
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1433
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1434
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1435
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1436
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1437
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1438
-	$minfetch = filter_input(INPUT_POST,'minfetch',FILTER_SANITIZE_NUMBER_INT);
1439
-	$settings = array_merge($settings,array('globalMinFetch' => $minfetch));
1440
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1441
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1432
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1433
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1434
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1435
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1436
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1437
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1438
+	$minfetch = filter_input(INPUT_POST, 'minfetch', FILTER_SANITIZE_NUMBER_INT);
1439
+	$settings = array_merge($settings, array('globalMinFetch' => $minfetch));
1440
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1441
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1442 1442
 
1443
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1444
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1443
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1444
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1445 1445
 
1446
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1447
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1446
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1447
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1448 1448
 	
1449
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1449
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1450 1450
 	if ($archiveyear == "archiveyear") {
1451
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1451
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1452 1452
 	} else {
1453
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1453
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1454 1454
 	}
1455
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1456
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1457
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1458
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1455
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1456
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1457
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1458
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1459 1459
 
1460
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1461
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1462
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1463
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1460
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1461
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1462
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1463
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1464 1464
 
1465
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1466
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1467
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1465
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1466
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1467
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1468 1468
 
1469 1469
 	// Create in settings.php keys not yet configurable if not already here
1470 1470
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1471
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1471
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1472 1472
 
1473
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1473
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1474 1474
 	if ($resetyearstats == 'resetyearstats') {
1475
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1475
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1476 1476
 	} else {
1477
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1477
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1478 1478
 	}
1479 1479
 
1480
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1480
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1481 1481
 	if ($archive == 'archive') {
1482
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1482
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1483 1483
 	} else {
1484
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1484
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1485 1485
 	}
1486
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1486
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1487 1487
 	if ($archiveresults == 'archiveresults') {
1488
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1488
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1489 1489
 	} else {
1490
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1490
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1491 1491
 	}
1492
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1492
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1493 1493
 	if ($daemon == 'daemon') {
1494
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1494
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1495 1495
 	} else {
1496
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1496
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1497 1497
 	}
1498
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1498
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1499 1499
 	if ($schedules == 'schedules') {
1500
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1500
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1501 1501
 	} else {
1502
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1502
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1503 1503
 	}
1504 1504
 
1505 1505
 /*
@@ -1510,302 +1510,302 @@  discard block
 block discarded – undo
1510 1510
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1511 1511
 	}
1512 1512
 */
1513
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1514
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1515
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1516
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1517
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1513
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1514
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1515
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1516
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1517
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1518 1518
 	$va = false;
1519 1519
 	if ($globalivao == 'ivao') {
1520
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1520
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1521 1521
 		$va = true;
1522
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1522
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1523 1523
 	if ($globalvatsim == 'vatsim') {
1524
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1524
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1525 1525
 		$va = true;
1526
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1526
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1527 1527
 	if ($globalphpvms == 'phpvms') {
1528
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1528
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1529 1529
 		$va = true;
1530
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1530
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1531 1531
 	if ($globalvam == 'vam') {
1532
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1532
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1533 1533
 		$va = true;
1534
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1534
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1535 1535
 	if ($va) {
1536
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1537
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1536
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1537
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1538 1538
 	if ($globalva == 'va' || $va) {
1539
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1540
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1539
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1540
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1541 1541
 	} else {
1542
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1543
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1544
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1542
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1543
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1544
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1545 1545
 	}
1546 1546
 	if ($globalvm == 'vm') {
1547
-		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
1547
+		$settings = array_merge($settings, array('globalVM' => 'TRUE'));
1548 1548
 	} else {
1549
-		$settings = array_merge($settings,array('globalVM' => 'FALSE'));
1549
+		$settings = array_merge($settings, array('globalVM' => 'FALSE'));
1550 1550
 	}
1551 1551
 	
1552
-	$mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);
1552
+	$mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);
1553 1553
 	if ($mapoffline == 'mapoffline') {
1554
-		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE'));
1554
+		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE'));
1555 1555
 	} else {
1556
-		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE'));
1556
+		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE'));
1557 1557
 	}
1558
-	$globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);
1558
+	$globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);
1559 1559
 	if ($globaloffline == 'globaloffline') {
1560
-		$settings = array_merge($settings,array('globalOffline' => 'TRUE'));
1560
+		$settings = array_merge($settings, array('globalOffline' => 'TRUE'));
1561 1561
 	} else {
1562
-		$settings = array_merge($settings,array('globalOffline' => 'FALSE'));
1562
+		$settings = array_merge($settings, array('globalOffline' => 'FALSE'));
1563 1563
 	}
1564 1564
 
1565
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1565
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1566 1566
 	if ($notam == 'notam') {
1567
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1567
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1568 1568
 	} else {
1569
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1569
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1570 1570
 	}
1571
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1571
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1572 1572
 	if ($owner == 'owner') {
1573
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1573
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1574 1574
 	} else {
1575
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1575
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1576 1576
 	}
1577
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1577
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1578 1578
 	if ($map3d == 'map3d') {
1579
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1579
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1580 1580
 	} else {
1581
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1581
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1582 1582
 	}
1583
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1583
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1584 1584
 	if ($crash == 'crash') {
1585
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1585
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1586 1586
 	} else {
1587
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1587
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1588 1588
 	}
1589
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1589
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1590 1590
 	if ($fires == 'fires') {
1591
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1591
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1592 1592
 	} else {
1593
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1593
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1594 1594
 	}
1595
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1595
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1596 1596
 	if ($firessupport == 'firessupport') {
1597
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1597
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1598 1598
 	} else {
1599
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1599
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1600 1600
 	}
1601
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1601
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1602 1602
 	if ($mapsatellites == 'mapsatellites') {
1603
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1603
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1604 1604
 	} else {
1605
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1605
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1606 1606
 	}
1607
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1607
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1608 1608
 	if ($map3ddefault == 'map3ddefault') {
1609
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1609
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1610 1610
 	} else {
1611
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1611
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1612 1612
 	}
1613
-	$one3dmodel = filter_input(INPUT_POST,'one3dmodel',FILTER_SANITIZE_STRING);
1613
+	$one3dmodel = filter_input(INPUT_POST, 'one3dmodel', FILTER_SANITIZE_STRING);
1614 1614
 	if ($one3dmodel == 'one3dmodel') {
1615
-		$settings = array_merge($settings,array('globalMap3DOneModel' => 'TRUE'));
1615
+		$settings = array_merge($settings, array('globalMap3DOneModel' => 'TRUE'));
1616 1616
 	} else {
1617
-		$settings = array_merge($settings,array('globalMap3DOneModel' => 'FALSE'));
1617
+		$settings = array_merge($settings, array('globalMap3DOneModel' => 'FALSE'));
1618 1618
 	}
1619
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1619
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1620 1620
 	if ($map3dliveries == 'map3dliveries') {
1621
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1621
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1622 1622
 	} else {
1623
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1623
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1624 1624
 	}
1625
-	$map3dshadows = filter_input(INPUT_POST,'map3dshadows',FILTER_SANITIZE_STRING);
1625
+	$map3dshadows = filter_input(INPUT_POST, 'map3dshadows', FILTER_SANITIZE_STRING);
1626 1626
 	if ($map3dshadows == 'map3dshadows') {
1627
-		$settings = array_merge($settings,array('globalMap3DShadows' => 'TRUE'));
1627
+		$settings = array_merge($settings, array('globalMap3DShadows' => 'TRUE'));
1628 1628
 	} else {
1629
-		$settings = array_merge($settings,array('globalMap3DShadows' => 'FALSE'));
1629
+		$settings = array_merge($settings, array('globalMap3DShadows' => 'FALSE'));
1630 1630
 	}
1631
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1631
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1632 1632
 	if ($translate == 'translate') {
1633
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1633
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1634 1634
 	} else {
1635
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1635
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1636 1636
 	}
1637
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1637
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1638 1638
 	if ($realairlines == 'realairlines') {
1639
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1639
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1640 1640
 	} else {
1641
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1641
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1642 1642
 	}
1643
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1643
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1644 1644
 	if ($estimation == 'estimation') {
1645
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1645
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1646 1646
 	} else {
1647
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1647
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1648 1648
 	}
1649
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1649
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1650 1650
 	if ($metar == 'metar') {
1651
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1651
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1652 1652
 	} else {
1653
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1653
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1654 1654
 	}
1655
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1655
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1656 1656
 	if ($metarcycle == 'metarcycle') {
1657
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1657
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1658 1658
 	} else {
1659
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1659
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1660 1660
 	}
1661
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1661
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1662 1662
 	if ($fork == 'fork') {
1663
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1663
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1664 1664
 	} else {
1665
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1665
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1666 1666
 	}
1667 1667
 
1668
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1668
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1669 1669
 	if ($colormap == 'colormap') {
1670
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1670
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1671 1671
 	} else {
1672
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1672
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1673 1673
 	}
1674 1674
 	
1675 1675
 	if (isset($_POST['aircrafticoncolor'])) {
1676
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1677
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1676
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1677
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1678 1678
 	}
1679 1679
 	if (isset($_POST['marineiconcolor'])) {
1680
-		$marineiconcolor = filter_input(INPUT_POST,'marineiconcolor',FILTER_SANITIZE_STRING);
1681
-		$settings = array_merge($settings,array('globalMarineIconColor' => substr($marineiconcolor,1)));
1680
+		$marineiconcolor = filter_input(INPUT_POST, 'marineiconcolor', FILTER_SANITIZE_STRING);
1681
+		$settings = array_merge($settings, array('globalMarineIconColor' => substr($marineiconcolor, 1)));
1682 1682
 	}
1683 1683
 	if (isset($_POST['trackericoncolor'])) {
1684
-		$trackericoncolor = filter_input(INPUT_POST,'trackericoncolor',FILTER_SANITIZE_STRING);
1685
-		$settings = array_merge($settings,array('globalTrackerIconColor' => substr($trackericoncolor,1)));
1684
+		$trackericoncolor = filter_input(INPUT_POST, 'trackericoncolor', FILTER_SANITIZE_STRING);
1685
+		$settings = array_merge($settings, array('globalTrackerIconColor' => substr($trackericoncolor, 1)));
1686 1686
 	}
1687 1687
 	if (isset($_POST['satelliteiconcolor'])) {
1688
-		$satelliteiconcolor = filter_input(INPUT_POST,'satelliteiconcolor',FILTER_SANITIZE_STRING);
1689
-		$settings = array_merge($settings,array('globalSatelliteIconColor' => substr($satelliteiconcolor,1)));
1688
+		$satelliteiconcolor = filter_input(INPUT_POST, 'satelliteiconcolor', FILTER_SANITIZE_STRING);
1689
+		$settings = array_merge($settings, array('globalSatelliteIconColor' => substr($satelliteiconcolor, 1)));
1690 1690
 	}
1691 1691
 
1692
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1693
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1692
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1693
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1694 1694
 
1695
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1696
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1697
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1698
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1699
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1700
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1695
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1696
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1697
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1698
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1699
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1700
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1701 1701
 
1702
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1702
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1703 1703
 	if ($mappopup == 'mappopup') {
1704
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1704
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1705 1705
 	} else {
1706
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1706
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1707 1707
 	}
1708
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1708
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1709 1709
 	if ($airportpopup == 'airportpopup') {
1710
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1710
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1711 1711
 	} else {
1712
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1712
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1713 1713
 	}
1714
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1714
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1715 1715
 	if ($maphistory == 'maphistory') {
1716
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1716
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1717 1717
 	} else {
1718
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1718
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1719 1719
 	}
1720
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1720
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1721 1721
 	if ($maptooltip == 'maptooltip') {
1722
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1722
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1723 1723
 	} else {
1724
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1724
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1725 1725
 	}
1726
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1726
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1727 1727
 	if ($flightroute == 'flightroute') {
1728
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1728
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1729 1729
 	} else {
1730
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1730
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1731 1731
 	}
1732
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1732
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1733 1733
 	if ($flightremainingroute == 'flightremainingroute') {
1734
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1734
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1735 1735
 	} else {
1736
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1736
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1737 1737
 	}
1738
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1738
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1739 1739
 	if ($allflights == 'allflights') {
1740
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1740
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1741 1741
 	} else {
1742
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1742
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1743 1743
 	}
1744
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1744
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1745 1745
 	if ($bbox == 'bbox') {
1746
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1746
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1747 1747
 	} else {
1748
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1748
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1749 1749
 	}
1750
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1750
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1751 1751
 	if ($groundaltitude == 'groundaltitude') {
1752
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1752
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1753 1753
 	} else {
1754
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1754
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1755 1755
 	}
1756
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1756
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1757 1757
 	if ($waypoints == 'waypoints') {
1758
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1758
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1759 1759
 	} else {
1760
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1760
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1761 1761
 	}
1762
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1762
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1763 1763
 	if ($geoid == 'geoid') {
1764
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1764
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1765 1765
 	} else {
1766
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1766
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1767 1767
 	}
1768
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1769
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1768
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1769
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1770 1770
 
1771
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1771
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1772 1772
 	if ($noairlines == 'noairlines') {
1773
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1773
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1774 1774
 	} else {
1775
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1775
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1776 1776
 	}
1777 1777
 
1778
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1778
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1779 1779
 	if ($tsk == 'tsk') {
1780
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1780
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1781 1781
 	} else {
1782
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1782
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1783 1783
 	}
1784
-	$mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);
1784
+	$mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);
1785 1785
 	if ($mapmatching == 'mapmatching') {
1786
-		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE'));
1786
+		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE'));
1787 1787
 	} else {
1788
-		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE'));
1788
+		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE'));
1789 1789
 	}
1790
-	$mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);
1791
-	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource));
1792
-	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1793
-	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1790
+	$mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);
1791
+	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource));
1792
+	$graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);
1793
+	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper));
1794 1794
 
1795
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1795
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1796 1796
 
1797 1797
 	// Set some defaults values...
1798 1798
 	if (!isset($globalAircraftImageSources)) {
1799
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1800
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1799
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1800
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1801 1801
 	}
1802 1802
 
1803 1803
 	if (!isset($globalSchedulesSources)) {
1804
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1805
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1804
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1805
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1806 1806
     	}
1807 1807
 
1808
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1808
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1809 1809
 
1810 1810
 	if ($error == '') settings::modify_settings($settings);
1811 1811
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +629 added lines, -167 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -114,7 +122,9 @@  discard block
 block discarded – undo
114 122
 		if (count($alllng) != count($availablelng)) {
115 123
 			$notavailable = array();
116 124
 			foreach($alllng as $lng) {
117
-				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
125
+				if (!isset($availablelng[$lng])) {
126
+					$notavailable[] = $lng;
127
+				}
118 128
 			}
119 129
 			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
120 130
 		}
@@ -175,31 +185,49 @@  discard block
 block discarded – undo
175 185
 			</div>
176 186
 			<p>
177 187
 				<label for="dbhost">Database hostname</label>
178
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
188
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
189
+	print $globalDBhost;
190
+}
191
+?>" />
179 192
 			</p>
180 193
 			<p>
181 194
 				<label for="dbport">Database port</label>
182
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
195
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
196
+	print $globalDBport;
197
+}
198
+?>" />
183 199
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
184 200
 			</p>
185 201
 			<p>
186 202
 				<label for="dbname">Database name</label>
187
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
203
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
204
+	print $globalDBname;
205
+}
206
+?>" />
188 207
 			</p>
189 208
 			<p>
190 209
 				<label for="dbuser">Database user</label>
191
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
210
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
211
+	print $globalDBuser;
212
+}
213
+?>" />
192 214
 			</p>
193 215
 			<p>
194 216
 				<label for="dbuserpass">Database user password</label>
195
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
217
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
218
+	print $globalDBpass;
219
+}
220
+?>" />
196 221
 			</p>
197 222
 		</fieldset>
198 223
 		<fieldset id="site">
199 224
 			<legend>Site configuration</legend>
200 225
 			<p>
201 226
 				<label for="sitename">Site name</label>
202
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
227
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
228
+	print $globalName;
229
+}
230
+?>" />
203 231
 			</p>
204 232
 			<p>
205 233
 				<label for="siteurl">Site directory</label>
@@ -212,18 +240,27 @@  discard block
 block discarded – undo
212 240
 					}
213 241
 				    }
214 242
 				?>
215
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
243
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
244
+	print $globalURL;
245
+}
246
+?>" />
216 247
 				<p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
217 248
 				<p class="help-block">Can be empty</p>
218 249
 			</p>
219 250
 			<p>
220 251
 				<label for="timezone">Timezone</label>
221
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
252
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
253
+	print $globalTimezone;
254
+}
255
+?>" />
222 256
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
223 257
 			</p>
224 258
 			<p>
225 259
 				<label for="language">Language</label>
226
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
260
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
261
+	print $globalLanguage;
262
+}
263
+?>" />
227 264
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
228 265
 			</p>
229 266
 		</fieldset>
@@ -243,11 +280,17 @@  discard block
 block discarded – undo
243 280
 			<div id="mapbox_data">
244 281
 				<p>
245 282
 					<label for="mapboxid">Mapbox id</label>
246
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
283
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
284
+	print $globalMapboxId;
285
+}
286
+?>" />
247 287
 				</p>
248 288
 				<p>
249 289
 					<label for="mapboxtoken">Mapbox token</label>
250
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
290
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
291
+	print $globalMapboxToken;
292
+}
293
+?>" />
251 294
 				</p>
252 295
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
253 296
 			</div>
@@ -255,7 +298,10 @@  discard block
 block discarded – undo
255 298
 			<div id="google_data">
256 299
 				<p>
257 300
 					<label for="googlekey">Google API key</label>
258
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
301
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
302
+	print $globalGoogleAPIKey;
303
+}
304
+?>" />
259 305
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
260 306
 				</p>
261 307
 			</div>
@@ -263,7 +309,10 @@  discard block
 block discarded – undo
263 309
 			<div id="bing_data">
264 310
 				<p>
265 311
 					<label for="bingkey">Bing Map key</label>
266
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
312
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
313
+	print $globalBingMapKey;
314
+}
315
+?>" />
267 316
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
268 317
 				</p>
269 318
 			</div>
@@ -271,7 +320,10 @@  discard block
 block discarded – undo
271 320
 			<div id="mapquest_data">
272 321
 				<p>
273 322
 					<label for="mapquestkey">MapQuest key</label>
274
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
323
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
324
+	print $globalMapQuestKey;
325
+}
326
+?>" />
275 327
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
276 328
 				</p>
277 329
 			</div>
@@ -279,11 +331,17 @@  discard block
 block discarded – undo
279 331
 			<div id="here_data">
280 332
 				<p>
281 333
 					<label for="hereappid">Here App_Id</label>
282
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
334
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
335
+	print $globalHereappId;
336
+}
337
+?>" />
283 338
 				</p>
284 339
 				<p>
285 340
 					<label for="hereappcode">Here App_Code</label>
286
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
341
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
342
+	print $globalHereappCode;
343
+}
344
+?>" />
287 345
 				</p>
288 346
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
289 347
 			</div>
@@ -291,7 +349,10 @@  discard block
 block discarded – undo
291 349
 			<div id="openweathermap_data">
292 350
 				<p>
293 351
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
294
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
352
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
353
+	print $globalOpenWeatherMapKey;
354
+}
355
+?>" />
295 356
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
296 357
 				</p>
297 358
 			</div>
@@ -320,42 +381,86 @@  discard block
 block discarded – undo
320 381
 			<legend>Coverage area</legend>
321 382
 			<p>
322 383
 				<label for="latitudemax">The maximum latitude (north)</label>
323
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
384
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
385
+	print $globalLatitudeMax;
386
+}
387
+?>" />
324 388
 			</p>
325 389
 			<p>
326 390
 				<label for="latitudemin">The minimum latitude (south)</label>
327
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
391
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
392
+	print $globalLatitudeMin;
393
+}
394
+?>" />
328 395
 			</p>
329 396
 			<p>
330 397
 				<label for="longitudemax">The maximum longitude (west)</label>
331
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
398
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
399
+	print $globalLongitudeMax;
400
+}
401
+?>" />
332 402
 			</p>
333 403
 			<p>
334 404
 				<label for="longitudemin">The minimum longitude (east)</label>
335
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
405
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
406
+	print $globalLongitudeMin;
407
+}
408
+?>" />
336 409
 			</p>
337 410
 			<p>
338 411
 				<label for="latitudecenter">The latitude center</label>
339
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
412
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
413
+	print $globalCenterLatitude;
414
+}
415
+?>" />
340 416
 			</p>
341 417
 			<p>
342 418
 				<label for="longitudecenter">The longitude center</label>
343
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
419
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
420
+	print $globalCenterLongitude;
421
+}
422
+?>" />
344 423
 			</p>
345 424
 			<p>
346 425
 				<label for="livezoom">Default Zoom on live map</label>
347
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
426
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
427
+	print $globalLiveZoom;
428
+} else {
429
+	print '9';
430
+}
431
+?>" />
348 432
 			</p>
349 433
 			<p>
350 434
 				<label for="squawk_country">Country for squawk usage</label>
351 435
 				<select name="squawk_country" id="squawk_country">
352
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
353
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
354
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
355
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
356
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
357
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
358
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
436
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
437
+	print ' selected ';
438
+}
439
+?>>UK</option>
440
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
441
+	print ' selected ';
442
+}
443
+?>>NZ</option>
444
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
445
+	print ' selected ';
446
+}
447
+?>>US</option>
448
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
449
+	print ' selected ';
450
+}
451
+?>>AU</option>
452
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
453
+	print ' selected ';
454
+}
455
+?>>NL</option>
456
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
457
+	print ' selected ';
458
+}
459
+?>>FR</option>
460
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
461
+	print ' selected ';
462
+}
463
+?>>TR</option>
359 464
 				</select>
360 465
 			</p>
361 466
 		</fieldset>
@@ -364,15 +469,24 @@  discard block
 block discarded – undo
364 469
 			<p><i>Only put in DB flights that are inside a circle</i></p>
365 470
 			<p>
366 471
 				<label for="latitude">Center latitude</label>
367
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
472
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
473
+	echo $globalDistanceIgnore['latitude'];
474
+}
475
+?>" />
368 476
 			</p>
369 477
 			<p>
370 478
 				<label for="longitude">Center longitude</label>
371
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
479
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
480
+	echo $globalDistanceIgnore['longitude'];
481
+}
482
+?>" />
372 483
 			</p>
373 484
 			<p>
374 485
 				<label for="Distance">Distance (in km)</label>
375
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
486
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
487
+	echo $globalDistanceIgnore['distance'];
488
+}
489
+?>" />
376 490
 			</p>
377 491
 		</fieldset>
378 492
 		<fieldset id="sourceloc">
@@ -495,22 +609,34 @@  discard block
 block discarded – undo
495 609
 			<div id="flightaware_data">
496 610
 				<p>
497 611
 					<label for="flightawareusername">FlightAware username</label>
498
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
612
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
613
+	print $globalFlightAwareUsername;
614
+}
615
+?>" />
499 616
 				</p>
500 617
 				<p>
501 618
 					<label for="flightawarepassword">FlightAware password/API key</label>
502
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
619
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
620
+	print $globalFlightAwarePassword;
621
+}
622
+?>" />
503 623
 				</p>
504 624
 			</div>
505 625
 -->
506 626
 			<div id="sailaway_data">
507 627
 				<p>
508 628
 					<label for="sailawayemail">Sailaway email</label>
509
-					<input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) print $globalSailaway['email']; ?>" />
629
+					<input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) {
630
+	print $globalSailaway['email'];
631
+}
632
+?>" />
510 633
 				</p>
511 634
 				<p>
512 635
 					<label for="sailawaypassword">Sailaway password</label>
513
-					<input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) print $globalSailaway['password']; ?>" />
636
+					<input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) {
637
+	print $globalSailaway['password'];
638
+}
639
+?>" />
514 640
 				</p>
515 641
 			</div>
516 642
 
@@ -552,7 +678,10 @@  discard block
 block discarded – undo
552 678
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
553 679
 								?>
554 680
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
555
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
681
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
682
+	print $source['port'];
683
+}
684
+?>" /></td>
556 685
 								<?php
557 686
 								    } else {
558 687
 									$hostport = explode(':',$source['host']);
@@ -571,37 +700,118 @@  discard block
 block discarded – undo
571 700
 								?>
572 701
 								<td>
573 702
 									<select name="format[]" id="format">
574
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
575
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
576
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
577
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
578
-										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
579
-										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option>
580
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
581
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
582
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
583
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
584
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
585
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
586
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
587
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
588
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
589
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
590
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
591
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
592
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
593
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
594
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
595
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
596
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
597
-										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option>
703
+										<option value="auto" <?php if (!isset($source['format'])) {
704
+	print 'selected';
705
+}
706
+?>>Auto</option>
707
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
708
+	print 'selected';
709
+}
710
+?>>SBS</option>
711
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
712
+	print 'selected';
713
+}
714
+?>>TSV</option>
715
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
716
+	print 'selected';
717
+}
718
+?>>Raw</option>
719
+										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') {
720
+	print 'selected';
721
+}
722
+?>>Dump1090 aircraft.json</option>
723
+										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') {
724
+	print 'selected';
725
+}
726
+?>>Planefinder client</option>
727
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
728
+	print 'selected';
729
+}
730
+?>>APRS</option>
731
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
732
+	print 'selected';
733
+}
734
+?>>Radarcape deltadb.txt</option>
735
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
736
+	print 'selected';
737
+}
738
+?>>Vatsim</option>
739
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
740
+	print 'selected';
741
+}
742
+?>>Virtual Radar Server AircraftList.json</option>
743
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
744
+	print 'selected';
745
+}
746
+?>>Virtual Radar Server TCP</option>
747
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
748
+	print 'selected';
749
+}
750
+?>>phpVMS</option>
751
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
752
+	print 'selected';
753
+}
754
+?>>Virtual Airline Operations System (VAOS)</option>
755
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
756
+	print 'selected';
757
+}
758
+?>>Virtual Airlines Manager</option>
759
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
760
+	print 'selected';
761
+}
762
+?>>IVAO</option>
763
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
764
+	print 'selected';
765
+}
766
+?>>FlightGear Multiplayer</option>
767
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
768
+	print 'selected';
769
+}
770
+?>>FlightGear Singleplayer</option>
771
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
772
+	print 'selected';
773
+}
774
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
775
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
776
+	print 'selected';
777
+}
778
+?>>ACARS SBS-3 over TCP</option>
779
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
780
+	print 'selected';
781
+}
782
+?>>NMEA AIS over TCP</option>
783
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
784
+	print 'selected';
785
+}
786
+?>>AirWhere website</option>
787
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
788
+	print 'selected';
789
+}
790
+?>>HidnSeek Callback</option>
791
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
792
+	print 'selected';
793
+}
794
+?>>Blitzortung</option>
795
+										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') {
796
+	print 'selected';
797
+}
798
+?>>Sailaway</option>
598 799
 									</select>
599 800
 								</td>
600 801
 								<td>
601
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
802
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
803
+	print $source['name'];
804
+}
805
+?>" />
602 806
 								</td>
603
-								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
604
-								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
807
+								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
808
+	print 'checked';
809
+}
810
+?> /></td>
811
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
812
+	print 'checked';
813
+}
814
+?> /></td>
605 815
 								<td>
606 816
 									<select name="timezones[]" id="timezones">
607 817
 								<?php
@@ -611,7 +821,9 @@  discard block
 block discarded – undo
611 821
 											print '<option selected>'.$timezones.'</option>';
612 822
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
613 823
 											print '<option selected>'.$timezones.'</option>';
614
-										} else print '<option>'.$timezones.'</option>';
824
+										} else {
825
+											print '<option>'.$timezones.'</option>';
826
+										}
615 827
 									}
616 828
 								?>
617 829
 									</select>
@@ -665,7 +877,9 @@  discard block
 block discarded – undo
665 877
 									foreach($timezonelist as $timezones){
666 878
 										if ($timezones == 'UTC') {
667 879
 											print '<option selected>'.$timezones.'</option>';
668
-										} else print '<option>'.$timezones.'</option>';
880
+										} else {
881
+											print '<option>'.$timezones.'</option>';
882
+										}
669 883
 									}
670 884
 								?>
671 885
 									</select>
@@ -690,11 +904,17 @@  discard block
 block discarded – undo
690 904
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
691 905
 					<p>
692 906
 						<label for="acarshost">ACARS UDP host</label>
693
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
907
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
908
+	print $globalACARSHost;
909
+}
910
+?>" />
694 911
 					</p>
695 912
 					<p>
696 913
 						<label for="acarsport">ACARS UDP port</label>
697
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
914
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
915
+	print $globalACARSPort;
916
+}
917
+?>" />
698 918
 					</p>
699 919
 				</fieldset>
700 920
 			</div>
@@ -720,17 +940,38 @@  discard block
 block discarded – undo
720 940
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
721 941
 				    <td>
722 942
 					<select name="newslang[]">
723
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
724
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
943
+					    <option value="en"<?php if ($lng == 'en') {
944
+	print ' selected';
945
+}
946
+?>>English</option>
947
+					    <option value="fr"<?php if ($lng == 'fr') {
948
+	print ' selected';
949
+}
950
+?>>French</option>
725 951
 					</select>
726 952
 				    </td>
727 953
 				    <td>
728 954
 					<select name="newstype[]">
729
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
730
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
731
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
732
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
733
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
955
+					    <option value="global"<?php if ($type == 'global') {
956
+	print ' selected';
957
+}
958
+?>>Global</option>
959
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
960
+	print ' selected';
961
+}
962
+?>>Aircraft</option>
963
+					    <option value="marine"<?php if ($type == 'marine') {
964
+	print ' selected';
965
+}
966
+?>>Marine</option>
967
+					    <option value="tracker"<?php if ($type == 'tracker') {
968
+	print ' selected';
969
+}
970
+?>>Tracker</option>
971
+					    <option value="satellite"<?php if ($type == 'Satellite') {
972
+	print ' selected';
973
+}
974
+?>>Satellite</option>
734 975
 					</select>
735 976
 				    </td>
736 977
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -872,13 +1113,19 @@  discard block
 block discarded – undo
872 1113
 			<div id="schedules_options">
873 1114
 				<p>
874 1115
 					<label for="britishairways">British Airways API Key</label>
875
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1116
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1117
+	print $globalBritishAirwaysKey;
1118
+}
1119
+?>" />
876 1120
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
877 1121
 				</p>
878 1122
 				<!--
879 1123
 				<p>
880 1124
 					<label for="transavia">Transavia Test API Consumer Key</label>
881
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1125
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1126
+	print $globalTransaviaKey;
1127
+}
1128
+?>" />
882 1129
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
883 1130
 				</p>
884 1131
 				-->
@@ -887,10 +1134,16 @@  discard block
 block discarded – undo
887 1134
 						<b>Lufthansa API Key</b>
888 1135
 						<p>
889 1136
 							<label for="lufthansakey">Key</label>
890
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1137
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1138
+	print $globalLufthansaKey['key'];
1139
+}
1140
+?>" />
891 1141
 						</p><p>
892 1142
 							<label for="lufthansasecret">Secret</label>
893
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1143
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1144
+	print $globalLufthansaKey['secret'];
1145
+}
1146
+?>" />
894 1147
 						</p>
895 1148
 					</div>
896 1149
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -900,11 +1153,17 @@  discard block
 block discarded – undo
900 1153
 						<b>FlightAware API Key</b>
901 1154
 						<p>
902 1155
 							<label for="flightawareusername">Username</label>
903
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1156
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1157
+	print $globalFlightAwareUsername;
1158
+}
1159
+?>" />
904 1160
 						</p>
905 1161
 						<p>
906 1162
 							<label for="flightawarepassword">API key</label>
907
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1163
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1164
+	print $globalFlightAwarePassword;
1165
+}
1166
+?>" />
908 1167
 						</p>
909 1168
 					</div>
910 1169
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -921,10 +1180,22 @@  discard block
 block discarded – undo
921 1180
 				<p>
922 1181
 					<label for="mapmatchingsource">Map Matching source</label>
923 1182
 					<select name="mapmatchingsource" id="mapmatchingsource">
924
-						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option>
925
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
926
-						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option>
927
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1183
+						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) {
1184
+	print 'selected="selected" ';
1185
+}
1186
+?>>FlightAirMap Map Matching</option>
1187
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1188
+	print 'selected="selected" ';
1189
+}
1190
+?>>GraphHopper</option>
1191
+						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') {
1192
+	print 'selected="selected" ';
1193
+}
1194
+?>>OSMR</option>
1195
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1196
+	print 'selected="selected" ';
1197
+}
1198
+?>>Mapbox</option>
928 1199
 					</select>
929 1200
 					<p class="help-block">Mapbox need the API Key defined in map section.</p>
930 1201
 					<p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p>
@@ -932,7 +1203,10 @@  discard block
 block discarded – undo
932 1203
 				<br />
933 1204
 				<p>
934 1205
 					<label for="graphhopper">GraphHopper API Key</label>
935
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1206
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1207
+	print $globalGraphHopperKey;
1208
+}
1209
+?>" />
936 1210
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
937 1211
 				</p>
938 1212
 			</div>
@@ -950,7 +1224,10 @@  discard block
 block discarded – undo
950 1224
 			</p>
951 1225
 			<p>
952 1226
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
953
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1227
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1228
+	print $globalNOTAMSource;
1229
+}
1230
+?>" />
954 1231
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
955 1232
 			</p>
956 1233
 			<br />
@@ -966,14 +1243,20 @@  discard block
 block discarded – undo
966 1243
 			<div id="metarsrc">
967 1244
 				<p>
968 1245
 					<label for="metarsource">URL of your METAR source</label>
969
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1246
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1247
+	print $globalMETARurl;
1248
+}
1249
+?>" />
970 1250
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
971 1251
 				</p>
972 1252
 			</div>
973 1253
 			<br />
974 1254
 			<p>
975 1255
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
976
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1256
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1257
+	print $globalBitlyAccessToken;
1258
+}
1259
+?>" />
977 1260
 			</p>
978 1261
 			<br />
979 1262
 			<p>
@@ -989,11 +1272,26 @@  discard block
 block discarded – undo
989 1272
 			<p>
990 1273
 				<label for="geoid_source">Geoid Source</label>
991 1274
 				<select name="geoid_source" id="geoid_source">
992
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
993
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
994
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
995
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
996
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1275
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1276
+	print ' selected="selected"';
1277
+}
1278
+?>>EGM96 15' (2.1MB)</option>
1279
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1280
+	print ' selected="selected"';
1281
+}
1282
+?>>EGM96 5' (19MB)</option>
1283
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1284
+	print ' selected="selected"';
1285
+}
1286
+?>>EGM2008 5' (19MB)</option>
1287
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1288
+	print ' selected="selected"';
1289
+}
1290
+?>>EGM2008 2.5' (75MB)</option>
1291
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1292
+	print ' selected="selected"';
1293
+}
1294
+?>>EGM2008 1' (470MB)</option>
997 1295
 				</select>
998 1296
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
999 1297
 			</p>
@@ -1015,7 +1313,12 @@  discard block
 block discarded – undo
1015 1313
 			</p>
1016 1314
 			<p>
1017 1315
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
1018
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1316
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1317
+	print $globalArchiveMonths;
1318
+} else {
1319
+	echo '1';
1320
+}
1321
+?>" />
1019 1322
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
1020 1323
 			</p>
1021 1324
 			<p>
@@ -1025,12 +1328,22 @@  discard block
 block discarded – undo
1025 1328
 			</p>
1026 1329
 			<p>
1027 1330
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
1028
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1331
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1332
+	print $globalArchiveKeepMonths;
1333
+} else {
1334
+	echo '1';
1335
+}
1336
+?>" />
1029 1337
 				<p class="help-block">0 to disable</p>
1030 1338
 			</p>
1031 1339
 			<p>
1032 1340
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
1033
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1341
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1342
+	print $globalArchiveKeepTrackMonths;
1343
+} else {
1344
+	echo '1';
1345
+}
1346
+?>" />
1034 1347
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
1035 1348
 			</p>
1036 1349
 			<br />
@@ -1040,7 +1353,12 @@  discard block
 block discarded – undo
1040 1353
 				<p class="help-block">Uncheck if the script is running as cron job. You should always run it as daemon when it's possible.</p>
1041 1354
 				<div id="cronends"> 
1042 1355
 					<label for="cronend">Run script for xx seconds</label>
1043
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1356
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1357
+	print $globalCronEnd;
1358
+} else {
1359
+	print '0';
1360
+}
1361
+?>" />
1044 1362
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
1045 1363
 				</div>
1046 1364
 			</p>
@@ -1099,20 +1417,40 @@  discard block
 block discarded – undo
1099 1417
 			<br />
1100 1418
 			<p>
1101 1419
 				<label for="refresh">Show flights detected since xxx seconds</label>
1102
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1420
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1421
+	echo $globalLiveInterval;
1422
+} else {
1423
+	echo '200';
1424
+}
1425
+?>" />
1103 1426
 			</p>
1104 1427
 			<p>
1105 1428
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1106
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1429
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1430
+	echo $globalMapRefresh;
1431
+} else {
1432
+	echo '30';
1433
+}
1434
+?>" />
1107 1435
 			</p>
1108 1436
 			<p>
1109 1437
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1110
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1438
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1439
+	echo $globalMapIdleTimeout;
1440
+} else {
1441
+	echo '30';
1442
+}
1443
+?>" />
1111 1444
 				<p class="help-block">0 to disable</p>
1112 1445
 			</p>
1113 1446
 			<p>
1114 1447
 				<label for="minfetch">HTTP/file source fetch every xxx seconds</label>
1115
-				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" />
1448
+				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) {
1449
+	echo $globalMinFetch;
1450
+} else {
1451
+	echo '20';
1452
+}
1453
+?>" />
1116 1454
 			</p>
1117 1455
 			<p>
1118 1456
 				<label for="bbox">Only display flights that we can see on screen (bounding box)</label>
@@ -1126,12 +1464,20 @@  discard block
 block discarded – undo
1126 1464
 			<br />
1127 1465
 			<p>
1128 1466
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1129
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1467
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1468
+	echo $globalClosestMinDist;
1469
+} else {
1470
+	echo '50';
1471
+}
1472
+?>" />
1130 1473
 			</p>
1131 1474
 			<br />
1132 1475
 			<p>
1133 1476
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1134
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1477
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1478
+	echo $globalAircraftSize;
1479
+}
1480
+?>" />
1135 1481
 			</p>
1136 1482
 			<br />
1137 1483
 			<p>
@@ -1150,22 +1496,42 @@  discard block
 block discarded – undo
1150 1496
 			<br />
1151 1497
 			<p>
1152 1498
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1153
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1499
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1500
+	echo $globalAircraftIconColor;
1501
+} else {
1502
+	echo '1a3151';
1503
+}
1504
+?>" />
1154 1505
 			</p>
1155 1506
 			<br />
1156 1507
 			<p>
1157 1508
 				<label for="marineiconcolor">Color of marine icon on map</label>
1158
-				<input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) echo $globalMarineIconColor; else echo '1a3151'; ?>" />
1509
+				<input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) {
1510
+	echo $globalMarineIconColor;
1511
+} else {
1512
+	echo '1a3151';
1513
+}
1514
+?>" />
1159 1515
 			</p>
1160 1516
 			<br />
1161 1517
 			<p>
1162 1518
 				<label for="trackericoncolor">Color of tracker icon on map</label>
1163
-				<input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) echo $globalTrackerIconColor; else echo '1a3151'; ?>" />
1519
+				<input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) {
1520
+	echo $globalTrackerIconColor;
1521
+} else {
1522
+	echo '1a3151';
1523
+}
1524
+?>" />
1164 1525
 			</p>
1165 1526
 			<br />
1166 1527
 			<p>
1167 1528
 				<label for="satelliteiconcolor">Color of satellite icon on map</label>
1168
-				<input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) echo $globalSatelliteIconColor; else echo '1a3151'; ?>" />
1529
+				<input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) {
1530
+	echo $globalSatelliteIconColor;
1531
+} else {
1532
+	echo '1a3151';
1533
+}
1534
+?>" />
1169 1535
 			</p>
1170 1536
 			<?php
1171 1537
 				if (!is_writable('../cache')) {
@@ -1189,14 +1555,27 @@  discard block
 block discarded – undo
1189 1555
 			<p>
1190 1556
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1191 1557
 				<div class="range">
1192
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1193
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1558
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1559
+	echo $globalAirportZoom;
1560
+} else {
1561
+	echo '7';
1562
+}
1563
+?>" />
1564
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1565
+	echo $globalAirportZoom;
1566
+} else {
1567
+	echo '7';
1568
+}
1569
+?></output>
1194 1570
 				</div>
1195 1571
 			</p>
1196 1572
 			<br />
1197 1573
 			<p>
1198 1574
 				<label for="customcss">Custom CSS web path</label>
1199
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1575
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1576
+	echo $globalCustomCSS;
1577
+}
1578
+?>" />
1200 1579
 			</p>
1201 1580
 		</fieldset>
1202 1581
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1223,8 +1602,12 @@  discard block
 block discarded – undo
1223 1602
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1224 1603
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1225 1604
 
1226
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1227
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1605
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1606
+		$error .= 'Mysql driver for PDO must be loaded';
1607
+	}
1608
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1609
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1610
+	}
1228 1611
 	
1229 1612
 	$_SESSION['database_root'] = $dbroot;
1230 1613
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1302,15 +1685,23 @@  discard block
 block discarded – undo
1302 1685
 	$source_city = $_POST['source_city'];
1303 1686
 	$source_country = $_POST['source_country'];
1304 1687
 	$source_ref = $_POST['source_ref'];
1305
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1306
-	else $source_id = array();
1688
+	if (isset($source_id)) {
1689
+		$source_id = $_POST['source_id'];
1690
+	} else {
1691
+		$source_id = array();
1692
+	}
1307 1693
 	
1308 1694
 	$sources = array();
1309 1695
 	foreach ($source_name as $keys => $name) {
1310
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1311
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1696
+	    if (isset($source_id[$keys])) {
1697
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1698
+	    } else {
1699
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1700
+	    }
1701
+	}
1702
+	if (count($sources) > 0) {
1703
+		$_SESSION['sources'] = $sources;
1312 1704
 	}
1313
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1314 1705
 
1315 1706
 	$newsurl = $_POST['newsurl'];
1316 1707
 	$newslng = $_POST['newslang'];
@@ -1323,7 +1714,9 @@  discard block
 block discarded – undo
1323 1714
 		$lng = $newslng[$newskey];
1324 1715
 		if (isset($newsfeeds[$type][$lng])) {
1325 1716
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1326
-		} else $newsfeeds[$type][$lng] = array($url);
1717
+		} else {
1718
+			$newsfeeds[$type][$lng] = array($url);
1719
+		}
1327 1720
 	    }
1328 1721
 	}
1329 1722
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1348,17 +1741,29 @@  discard block
 block discarded – undo
1348 1741
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1349 1742
 
1350 1743
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1351
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1352
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1744
+	if ($globalaircraft == 'aircraft') {
1745
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1746
+	} else {
1747
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1748
+	}
1353 1749
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1354
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1355
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1750
+	if ($globaltracker == 'tracker') {
1751
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1752
+	} else {
1753
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1754
+	}
1356 1755
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1357
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1358
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1756
+	if ($globalmarine == 'marine') {
1757
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1758
+	} else {
1759
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1760
+	}
1359 1761
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1360
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1361
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1762
+	if ($globalsatellite == 'satellite') {
1763
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1764
+	} else {
1765
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1766
+	}
1362 1767
 
1363 1768
 /*	
1364 1769
 	$globalSBS1Hosts = array();
@@ -1380,23 +1785,37 @@  discard block
 block discarded – undo
1380 1785
 	$name = $_POST['name'];
1381 1786
 	$format = $_POST['format'];
1382 1787
 	$timezones = $_POST['timezones'];
1383
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1384
-	else $sourcestats = array();
1385
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1386
-	else $noarchive = array();
1788
+	if (isset($_POST['sourcestats'])) {
1789
+		$sourcestats = $_POST['sourcestats'];
1790
+	} else {
1791
+		$sourcestats = array();
1792
+	}
1793
+	if (isset($_POST['noarchive'])) {
1794
+		$noarchive = $_POST['noarchive'];
1795
+	} else {
1796
+		$noarchive = array();
1797
+	}
1387 1798
 	$gSources = array();
1388 1799
 	$forcepilots = false;
1389 1800
 	foreach ($host as $key => $h) {
1390
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1391
-		else $cov = 'FALSE';
1392
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1393
-		else $arch = 'FALSE';
1801
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1802
+			$cov = 'TRUE';
1803
+		} else {
1804
+			$cov = 'FALSE';
1805
+		}
1806
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1807
+			$arch = 'TRUE';
1808
+		} else {
1809
+			$arch = 'FALSE';
1810
+		}
1394 1811
 		if (strpos($format[$key],'_callback')) {
1395 1812
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1396 1813
 		} elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) {
1397 1814
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1398 1815
 		}
1399
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1816
+		if ($format[$key] == 'airwhere') {
1817
+			$forcepilots = true;
1818
+		}
1400 1819
 	}
1401 1820
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1402 1821
 
@@ -1427,7 +1846,9 @@  discard block
 block discarded – undo
1427 1846
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1428 1847
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1429 1848
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1430
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1849
+	} else {
1850
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1851
+	}
1431 1852
 
1432 1853
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1433 1854
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1468,7 +1889,9 @@  discard block
 block discarded – undo
1468 1889
 
1469 1890
 	// Create in settings.php keys not yet configurable if not already here
1470 1891
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1471
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1892
+	if (!isset($globalDebug)) {
1893
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1894
+	}
1472 1895
 
1473 1896
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1474 1897
 	if ($resetyearstats == 'resetyearstats') {
@@ -1511,37 +1934,56 @@  discard block
 block discarded – undo
1511 1934
 	}
1512 1935
 */
1513 1936
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1514
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1515
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1516
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1517
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1937
+	if ($globalsbs == 'sbs') {
1938
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1939
+	} else {
1940
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1941
+	}
1942
+	if ($globalaprs == 'aprs') {
1943
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1944
+	} else {
1945
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1946
+	}
1518 1947
 	$va = false;
1519 1948
 	if ($globalivao == 'ivao') {
1520 1949
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1521 1950
 		$va = true;
1522
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1951
+	} else {
1952
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1953
+	}
1523 1954
 	if ($globalvatsim == 'vatsim') {
1524 1955
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1525 1956
 		$va = true;
1526
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1957
+	} else {
1958
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1959
+	}
1527 1960
 	if ($globalphpvms == 'phpvms') {
1528 1961
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1529 1962
 		$va = true;
1530
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1963
+	} else {
1964
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1965
+	}
1531 1966
 	if ($globalvam == 'vam') {
1532 1967
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1533 1968
 		$va = true;
1534
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1969
+	} else {
1970
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1971
+	}
1535 1972
 	if ($va) {
1536 1973
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1537
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1974
+	} else {
1975
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1976
+	}
1538 1977
 	if ($globalva == 'va' || $va) {
1539 1978
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1540 1979
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1541 1980
 	} else {
1542 1981
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1543
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1544
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1982
+		if ($forcepilots) {
1983
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1984
+		} else {
1985
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1986
+		}
1545 1987
 	}
1546 1988
 	if ($globalvm == 'vm') {
1547 1989
 		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
@@ -1792,7 +2234,9 @@  discard block
 block discarded – undo
1792 2234
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1793 2235
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1794 2236
 
1795
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2237
+	if (!isset($globalTransaction)) {
2238
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2239
+	}
1796 2240
 
1797 2241
 	// Set some defaults values...
1798 2242
 	if (!isset($globalAircraftImageSources)) {
@@ -1807,15 +2251,23 @@  discard block
 block discarded – undo
1807 2251
 
1808 2252
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1809 2253
 
1810
-	if ($error == '') settings::modify_settings($settings);
1811
-	if ($error == '') settings::comment_settings($settings_comment);
2254
+	if ($error == '') {
2255
+		settings::modify_settings($settings);
2256
+	}
2257
+	if ($error == '') {
2258
+		settings::comment_settings($settings_comment);
2259
+	}
1812 2260
 	if ($error != '') {
1813 2261
 		print '<div class="info column">'.$error.'</div>';
1814 2262
 		require('../footer.php');
1815 2263
 		exit;
1816 2264
 	} else {
1817
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1818
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2265
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2266
+			$_SESSION['waypoints'] = 1;
2267
+		}
2268
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2269
+			$_SESSION['owner'] = 1;
2270
+		}
1819 2271
 		if (isset($_POST['createdb'])) {
1820 2272
 			$_SESSION['install'] = 'database_create';
1821 2273
 		} else {
@@ -1852,10 +2304,18 @@  discard block
 block discarded – undo
1852 2304
 	$popw = false;
1853 2305
 	foreach ($_SESSION['done'] as $done) {
1854 2306
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1855
-	    if ($done == 'Create database') $pop = true;
1856
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1857
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1858
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2307
+	    if ($done == 'Create database') {
2308
+	    	$pop = true;
2309
+	    }
2310
+	    if ($_SESSION['install'] == 'database_create') {
2311
+	    	$pop = true;
2312
+	    }
2313
+	    if ($_SESSION['install'] == 'database_import') {
2314
+	    	$popi = true;
2315
+	    }
2316
+	    if ($_SESSION['install'] == 'waypoints') {
2317
+	    	$popw = true;
2318
+	    }
1859 2319
 	}
1860 2320
 	if ($pop) {
1861 2321
 	    sleep(5);
@@ -1866,7 +2326,9 @@  discard block
 block discarded – undo
1866 2326
 	} else if ($popw) {
1867 2327
 	    sleep(5);
1868 2328
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1869
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2329
+	} else {
2330
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2331
+	}
1870 2332
 	print '</div></ul>';
1871 2333
 	print '<div id="error"></div>';
1872 2334
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.