diff --git a/checkin_notes b/checkin_notes index 66bb5877f4..6d709981db 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11718,3 +11718,23 @@ David April 20 2004 file_names.C lib/ filesys.C + +David April 21 2004 + - Web: page_head() no longer checks for logged-in user. + Pages that care about that must do it separately, + and can pass the user into page_head() if they want. + - added is_valid_country() function + - don't get logged-in user for pages that don't show sensitive info + (results, workunit, host). + This also makes these pages cacheable. + + html/ + forum/ + edit.php + inc/ + countries.php + util.inc + user/ + result.php + results.php + show_host_detail.php diff --git a/html/forum/edit.php b/html/forum/edit.php index 923f354ace..652928ce73 100644 --- a/html/forum/edit.php +++ b/html/forum/edit.php @@ -30,7 +30,7 @@ if ($_POST['submit']) { } -page_head('Forum', $logged_in_user, NULL, 'forum.css'); +page_head('Forum', $logged_in_user); if (!empty($_GET['id'])) { $post = getPost($_GET['id']); diff --git a/html/inc/countries.inc b/html/inc/countries.inc index 4816699ef3..f3f48e8fab 100644 --- a/html/inc/countries.inc +++ b/html/inc/countries.inc @@ -233,27 +233,33 @@ $countries = array( "Yemen", "Zambia", "Zimbabwe" - ); +); function print_country_select($selected_country="None") { - global $countries; + global $countries; - //See if we can find the user's country and select it as default: - $gi = geoip_open("../inc/GeoIP.dat",GEOIP_STANDARD); - $geoip_country = geoip_country_name_by_addr($gi,$_SERVER["REMOTE_ADDR"]); - geoip_close($gi); + //See if we can find the user's country and select it as default: + $gi = geoip_open("../inc/GeoIP.dat",GEOIP_STANDARD); + $geoip_country = geoip_country_name_by_addr($gi,$_SERVER["REMOTE_ADDR"]); + geoip_close($gi); - if ($selected_country=="") $selected_country="None"; - if ($selected_country=="None" and $geoip_country!=""){ - $selected_country=$geoip_country; - } - echo "selected: $selected_country\n"; + if ($selected_country=="") $selected_country="None"; + if ($selected_country=="None" and $geoip_country!=""){ + $selected_country=$geoip_country; + } + echo "selected: $selected_country\n"; - $numCountries = count($countries); - for ($i=0; $i<$numCountries; $i++) { - $country = $countries[$i]; - $selected = ($selected_country == $country ? "selected":""); - echo "\n"; - } + $numCountries = count($countries); + for ($i=0; $i<$numCountries; $i++) { + $country = $countries[$i]; + $selected = ($selected_country == $country ? "selected":""); + echo "\n"; + } } + +function is_valid_country($country) { + global $countries; + return in_array($country, $countries); +} + ?> diff --git a/html/inc/util.inc b/html/inc/util.inc index 1486d82e31..b503bab19c 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -122,11 +122,7 @@ function write_fd($fd, $str) { } } -function page_head($title, $user=null, $fd=null, $get_user=true) { - if ($user == NULL && $get_user) { - $user = get_logged_in_user(false); - } - +function page_head($title, $user=null, $fd=null) { $styleSheet = URL_BASE . STYLESHEET; write_fd($fd, "