tor.cgi: Remember selected exit node country.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Aug 2013 08:39:40 +0000 (10:39 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Aug 2013 08:39:40 +0000 (10:39 +0200)
html/cgi-bin/tor.cgi

index a1d0ae72fe3e16bacb9bbb53c5f0ebac0ddb4379..b920724de7aeab1e592b851fc51f088a1a9b1879 100755 (executable)
@@ -321,7 +321,13 @@ END
                foreach my $country_name (sort @country_names) {
                        my $country_code = Locale::Country::country2code($country_name);
                        $country_code = uc($country_code);
-                       print "<option value='$country_code'>$country_name ($country_code)</option>\n";
+                       print "<option value='$country_code'";
+
+                       if ($settings{'TOR_EXIT_COUNTRY'} eq $country_code) {
+                               print " selected";
+                       }
+
+                       print ">$country_name ($country_code)</option>\n";
                }
 
        print <<END;