[04/11] country.cgi: Use own location-functions.

Message ID 20200922182509.18643-4-stefan.schantl@ipfire.org
State Accepted
Commit cb204ea1002c8ca48bebadf161273b207b94adc6
Headers
Series [01/11] location-functions.pl: Refactor get_locations() function to use the Location module. |

Commit Message

Stefan Schantl Sept. 22, 2020, 6:25 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 html/cgi-bin/country.cgi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Patch

diff --git a/html/cgi-bin/country.cgi b/html/cgi-bin/country.cgi
index a1cf24347..b519d89b3 100644
--- a/html/cgi-bin/country.cgi
+++ b/html/cgi-bin/country.cgi
@@ -21,8 +21,6 @@ 
 
 use strict;
 
-use Locale::Codes::Country;
-
 my $col;
 my $lines = '1';
 my $lines2 = '';
@@ -32,6 +30,8 @@  require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+require "${General::swroot}/location-functions.pl";
+
 &Header::showhttpheaders();
 
 &Header::openpage($Lang::tr{'countries'}, 1, '');
@@ -52,8 +52,11 @@  print<<END;
 	</tr>
 END
 
+# Init libloc database connection.
+my $db_handle = &Location::Functions::init();
+
 # Get a list of all supported country codes.
-my @countries = Locale::Codes::Country::all_country_codes();
+my @countries = &Location::database_countries($db_handle);
 
 # Loop through whole country list.
 foreach my $country (@countries) {