@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once(dirname(__FILE__).'/class.create_db.php'); |
11 | 11 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
12 | 12 | require_once(dirname(__FILE__).'/class.settings.php'); |
13 | -$title="Install"; |
|
13 | +$title = "Install"; |
|
14 | 14 | require(dirname(__FILE__).'/../require/settings.php'); |
15 | 15 | require(dirname(__FILE__).'/header.php'); |
16 | 16 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | if (!extension_loaded('curl')) { |
70 | 70 | $error[] = "Curl is not loaded."; |
71 | 71 | } |
72 | -if(function_exists('apache_get_modules') ){ |
|
73 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
72 | +if (function_exists('apache_get_modules')) { |
|
73 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
74 | 74 | $error[] = "mod_rewrite is not available."; |
75 | 75 | } |
76 | 76 | /* |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
87 | 87 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
88 | 88 | if (function_exists('get_headers')) { |
89 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
90 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
89 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
90 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
91 | 91 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
92 | 92 | } |
93 | 93 | } |
@@ -452,13 +452,13 @@ discard block |
||
452 | 452 | ?> |
453 | 453 | <tr> |
454 | 454 | <?php |
455 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
455 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
456 | 456 | ?> |
457 | 457 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
458 | 458 | <td><input type="number" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
459 | 459 | <?php |
460 | 460 | } else { |
461 | - $hostport = explode(':',$source['host']); |
|
461 | + $hostport = explode(':', $source['host']); |
|
462 | 462 | if (isset($hostport[1])) { |
463 | 463 | $host = $hostport[0]; |
464 | 464 | $port = $hostport[1]; |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | <select name="timezone[]" id="timezone"> |
504 | 504 | <?php |
505 | 505 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
506 | - foreach($timezonelist as $timezone){ |
|
506 | + foreach ($timezonelist as $timezone) { |
|
507 | 507 | if (isset($source['timezone']) && $source['timezone'] == $timezone) { |
508 | 508 | print '<option selected>'.$timezone.'</option>'; |
509 | 509 | } elseif (!isset($source['timezone']) && $timezone == 'UTC') { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | <select name="timezone[]" id="timezone"> |
554 | 554 | <?php |
555 | 555 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
556 | - foreach($timezonelist as $timezone){ |
|
556 | + foreach ($timezonelist as $timezone) { |
|
557 | 557 | if ($timezone == 'UTC') { |
558 | 558 | print '<option selected>'.$timezone.'</option>'; |
559 | 559 | } else print '<option>'.$timezone.'</option>'; |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | <br /> |
848 | 848 | <p> |
849 | 849 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
850 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
850 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
851 | 851 | </p> |
852 | 852 | <br /> |
853 | 853 | <p> |
@@ -903,14 +903,14 @@ discard block |
||
903 | 903 | $error = ''; |
904 | 904 | |
905 | 905 | if (isset($_POST['dbtype'])) { |
906 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
907 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
908 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
909 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
910 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
911 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
912 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
913 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
906 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
907 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
908 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
909 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
910 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
911 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
912 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
913 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
914 | 914 | |
915 | 915 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
916 | 916 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -930,49 +930,49 @@ discard block |
||
930 | 930 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
931 | 931 | */ |
932 | 932 | |
933 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
933 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
934 | 934 | |
935 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
936 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
937 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
938 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
939 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
935 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
936 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
937 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
938 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
939 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
940 | 940 | |
941 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
942 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
943 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
944 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
945 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
946 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING); |
|
947 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
948 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
949 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
950 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
941 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
942 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
943 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
944 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
945 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
946 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING); |
|
947 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
948 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
949 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
950 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
951 | 951 | |
952 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
953 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
954 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
955 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
956 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
957 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
952 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
953 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
954 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
955 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
956 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
957 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
958 | 958 | |
959 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
960 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
959 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
960 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
961 | 961 | |
962 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
963 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
964 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
962 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
963 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
964 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
965 | 965 | |
966 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
966 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
967 | 967 | if ($acars == 'acars') { |
968 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
968 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
969 | 969 | } else { |
970 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
970 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
971 | 971 | } |
972 | 972 | |
973 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
974 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
975 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
973 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
974 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
975 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
976 | 976 | |
977 | 977 | $source_name = $_POST['source_name']; |
978 | 978 | $source_latitude = $_POST['source_latitude']; |
@@ -986,8 +986,8 @@ discard block |
||
986 | 986 | |
987 | 987 | $sources = array(); |
988 | 988 | foreach ($source_name as $keys => $name) { |
989 | - 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]); |
|
990 | - 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]); |
|
989 | + 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]); |
|
990 | + 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]); |
|
991 | 991 | } |
992 | 992 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
993 | 993 | |
@@ -1000,24 +1000,24 @@ discard block |
||
1000 | 1000 | $sbsurl = $_POST['sbsurl']; |
1001 | 1001 | */ |
1002 | 1002 | |
1003 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
1004 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING); |
|
1005 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
1006 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
1007 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
1008 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
1009 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
1010 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
1003 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
1004 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING); |
|
1005 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
1006 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
1007 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
1008 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
1009 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
1010 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
1011 | 1011 | |
1012 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
1013 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1014 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1015 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
1016 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1017 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1018 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
1019 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1020 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1012 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
1013 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
1014 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
1015 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
1016 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
1017 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
1018 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
1019 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
1020 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
1021 | 1021 | |
1022 | 1022 | /* |
1023 | 1023 | $globalSBS1Hosts = array(); |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | } |
1034 | 1034 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
1035 | 1035 | */ |
1036 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
1036 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
1037 | 1037 | $host = $_POST['host']; |
1038 | 1038 | $port = $_POST['port']; |
1039 | 1039 | $name = $_POST['name']; |
@@ -1050,100 +1050,100 @@ discard block |
||
1050 | 1050 | else $cov = 'FALSE'; |
1051 | 1051 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
1052 | 1052 | else $arch = 'FALSE'; |
1053 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key]); |
|
1053 | + if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezone[$key]); |
|
1054 | 1054 | if ($format[$key] == 'airwhere') $forcepilots = true; |
1055 | 1055 | } |
1056 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
1056 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
1057 | 1057 | |
1058 | 1058 | /* |
1059 | 1059 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
1060 | 1060 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
1061 | 1061 | */ |
1062 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
1063 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
1064 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
1062 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
1063 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
1064 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
1065 | 1065 | |
1066 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
1067 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
1066 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
1067 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
1068 | 1068 | |
1069 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING); |
|
1070 | - $settings = array_merge($settings,array('globalCustomCSS' => $customcss)); |
|
1069 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING); |
|
1070 | + $settings = array_merge($settings, array('globalCustomCSS' => $customcss)); |
|
1071 | 1071 | |
1072 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
1073 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
1074 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
1075 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
1072 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
1073 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
1074 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
1075 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
1076 | 1076 | |
1077 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
1078 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
1079 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
1077 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
1078 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
1079 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
1080 | 1080 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1081 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
1082 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1081 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
1082 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
1083 | 1083 | |
1084 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
1085 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
1086 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
1087 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
1088 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
1089 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
1090 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
1091 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
1084 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
1085 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
1086 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
1087 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
1088 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
1089 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
1090 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
1091 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
1092 | 1092 | |
1093 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
1094 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
1093 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
1094 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
1095 | 1095 | |
1096 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
1097 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
1096 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
1097 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
1098 | 1098 | |
1099 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
1099 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
1100 | 1100 | if ($archiveyear == "archiveyear") { |
1101 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
1101 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
1102 | 1102 | } else { |
1103 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
1103 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
1104 | 1104 | } |
1105 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1106 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1107 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1108 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1105 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1106 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1107 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1108 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1109 | 1109 | |
1110 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
1111 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
1112 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
1113 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
1110 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
1111 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
1112 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
1113 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
1114 | 1114 | |
1115 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
1116 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
1117 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
1115 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
1116 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
1117 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
1118 | 1118 | |
1119 | 1119 | // Create in settings.php keys not yet configurable if not already here |
1120 | 1120 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1121 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1121 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
1122 | 1122 | |
1123 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
1123 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
1124 | 1124 | if ($resetyearstats == 'resetyearstats') { |
1125 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
1125 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
1126 | 1126 | } else { |
1127 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
1127 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
1130 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
1131 | 1131 | if ($archive == 'archive') { |
1132 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
1132 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
1133 | 1133 | } else { |
1134 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
1134 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
1135 | 1135 | } |
1136 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
1136 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1137 | 1137 | if ($daemon == 'daemon') { |
1138 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1138 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1139 | 1139 | } else { |
1140 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1140 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1141 | 1141 | } |
1142 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1142 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1143 | 1143 | if ($schedules == 'schedules') { |
1144 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1144 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1145 | 1145 | } else { |
1146 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1146 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1147 | 1147 | } |
1148 | 1148 | |
1149 | 1149 | /* |
@@ -1154,218 +1154,218 @@ discard block |
||
1154 | 1154 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1155 | 1155 | } |
1156 | 1156 | */ |
1157 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1158 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1159 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1160 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1161 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1157 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1158 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1159 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1160 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1161 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1162 | 1162 | $va = false; |
1163 | 1163 | if ($globalivao == 'ivao') { |
1164 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1164 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1165 | 1165 | $va = true; |
1166 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1166 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1167 | 1167 | if ($globalvatsim == 'vatsim') { |
1168 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1168 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1169 | 1169 | $va = true; |
1170 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1170 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1171 | 1171 | if ($globalphpvms == 'phpvms') { |
1172 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1172 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1173 | 1173 | $va = true; |
1174 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1174 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1175 | 1175 | if ($globalvam == 'vam') { |
1176 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
1176 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
1177 | 1177 | $va = true; |
1178 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1178 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
1179 | 1179 | if ($va) { |
1180 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1181 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1180 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1181 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1182 | 1182 | if ($globalva == 'va' || $va) { |
1183 | - $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
|
1184 | - $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1183 | + $settings = array_merge($settings, array('globalVA' => 'TRUE')); |
|
1184 | + $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1185 | 1185 | } else { |
1186 | - $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
|
1187 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1188 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1186 | + $settings = array_merge($settings, array('globalVA' => 'FALSE')); |
|
1187 | + if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1188 | + else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE')); |
|
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | |
1192 | 1192 | |
1193 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1193 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1194 | 1194 | if ($notam == 'notam') { |
1195 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1195 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1196 | 1196 | } else { |
1197 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1197 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1198 | 1198 | } |
1199 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1199 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1200 | 1200 | if ($owner == 'owner') { |
1201 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1201 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1202 | 1202 | } else { |
1203 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1203 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1204 | 1204 | } |
1205 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
1205 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
1206 | 1206 | if ($map3d == 'map3d') { |
1207 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
1207 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
1208 | 1208 | } else { |
1209 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
1209 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
1210 | 1210 | } |
1211 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
1211 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
1212 | 1212 | if ($crash == 'crash') { |
1213 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
1213 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
1214 | 1214 | } else { |
1215 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
1215 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
1216 | 1216 | } |
1217 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
1217 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
1218 | 1218 | if ($mapsatellites == 'mapsatellites') { |
1219 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
1219 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
1220 | 1220 | } else { |
1221 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
1221 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
1222 | 1222 | } |
1223 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
1223 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
1224 | 1224 | if ($map3ddefault == 'map3ddefault') { |
1225 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
1225 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
1226 | 1226 | } else { |
1227 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
1227 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
1228 | 1228 | } |
1229 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1229 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1230 | 1230 | if ($translate == 'translate') { |
1231 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1231 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1232 | 1232 | } else { |
1233 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1233 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1234 | 1234 | } |
1235 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
1235 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
1236 | 1236 | if ($realairlines == 'realairlines') { |
1237 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
1237 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
1238 | 1238 | } else { |
1239 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
1239 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
1240 | 1240 | } |
1241 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1241 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1242 | 1242 | if ($estimation == 'estimation') { |
1243 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1243 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1244 | 1244 | } else { |
1245 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1245 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1246 | 1246 | } |
1247 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1247 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1248 | 1248 | if ($metar == 'metar') { |
1249 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1249 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1250 | 1250 | } else { |
1251 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1251 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1252 | 1252 | } |
1253 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1253 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1254 | 1254 | if ($metarcycle == 'metarcycle') { |
1255 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1255 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1256 | 1256 | } else { |
1257 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1257 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1258 | 1258 | } |
1259 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1259 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1260 | 1260 | if ($fork == 'fork') { |
1261 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1261 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1262 | 1262 | } else { |
1263 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1263 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1264 | 1264 | } |
1265 | 1265 | |
1266 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1266 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1267 | 1267 | if ($colormap == 'colormap') { |
1268 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1268 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1269 | 1269 | } else { |
1270 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1270 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | if (isset($_POST['aircrafticoncolor'])) { |
1274 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1275 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1274 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1275 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1276 | 1276 | } |
1277 | 1277 | |
1278 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1279 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1278 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1279 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1280 | 1280 | |
1281 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1282 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1283 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1284 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1285 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1286 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1281 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1282 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1283 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1284 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1285 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1286 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1287 | 1287 | |
1288 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1288 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1289 | 1289 | if ($mappopup == 'mappopup') { |
1290 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1290 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1291 | 1291 | } else { |
1292 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1292 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1293 | 1293 | } |
1294 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1294 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1295 | 1295 | if ($airportpopup == 'airportpopup') { |
1296 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1296 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1297 | 1297 | } else { |
1298 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1298 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1299 | 1299 | } |
1300 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1300 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1301 | 1301 | if ($maphistory == 'maphistory') { |
1302 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1302 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1303 | 1303 | } else { |
1304 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1304 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1305 | 1305 | } |
1306 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING); |
|
1306 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING); |
|
1307 | 1307 | if ($maptooltip == 'maptooltip') { |
1308 | - $settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); |
|
1308 | + $settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); |
|
1309 | 1309 | } else { |
1310 | - $settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); |
|
1310 | + $settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); |
|
1311 | 1311 | } |
1312 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1312 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1313 | 1313 | if ($flightroute == 'flightroute') { |
1314 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1314 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1315 | 1315 | } else { |
1316 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1316 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1317 | 1317 | } |
1318 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING); |
|
1318 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING); |
|
1319 | 1319 | if ($flightremainingroute == 'flightremainingroute') { |
1320 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); |
|
1320 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); |
|
1321 | 1321 | } else { |
1322 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); |
|
1322 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); |
|
1323 | 1323 | } |
1324 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
1324 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
1325 | 1325 | if ($allflights == 'allflights') { |
1326 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
1326 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
1327 | 1327 | } else { |
1328 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
1328 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
1329 | 1329 | } |
1330 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
1330 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
1331 | 1331 | if ($bbox == 'bbox') { |
1332 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
1332 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
1333 | 1333 | } else { |
1334 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
1334 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
1335 | 1335 | } |
1336 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING); |
|
1336 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING); |
|
1337 | 1337 | if ($groundaltitude == 'groundaltitude') { |
1338 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); |
|
1338 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); |
|
1339 | 1339 | } else { |
1340 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); |
|
1340 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); |
|
1341 | 1341 | } |
1342 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
1342 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
1343 | 1343 | if ($waypoints == 'waypoints') { |
1344 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
1344 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
1345 | 1345 | } else { |
1346 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
1346 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
1347 | 1347 | } |
1348 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING); |
|
1348 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING); |
|
1349 | 1349 | if ($noairlines == 'noairlines') { |
1350 | - $settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); |
|
1350 | + $settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); |
|
1351 | 1351 | } else { |
1352 | - $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
|
1352 | + $settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); |
|
1353 | 1353 | } |
1354 | 1354 | |
1355 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1355 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1356 | 1356 | |
1357 | 1357 | // Set some defaults values... |
1358 | 1358 | if (!isset($globalAircraftImageSources)) { |
1359 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1360 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1359 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1360 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1361 | 1361 | } |
1362 | 1362 | |
1363 | 1363 | if (!isset($globalSchedulesSources)) { |
1364 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1365 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1364 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1365 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1366 | 1366 | } |
1367 | 1367 | |
1368 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1368 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1369 | 1369 | |
1370 | 1370 | if ($error == '') settings::modify_settings($settings); |
1371 | 1371 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -131,45 +131,72 @@ discard block |
||
131 | 131 | </div> |
132 | 132 | <p> |
133 | 133 | <label for="dbhost">Database hostname</label> |
134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
135 | + print $globalDBhost; |
|
136 | +} |
|
137 | +?>" /> |
|
135 | 138 | </p> |
136 | 139 | <p> |
137 | 140 | <label for="dbport">Database port</label> |
138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
142 | + print $globalDBport; |
|
143 | +} |
|
144 | +?>" /> |
|
139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
140 | 146 | </p> |
141 | 147 | <p> |
142 | 148 | <label for="dbname">Database name</label> |
143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
150 | + print $globalDBname; |
|
151 | +} |
|
152 | +?>" /> |
|
144 | 153 | </p> |
145 | 154 | <p> |
146 | 155 | <label for="dbuser">Database user</label> |
147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
157 | + print $globalDBuser; |
|
158 | +} |
|
159 | +?>" /> |
|
148 | 160 | </p> |
149 | 161 | <p> |
150 | 162 | <label for="dbuserpass">Database user password</label> |
151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
164 | + print $globalDBpass; |
|
165 | +} |
|
166 | +?>" /> |
|
152 | 167 | </p> |
153 | 168 | </fieldset> |
154 | 169 | <fieldset id="site"> |
155 | 170 | <legend>Site configuration</legend> |
156 | 171 | <p> |
157 | 172 | <label for="sitename">Site name</label> |
158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
174 | + print $globalName; |
|
175 | +} |
|
176 | +?>" /> |
|
159 | 177 | </p> |
160 | 178 | <p> |
161 | 179 | <label for="siteurl">Site directory</label> |
162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
181 | + print $globalURL; |
|
182 | +} |
|
183 | +?>" /> |
|
163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
164 | 185 | </p> |
165 | 186 | <p> |
166 | 187 | <label for="timezone">Timezone</label> |
167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
189 | + print $globalTimezone; |
|
190 | +} |
|
191 | +?>" /> |
|
168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
169 | 193 | </p> |
170 | 194 | <p> |
171 | 195 | <label for="language">Language</label> |
172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
197 | + print $globalLanguage; |
|
198 | +} |
|
199 | +?>" /> |
|
173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
174 | 201 | </p> |
175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
190 | 217 | <div id="mapbox_data"> |
191 | 218 | <p> |
192 | 219 | <label for="mapboxid">Mapbox id</label> |
193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
221 | + print $globalMapboxId; |
|
222 | +} |
|
223 | +?>" /> |
|
194 | 224 | </p> |
195 | 225 | <p> |
196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
228 | + print $globalMapboxToken; |
|
229 | +} |
|
230 | +?>" /> |
|
198 | 231 | </p> |
199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
202 | 235 | <div id="google_data"> |
203 | 236 | <p> |
204 | 237 | <label for="googlekey">Google API key</label> |
205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
239 | + print $globalGoogleAPIKey; |
|
240 | +} |
|
241 | +?>" /> |
|
206 | 242 | <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> |
207 | 243 | </p> |
208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
210 | 246 | <div id="bing_data"> |
211 | 247 | <p> |
212 | 248 | <label for="bingkey">Bing Map key</label> |
213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
250 | + print $globalBingMapKey; |
|
251 | +} |
|
252 | +?>" /> |
|
214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
215 | 254 | </p> |
216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
218 | 257 | <div id="mapquest_data"> |
219 | 258 | <p> |
220 | 259 | <label for="mapquestkey">MapQuest key</label> |
221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
261 | + print $globalMapQuestKey; |
|
262 | +} |
|
263 | +?>" /> |
|
222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
223 | 265 | </p> |
224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
226 | 268 | <div id="here_data"> |
227 | 269 | <p> |
228 | 270 | <label for="hereappid">Here App_Id</label> |
229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
272 | + print $globalHereappId; |
|
273 | +} |
|
274 | +?>" /> |
|
230 | 275 | </p> |
231 | 276 | <p> |
232 | 277 | <label for="hereappcode">Here App_Code</label> |
233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
279 | + print $globalHereappCode; |
|
280 | +} |
|
281 | +?>" /> |
|
234 | 282 | </p> |
235 | 283 | <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> |
236 | 284 | </div> |
@@ -238,7 +286,10 @@ discard block |
||
238 | 286 | <div id="openweathermap_data"> |
239 | 287 | <p> |
240 | 288 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
241 | - <input type="text" name="oepnweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
289 | + <input type="text" name="oepnweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
290 | + print $globalOpenWeatherMapKey; |
|
291 | +} |
|
292 | +?>" /> |
|
242 | 293 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
243 | 294 | </p> |
244 | 295 | </div> |
@@ -248,42 +299,86 @@ discard block |
||
248 | 299 | <legend>Coverage area</legend> |
249 | 300 | <p> |
250 | 301 | <label for="latitudemax">The maximum latitude (north)</label> |
251 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
302 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
303 | + print $globalLatitudeMax; |
|
304 | +} |
|
305 | +?>" /> |
|
252 | 306 | </p> |
253 | 307 | <p> |
254 | 308 | <label for="latitudemin">The minimum latitude (south)</label> |
255 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
309 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
310 | + print $globalLatitudeMin; |
|
311 | +} |
|
312 | +?>" /> |
|
256 | 313 | </p> |
257 | 314 | <p> |
258 | 315 | <label for="longitudemax">The maximum longitude (west)</label> |
259 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
316 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
317 | + print $globalLongitudeMax; |
|
318 | +} |
|
319 | +?>" /> |
|
260 | 320 | </p> |
261 | 321 | <p> |
262 | 322 | <label for="longitudemin">The minimum longitude (east)</label> |
263 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
323 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
324 | + print $globalLongitudeMin; |
|
325 | +} |
|
326 | +?>" /> |
|
264 | 327 | </p> |
265 | 328 | <p> |
266 | 329 | <label for="latitudecenter">The latitude center</label> |
267 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
330 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
331 | + print $globalCenterLatitude; |
|
332 | +} |
|
333 | +?>" /> |
|
268 | 334 | </p> |
269 | 335 | <p> |
270 | 336 | <label for="longitudecenter">The longitude center</label> |
271 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
337 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
338 | + print $globalCenterLongitude; |
|
339 | +} |
|
340 | +?>" /> |
|
272 | 341 | </p> |
273 | 342 | <p> |
274 | 343 | <label for="livezoom">Default Zoom on live map</label> |
275 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
344 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
345 | + print $globalLiveZoom; |
|
346 | +} else { |
|
347 | + print '9'; |
|
348 | +} |
|
349 | +?>" /> |
|
276 | 350 | </p> |
277 | 351 | <p> |
278 | 352 | <label for="squawk_country">Country for squawk usage</label> |
279 | 353 | <select name="squawk_country" id="squawk_country"> |
280 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
281 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
282 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
283 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
284 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
285 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
286 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
354 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
355 | + print ' selected '; |
|
356 | +} |
|
357 | +?>>UK</option> |
|
358 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
359 | + print ' selected '; |
|
360 | +} |
|
361 | +?>>NZ</option> |
|
362 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
363 | + print ' selected '; |
|
364 | +} |
|
365 | +?>>US</option> |
|
366 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
367 | + print ' selected '; |
|
368 | +} |
|
369 | +?>>AU</option> |
|
370 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
371 | + print ' selected '; |
|
372 | +} |
|
373 | +?>>NL</option> |
|
374 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
375 | + print ' selected '; |
|
376 | +} |
|
377 | +?>>FR</option> |
|
378 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
379 | + print ' selected '; |
|
380 | +} |
|
381 | +?>>TR</option> |
|
287 | 382 | </select> |
288 | 383 | </p> |
289 | 384 | </fieldset> |
@@ -292,15 +387,24 @@ discard block |
||
292 | 387 | <p><i>Only put in DB flights that are inside a circle</i></p> |
293 | 388 | <p> |
294 | 389 | <label for="latitude">Center latitude</label> |
295 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
390 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
391 | + echo $globalDistanceIgnore['latitude']; |
|
392 | +} |
|
393 | +?>" /> |
|
296 | 394 | </p> |
297 | 395 | <p> |
298 | 396 | <label for="longitude">Center longitude</label> |
299 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
397 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
398 | + echo $globalDistanceIgnore['longitude']; |
|
399 | +} |
|
400 | +?>" /> |
|
300 | 401 | </p> |
301 | 402 | <p> |
302 | 403 | <label for="Distance">Distance (in km)</label> |
303 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
404 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
405 | + echo $globalDistanceIgnore['distance']; |
|
406 | +} |
|
407 | +?>" /> |
|
304 | 408 | </p> |
305 | 409 | </fieldset> |
306 | 410 | <fieldset id="sourceloc"> |
@@ -409,11 +513,17 @@ discard block |
||
409 | 513 | <div id="flightaware_data"> |
410 | 514 | <p> |
411 | 515 | <label for="flightawareusername">FlightAware username</label> |
412 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
516 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
517 | + print $globalFlightAwareUsername; |
|
518 | +} |
|
519 | +?>" /> |
|
413 | 520 | </p> |
414 | 521 | <p> |
415 | 522 | <label for="flightawarepassword">FlightAware password/API key</label> |
416 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
523 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
524 | + print $globalFlightAwarePassword; |
|
525 | +} |
|
526 | +?>" /> |
|
417 | 527 | </p> |
418 | 528 | </div> |
419 | 529 | --> |
@@ -455,7 +565,10 @@ discard block |
||
455 | 565 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
456 | 566 | ?> |
457 | 567 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
458 | - <td><input type="number" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
568 | + <td><input type="number" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) { |
|
569 | + print $source['port']; |
|
570 | +} |
|
571 | +?>" /></td> |
|
459 | 572 | <?php |
460 | 573 | } else { |
461 | 574 | $hostport = explode(':',$source['host']); |
@@ -474,31 +587,94 @@ discard block |
||
474 | 587 | ?> |
475 | 588 | <td> |
476 | 589 | <select name="format[]" id="format"> |
477 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
478 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
479 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
480 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
481 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
482 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
483 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
484 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
485 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
486 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
487 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
488 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
489 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
490 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
491 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
492 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
493 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
494 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
590 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
591 | + print 'selected'; |
|
592 | +} |
|
593 | +?>>Auto</option> |
|
594 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
595 | + print 'selected'; |
|
596 | +} |
|
597 | +?>>SBS</option> |
|
598 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
599 | + print 'selected'; |
|
600 | +} |
|
601 | +?>>TSV</option> |
|
602 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
603 | + print 'selected'; |
|
604 | +} |
|
605 | +?>>Raw</option> |
|
606 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
607 | + print 'selected'; |
|
608 | +} |
|
609 | +?>>APRS</option> |
|
610 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
611 | + print 'selected'; |
|
612 | +} |
|
613 | +?>>Radarcape deltadb.txt</option> |
|
614 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
615 | + print 'selected'; |
|
616 | +} |
|
617 | +?>>Vatsim</option> |
|
618 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
619 | + print 'selected'; |
|
620 | +} |
|
621 | +?>>Virtual Radar Server AircraftList.json</option> |
|
622 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
623 | + print 'selected'; |
|
624 | +} |
|
625 | +?>>Virtual Radar Server TCP</option> |
|
626 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
627 | + print 'selected'; |
|
628 | +} |
|
629 | +?>>phpVMS</option> |
|
630 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
631 | + print 'selected'; |
|
632 | +} |
|
633 | +?>>Virtual Airlines Manager</option> |
|
634 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
635 | + print 'selected'; |
|
636 | +} |
|
637 | +?>>IVAO</option> |
|
638 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
639 | + print 'selected'; |
|
640 | +} |
|
641 | +?>>FlightGear Multiplayer</option> |
|
642 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
643 | + print 'selected'; |
|
644 | +} |
|
645 | +?>>FlightGear Singleplayer</option> |
|
646 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
647 | + print 'selected'; |
|
648 | +} |
|
649 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
650 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
651 | + print 'selected'; |
|
652 | +} |
|
653 | +?>>ACARS SBS-3 over TCP</option> |
|
654 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
655 | + print 'selected'; |
|
656 | +} |
|
657 | +?>>NMEA AIS over TCP</option> |
|
658 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
659 | + print 'selected'; |
|
660 | +} |
|
661 | +?>>AirWhere website</option> |
|
495 | 662 | </select> |
496 | 663 | </td> |
497 | 664 | <td> |
498 | - <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
665 | + <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
666 | + print $source['name']; |
|
667 | +} |
|
668 | +?>" /> |
|
499 | 669 | </td> |
500 | - <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> |
|
501 | - <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> |
|
670 | + <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']) { |
|
671 | + print 'checked'; |
|
672 | +} |
|
673 | +?> /></td> |
|
674 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
675 | + print 'checked'; |
|
676 | +} |
|
677 | +?> /></td> |
|
502 | 678 | <td> |
503 | 679 | <select name="timezone[]" id="timezone"> |
504 | 680 | <?php |
@@ -508,7 +684,9 @@ discard block |
||
508 | 684 | print '<option selected>'.$timezone.'</option>'; |
509 | 685 | } elseif (!isset($source['timezone']) && $timezone == 'UTC') { |
510 | 686 | print '<option selected>'.$timezone.'</option>'; |
511 | - } else print '<option>'.$timezone.'</option>'; |
|
687 | + } else { |
|
688 | + print '<option>'.$timezone.'</option>'; |
|
689 | + } |
|
512 | 690 | } |
513 | 691 | ?> |
514 | 692 | </select> |
@@ -556,7 +734,9 @@ discard block |
||
556 | 734 | foreach($timezonelist as $timezone){ |
557 | 735 | if ($timezone == 'UTC') { |
558 | 736 | print '<option selected>'.$timezone.'</option>'; |
559 | - } else print '<option>'.$timezone.'</option>'; |
|
737 | + } else { |
|
738 | + print '<option>'.$timezone.'</option>'; |
|
739 | + } |
|
560 | 740 | } |
561 | 741 | ?> |
562 | 742 | </select> |
@@ -576,11 +756,17 @@ discard block |
||
576 | 756 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
577 | 757 | <p> |
578 | 758 | <label for="acarshost">ACARS UDP host</label> |
579 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
759 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
760 | + print $globalACARSHost; |
|
761 | +} |
|
762 | +?>" /> |
|
580 | 763 | </p> |
581 | 764 | <p> |
582 | 765 | <label for="acarsport">ACARS UDP port</label> |
583 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
766 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
767 | + print $globalACARSPort; |
|
768 | +} |
|
769 | +?>" /> |
|
584 | 770 | </p> |
585 | 771 | </fieldset> |
586 | 772 | </div> |
@@ -660,13 +846,19 @@ discard block |
||
660 | 846 | <div id="schedules_options"> |
661 | 847 | <p> |
662 | 848 | <label for="britishairways">British Airways API Key</label> |
663 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
849 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
850 | + print $globalBritishAirwaysKey; |
|
851 | +} |
|
852 | +?>" /> |
|
664 | 853 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
665 | 854 | </p> |
666 | 855 | <!-- |
667 | 856 | <p> |
668 | 857 | <label for="transavia">Transavia Test API Consumer Key</label> |
669 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
858 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
859 | + print $globalTransaviaKey; |
|
860 | +} |
|
861 | +?>" /> |
|
670 | 862 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
671 | 863 | </p> |
672 | 864 | --> |
@@ -675,10 +867,16 @@ discard block |
||
675 | 867 | <b>Lufthansa API Key</b> |
676 | 868 | <p> |
677 | 869 | <label for="lufthansakey">Key</label> |
678 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
870 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
871 | + print $globalLufthansaKey['key']; |
|
872 | +} |
|
873 | +?>" /> |
|
679 | 874 | </p><p> |
680 | 875 | <label for="lufthansasecret">Secret</label> |
681 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
876 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
877 | + print $globalLufthansaKey['secret']; |
|
878 | +} |
|
879 | +?>" /> |
|
682 | 880 | </p> |
683 | 881 | </div> |
684 | 882 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -698,7 +896,10 @@ discard block |
||
698 | 896 | </p> |
699 | 897 | <p> |
700 | 898 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
701 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
899 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
900 | + print $globalNOTAMSource; |
|
901 | +} |
|
902 | +?>" /> |
|
702 | 903 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
703 | 904 | </p> |
704 | 905 | <br /> |
@@ -714,14 +915,20 @@ discard block |
||
714 | 915 | <div id="metarsrc"> |
715 | 916 | <p> |
716 | 917 | <label for="metarsource">URL of your METAR source</label> |
717 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
918 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
919 | + print $globalMETARurl; |
|
920 | +} |
|
921 | +?>" /> |
|
718 | 922 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
719 | 923 | </p> |
720 | 924 | </div> |
721 | 925 | <br /> |
722 | 926 | <p> |
723 | 927 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
724 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
928 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
929 | + print $globalBitlyAccessToken; |
|
930 | +} |
|
931 | +?>" /> |
|
725 | 932 | </p> |
726 | 933 | <br /> |
727 | 934 | <p> |
@@ -741,7 +948,12 @@ discard block |
||
741 | 948 | </p> |
742 | 949 | <p> |
743 | 950 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
744 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
951 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
952 | + print $globalArchiveMonths; |
|
953 | +} else { |
|
954 | + echo '0'; |
|
955 | +} |
|
956 | +?>" /> |
|
745 | 957 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
746 | 958 | </p> |
747 | 959 | <p> |
@@ -751,12 +963,22 @@ discard block |
||
751 | 963 | </p> |
752 | 964 | <p> |
753 | 965 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
754 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
966 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
967 | + print $globalArchiveKeepMonths; |
|
968 | +} else { |
|
969 | + echo '0'; |
|
970 | +} |
|
971 | +?>" /> |
|
755 | 972 | <p class="help-block">0 to disable</p> |
756 | 973 | </p> |
757 | 974 | <p> |
758 | 975 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
759 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
976 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
977 | + print $globalArchiveKeepTrackMonths; |
|
978 | +} else { |
|
979 | + echo '0'; |
|
980 | +} |
|
981 | +?>" /> |
|
760 | 982 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
761 | 983 | </p> |
762 | 984 | <br /> |
@@ -766,7 +988,12 @@ discard block |
||
766 | 988 | <p class="help-block">Uncheck if the script is running as cron job</p> |
767 | 989 | <div id="cronends"> |
768 | 990 | <label for="cronend">Run script for xx seconds</label> |
769 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
991 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
992 | + print $globalCronEnd; |
|
993 | +} else { |
|
994 | + print '0'; |
|
995 | +} |
|
996 | +?>" /> |
|
770 | 997 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
771 | 998 | </div> |
772 | 999 | </p> |
@@ -819,15 +1046,30 @@ discard block |
||
819 | 1046 | <br /> |
820 | 1047 | <p> |
821 | 1048 | <label for="refresh">Show flights detected since xxx seconds</label> |
822 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
1049 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
1050 | + echo $globalLiveInterval; |
|
1051 | +} else { |
|
1052 | + echo '200'; |
|
1053 | +} |
|
1054 | +?>" /> |
|
823 | 1055 | </p> |
824 | 1056 | <p> |
825 | 1057 | <label for="maprefresh">Live map refresh (in seconds)</label> |
826 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
1058 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
1059 | + echo $globalMapRefresh; |
|
1060 | +} else { |
|
1061 | + echo '30'; |
|
1062 | +} |
|
1063 | +?>" /> |
|
827 | 1064 | </p> |
828 | 1065 | <p> |
829 | 1066 | <label for="mapidle">Map idle timeout (in minutes)</label> |
830 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
1067 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
1068 | + echo $globalMapIdleTimeout; |
|
1069 | +} else { |
|
1070 | + echo '30'; |
|
1071 | +} |
|
1072 | +?>" /> |
|
831 | 1073 | <p class="help-block">0 to disable</p> |
832 | 1074 | </p> |
833 | 1075 | <p> |
@@ -842,12 +1084,20 @@ discard block |
||
842 | 1084 | <br /> |
843 | 1085 | <p> |
844 | 1086 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
845 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
1087 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
1088 | + echo $globalClosestMinDist; |
|
1089 | +} else { |
|
1090 | + echo '50'; |
|
1091 | +} |
|
1092 | +?>" /> |
|
846 | 1093 | </p> |
847 | 1094 | <br /> |
848 | 1095 | <p> |
849 | 1096 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
850 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1097 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1098 | + echo $globalAircraftSize; |
|
1099 | +} |
|
1100 | +?>" /> |
|
851 | 1101 | </p> |
852 | 1102 | <br /> |
853 | 1103 | <p> |
@@ -860,7 +1110,12 @@ discard block |
||
860 | 1110 | if (extension_loaded('gd') && function_exists('gd_info')) { |
861 | 1111 | ?> |
862 | 1112 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
863 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1113 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1114 | + echo $globalAircraftIconColor; |
|
1115 | +} else { |
|
1116 | + echo '1a3151'; |
|
1117 | +} |
|
1118 | +?>" /> |
|
864 | 1119 | <?php |
865 | 1120 | if (!is_writable('../cache')) { |
866 | 1121 | ?> |
@@ -878,14 +1133,27 @@ discard block |
||
878 | 1133 | <p> |
879 | 1134 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
880 | 1135 | <div class="range"> |
881 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
882 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1136 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1137 | + echo $globalAirportZoom; |
|
1138 | +} else { |
|
1139 | + echo '7'; |
|
1140 | +} |
|
1141 | +?>" /> |
|
1142 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1143 | + echo $globalAirportZoom; |
|
1144 | +} else { |
|
1145 | + echo '7'; |
|
1146 | +} |
|
1147 | +?></output> |
|
883 | 1148 | </div> |
884 | 1149 | </p> |
885 | 1150 | <br /> |
886 | 1151 | <p> |
887 | 1152 | <label for="customcss">Custom CSS web path</label> |
888 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
1153 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
1154 | + echo $globalCustomCSS; |
|
1155 | +} |
|
1156 | +?>" /> |
|
889 | 1157 | </p> |
890 | 1158 | </fieldset> |
891 | 1159 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -912,8 +1180,12 @@ discard block |
||
912 | 1180 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
913 | 1181 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
914 | 1182 | |
915 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
916 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1183 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1184 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1185 | + } |
|
1186 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1187 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1188 | + } |
|
917 | 1189 | |
918 | 1190 | $_SESSION['database_root'] = $dbroot; |
919 | 1191 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -981,15 +1253,23 @@ discard block |
||
981 | 1253 | $source_city = $_POST['source_city']; |
982 | 1254 | $source_country = $_POST['source_country']; |
983 | 1255 | $source_ref = $_POST['source_ref']; |
984 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
985 | - else $source_id = array(); |
|
1256 | + if (isset($source_id)) { |
|
1257 | + $source_id = $_POST['source_id']; |
|
1258 | + } else { |
|
1259 | + $source_id = array(); |
|
1260 | + } |
|
986 | 1261 | |
987 | 1262 | $sources = array(); |
988 | 1263 | foreach ($source_name as $keys => $name) { |
989 | - 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]); |
|
990 | - 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]); |
|
1264 | + if (isset($source_id[$keys])) { |
|
1265 | + $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]); |
|
1266 | + } else { |
|
1267 | + $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]); |
|
1268 | + } |
|
1269 | + } |
|
1270 | + if (count($sources) > 0) { |
|
1271 | + $_SESSION['sources'] = $sources; |
|
991 | 1272 | } |
992 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
993 | 1273 | |
994 | 1274 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
995 | 1275 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -1010,14 +1290,23 @@ discard block |
||
1010 | 1290 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
1011 | 1291 | |
1012 | 1292 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
1013 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1014 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1293 | + if ($globalaircraft == 'aircraft') { |
|
1294 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1295 | + } else { |
|
1296 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1297 | + } |
|
1015 | 1298 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
1016 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1017 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1299 | + if ($globaltracker == 'tracker') { |
|
1300 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1301 | + } else { |
|
1302 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1303 | + } |
|
1018 | 1304 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
1019 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1020 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1305 | + if ($globalmarine == 'marine') { |
|
1306 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1307 | + } else { |
|
1308 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1309 | + } |
|
1021 | 1310 | |
1022 | 1311 | /* |
1023 | 1312 | $globalSBS1Hosts = array(); |
@@ -1039,19 +1328,35 @@ discard block |
||
1039 | 1328 | $name = $_POST['name']; |
1040 | 1329 | $format = $_POST['format']; |
1041 | 1330 | $timezone = $_POST['timezone']; |
1042 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
1043 | - else $sourcestats = array(); |
|
1044 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
1045 | - else $noarchive = array(); |
|
1331 | + if (isset($_POST['sourcestats'])) { |
|
1332 | + $sourcestats = $_POST['sourcestats']; |
|
1333 | + } else { |
|
1334 | + $sourcestats = array(); |
|
1335 | + } |
|
1336 | + if (isset($_POST['noarchive'])) { |
|
1337 | + $noarchive = $_POST['noarchive']; |
|
1338 | + } else { |
|
1339 | + $noarchive = array(); |
|
1340 | + } |
|
1046 | 1341 | $gSources = array(); |
1047 | 1342 | $forcepilots = false; |
1048 | 1343 | foreach ($host as $key => $h) { |
1049 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
1050 | - else $cov = 'FALSE'; |
|
1051 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
1052 | - else $arch = 'FALSE'; |
|
1053 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key]); |
|
1054 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
1344 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1345 | + $cov = 'TRUE'; |
|
1346 | + } else { |
|
1347 | + $cov = 'FALSE'; |
|
1348 | + } |
|
1349 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
1350 | + $arch = 'TRUE'; |
|
1351 | + } else { |
|
1352 | + $arch = 'FALSE'; |
|
1353 | + } |
|
1354 | + if ($h != '') { |
|
1355 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezone[$key]); |
|
1356 | + } |
|
1357 | + if ($format[$key] == 'airwhere') { |
|
1358 | + $forcepilots = true; |
|
1359 | + } |
|
1055 | 1360 | } |
1056 | 1361 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
1057 | 1362 | |
@@ -1079,7 +1384,9 @@ discard block |
||
1079 | 1384 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
1080 | 1385 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1081 | 1386 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
1082 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1387 | + } else { |
|
1388 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1389 | + } |
|
1083 | 1390 | |
1084 | 1391 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
1085 | 1392 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1118,7 +1425,9 @@ discard block |
||
1118 | 1425 | |
1119 | 1426 | // Create in settings.php keys not yet configurable if not already here |
1120 | 1427 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1121 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1428 | + if (!isset($globalDebug)) { |
|
1429 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1430 | + } |
|
1122 | 1431 | |
1123 | 1432 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
1124 | 1433 | if ($resetyearstats == 'resetyearstats') { |
@@ -1155,37 +1464,56 @@ discard block |
||
1155 | 1464 | } |
1156 | 1465 | */ |
1157 | 1466 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1158 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1159 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1160 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1161 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1467 | + if ($globalsbs == 'sbs') { |
|
1468 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1469 | + } else { |
|
1470 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1471 | + } |
|
1472 | + if ($globalaprs == 'aprs') { |
|
1473 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1474 | + } else { |
|
1475 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1476 | + } |
|
1162 | 1477 | $va = false; |
1163 | 1478 | if ($globalivao == 'ivao') { |
1164 | 1479 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1165 | 1480 | $va = true; |
1166 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1481 | + } else { |
|
1482 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1483 | + } |
|
1167 | 1484 | if ($globalvatsim == 'vatsim') { |
1168 | 1485 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1169 | 1486 | $va = true; |
1170 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1487 | + } else { |
|
1488 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1489 | + } |
|
1171 | 1490 | if ($globalphpvms == 'phpvms') { |
1172 | 1491 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1173 | 1492 | $va = true; |
1174 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1493 | + } else { |
|
1494 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1495 | + } |
|
1175 | 1496 | if ($globalvam == 'vam') { |
1176 | 1497 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1177 | 1498 | $va = true; |
1178 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1499 | + } else { |
|
1500 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1501 | + } |
|
1179 | 1502 | if ($va) { |
1180 | 1503 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1181 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1504 | + } else { |
|
1505 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1506 | + } |
|
1182 | 1507 | if ($globalva == 'va' || $va) { |
1183 | 1508 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
1184 | 1509 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
1185 | 1510 | } else { |
1186 | 1511 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
1187 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1188 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1512 | + if ($forcepilots) { |
|
1513 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1514 | + } else { |
|
1515 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1516 | + } |
|
1189 | 1517 | } |
1190 | 1518 | |
1191 | 1519 | |
@@ -1352,7 +1680,9 @@ discard block |
||
1352 | 1680 | $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
1353 | 1681 | } |
1354 | 1682 | |
1355 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1683 | + if (!isset($globalTransaction)) { |
|
1684 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1685 | + } |
|
1356 | 1686 | |
1357 | 1687 | // Set some defaults values... |
1358 | 1688 | if (!isset($globalAircraftImageSources)) { |
@@ -1367,15 +1697,23 @@ discard block |
||
1367 | 1697 | |
1368 | 1698 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1369 | 1699 | |
1370 | - if ($error == '') settings::modify_settings($settings); |
|
1371 | - if ($error == '') settings::comment_settings($settings_comment); |
|
1700 | + if ($error == '') { |
|
1701 | + settings::modify_settings($settings); |
|
1702 | + } |
|
1703 | + if ($error == '') { |
|
1704 | + settings::comment_settings($settings_comment); |
|
1705 | + } |
|
1372 | 1706 | if ($error != '') { |
1373 | 1707 | print '<div class="info column">'.$error.'</div>'; |
1374 | 1708 | require('../footer.php'); |
1375 | 1709 | exit; |
1376 | 1710 | } else { |
1377 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1378 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
1711 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
1712 | + $_SESSION['waypoints'] = 1; |
|
1713 | + } |
|
1714 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
1715 | + $_SESSION['owner'] = 1; |
|
1716 | + } |
|
1379 | 1717 | if (isset($_POST['createdb'])) { |
1380 | 1718 | $_SESSION['install'] = 'database_create'; |
1381 | 1719 | } else { |
@@ -1416,10 +1754,18 @@ discard block |
||
1416 | 1754 | $popw = false; |
1417 | 1755 | foreach ($_SESSION['done'] as $done) { |
1418 | 1756 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1419 | - if ($done == 'Create database') $pop = true; |
|
1420 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1421 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1422 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1757 | + if ($done == 'Create database') { |
|
1758 | + $pop = true; |
|
1759 | + } |
|
1760 | + if ($_SESSION['install'] == 'database_create') { |
|
1761 | + $pop = true; |
|
1762 | + } |
|
1763 | + if ($_SESSION['install'] == 'database_import') { |
|
1764 | + $popi = true; |
|
1765 | + } |
|
1766 | + if ($_SESSION['install'] == 'waypoints') { |
|
1767 | + $popw = true; |
|
1768 | + } |
|
1423 | 1769 | } |
1424 | 1770 | if ($pop) { |
1425 | 1771 | sleep(5); |
@@ -1430,7 +1776,9 @@ discard block |
||
1430 | 1776 | } else if ($popw) { |
1431 | 1777 | sleep(5); |
1432 | 1778 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1433 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1779 | + } else { |
|
1780 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1781 | + } |
|
1434 | 1782 | print '</div></ul>'; |
1435 | 1783 | print '<div id="error"></div>'; |
1436 | 1784 | /* foreach ($_SESSION['done'] as $done) { |