|
153 | 153 | } |
154 | 154 |
|
155 | 155 | // begin double-checking of some of the settings in config.inc.php // |
156 | | - |
| 156 | + |
| 157 | + if (!in_array(@$weather_units, array('c','f'))){ |
| 158 | + $weather_units = 'c'; |
| 159 | + } |
| 160 | + |
157 | 161 | if ($refresh != "none") { |
158 | 162 | $tmp_refresh = intval($refresh); |
159 | 163 | if (!empty($tmp_refresh)) { |
@@ -1042,6 +1046,17 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
1042 | 1046 | </td></tr>\n"; |
1043 | 1047 | $row_count++; |
1044 | 1048 | $row_color = ($row_count % 2) ? $color2 : $color1; |
| 1049 | + echo " <tr><td bgcolor='$row_color' class=table_rows width=10% align=left style='padding-left:4px;' valign=top>weather_units:</td>\n"; |
| 1050 | + echo " <td bgcolor='$row_color' class=table_rows width=10% align=left valign=top>"; |
| 1051 | + echo " <select name=\"weather_units\">\n"; |
| 1052 | + echo " <option value=\"c\" " . ($weather_units == "c" ? "selected" : "") . ">Celsius</option>\n"; |
| 1053 | + echo " <option value=\"f\" " . ($weather_units == "f" ? "selected" : "") . ">Fahrenheit</option>\n"; |
| 1054 | + echo " </select>"; |
| 1055 | + echo " <td bgcolor='$row_color' class=table_rows width=80% align=left style='padding-left:10px;' valign=top>Display weather in US or metric measurements. |
| 1056 | + Options are Fahrenheit or Celsius. Default is Celsius\". |
| 1057 | + </td></tr>\n"; |
| 1058 | + $row_count++; |
| 1059 | + $row_color = ($row_count % 2) ? $color2 : $color1; |
1045 | 1060 | echo " <tr><td bgcolor='$row_color' class=table_rows width=10% align=left style='padding-left:4px;' valign=top>metar:</td> |
1046 | 1061 | <td bgcolor='$row_color' class=table_rows width=10% align=left valign=top><input type=\"text\" size=\"10\" maxlength=\"4\" |
1047 | 1062 | name=\"metar\" value=\"$metar\" /></td> |
@@ -1260,6 +1275,8 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
1260 | 1275 | $post_group_name = $_POST['group_name']; |
1261 | 1276 | $post_display_current_users = $_POST['display_current_users']; |
1262 | 1277 | $post_display_weather = $_POST['display_weather']; |
| 1278 | + $post_weather_units = $_POST['weather_units']; |
| 1279 | + |
1263 | 1280 | $post_show_display_name = $_POST['show_display_name']; |
1264 | 1281 | $post_display_office_name = $_POST['display_office_name']; |
1265 | 1282 | $post_display_group_name = $_POST['display_group_name']; |
@@ -1364,6 +1381,7 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
1364 | 1381 | echo " </table>\n"; |
1365 | 1382 | $evil_post = "1"; |
1366 | 1383 | } elseif (($post_restrict_ips != '0') && ($post_restrict_ips != '1')) { |
| 1384 | + $evil_post = "1"; |
1367 | 1385 | echo " <table align=center class=table_border width=100% border=0 cellpadding=0 cellspacing=3>\n"; |
1368 | 1386 | echo " <tr><td width=20 align=center height=25 class=table_rows><img src='../images/icons/cancel.png' /></td> |
1369 | 1387 | <td class=table_rows_red height=25><b>restrict_ips</b> does not equal \"yes\" or \"no\".</td></tr>\n"; |
@@ -1502,6 +1520,12 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
1502 | 1520 | <td class=table_rows_red height=25><b>display_weather</b> does not equal \"yes\" or \"no\".</td></tr>\n"; |
1503 | 1521 | echo " </table>\n"; |
1504 | 1522 | $evil_post = "1"; |
| 1523 | + } elseif (!in_array($post_weather_units, array('c','f'))){ |
| 1524 | + echo " <table align=center class=table_border width=100% border=0 cellpadding=0 cellspacing=3>\n"; |
| 1525 | + echo " <tr><td width=20 align=center height=25 class=table_rows><img src='../images/icons/cancel.png' /></td> |
| 1526 | + <td class=table_rows_red height=25><b>weather_units</b> does not equal \"Celsius\" or \"Fahrenheit\".</td></tr>\n"; |
| 1527 | + echo " </table>\n"; |
| 1528 | + $evil_post = "1"; |
1505 | 1529 | } elseif ((isset($post_metar)) && (!preg_match('/' . "^([a-zA-Z]{4})+$" . '/i', $post_metar))) { |
1506 | 1530 | echo " <table align=center class=table_border width=100% border=0 cellpadding=0 cellspacing=3>\n"; |
1507 | 1531 | echo " <tr><td width=20 align=center height=25 class=table_rows><img src='../images/icons/cancel.png' /></td> |
@@ -2372,6 +2396,17 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
2372 | 2396 | echo " <td bgcolor='$row_color' class=table_rows width=80% align=left style='padding-left:10px;' valign=top>To display local weather |
2373 | 2397 | info on the left side of the application just below the submit button, set this to \"yes\". Default is \"<b>no</b>\". |
2374 | 2398 | </td></tr>\n"; |
| 2399 | + $row_count++; |
| 2400 | + $row_color = ($row_count % 2) ? $color2 : $color1; |
| 2401 | + echo " <tr><td bgcolor='$row_color' class=table_rows width=10% align=left style='padding-left:4px;' valign=top>weather_units:</td>\n"; |
| 2402 | + echo " <td bgcolor='$row_color' class=table_rows width=10% align=left valign=top>"; |
| 2403 | + echo " <select name=\"weather_units\">\n"; |
| 2404 | + echo " <option value=\"c\" " . ($weather_units == "c" ? "selected" : "") . ">Celsius</option>\n"; |
| 2405 | + echo " <option value=\"f\" " . ($weather_units == "f" ? "selected" : "") . ">Fahrenheit</option>\n"; |
| 2406 | + echo " </select>"; |
| 2407 | + echo " <td bgcolor='$row_color' class=table_rows width=80% align=left style='padding-left:10px;' valign=top>Display weather in US or metric measurements. |
| 2408 | + Options are Fahrenheit or Celsius. Default is Celsius\". |
| 2409 | + </td></tr>\n"; |
2375 | 2410 | $row_count++; |
2376 | 2411 | $row_color = ($row_count % 2) ? $color2 : $color1; |
2377 | 2412 | echo " <tr><td bgcolor='$row_color' class=table_rows width=10% align=left style='padding-left:4px;' valign=top>metar:</td> |
@@ -3105,6 +3140,10 @@ class=table_rows width=80% align=left valign=top><input type=\"radio\" name=\"tm |
3105 | 3140 |
|
3106 | 3141 | $display_weather = "' . $post_display_weather . '"; |
3107 | 3142 |
|
| 3143 | +/* Display weather in US or metric measurements. Options are "f" or "c". Default is "c" */ |
| 3144 | +
|
| 3145 | +$weather_units = "' . $post_weather_units . '"; |
| 3146 | +
|
3108 | 3147 |
|
3109 | 3148 | /* ICAO (International Civil Aviation Organization) for your local airport. This is the |
3110 | 3149 | unique four letter international ID for the airport. METAR reports are created at |
|
0 commit comments