From patchwork Tue Sep 22 18:25:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3481 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BwqW11Dwsz3wbW for ; Tue, 22 Sep 2020 18:25:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BwqVy0bktz11Y; Tue, 22 Sep 2020 18:25:46 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BwqVx6yf0z30WJ; Tue, 22 Sep 2020 18:25:45 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BwqVt5QWdz30Wf for ; Tue, 22 Sep 2020 18:25:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BwqVt36GXz11Q; Tue, 22 Sep 2020 18:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1600799142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JgIMwmzpjbVHB/1N2x+RneU0QeRJhyLO/u912vFltHk=; b=W41f3/OpI3irioaWR2d+Elg7yMvRiaOELdI0/0xuGQLDGQ6RdI/OkBsGhzUz8bexEi9td6 xqPsGyEyR32VVyYcnH5IR8kL02tTJtZTlVzdFkf1QN+6Eh1BzdkDX4i+BpLAf/+RbGfHHb 2Yf/K5Z4dthVwzzmEJ/xUh99AKYq7zs+uE0dlkf+TOaeRsROorR5BrwjsYZTGAgM+psHTm U2b9Zo/Jkwzwo61pT9sbe6u03SYla0bThNrtPOA15IqpxLaSbglyThwiRnERKzyUa0gQGO KejR2Wkih3sxIojumwzYefIty5gQUIKst6n21zNmPH6s0Mjfj8at86YTHK0FMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1600799142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JgIMwmzpjbVHB/1N2x+RneU0QeRJhyLO/u912vFltHk=; b=Jpxica5HqG3SJK5yTHEr0ivmKmZX1Pnk1lu03R1JotFj6HjZApdZxMfpz+Gsa1k0p70J3B WvMalqFfSYv6UhDw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 04/11] country.cgi: Use own location-functions. Date: Tue, 22 Sep 2020 20:25:02 +0200 Message-Id: <20200922182509.18643-4-stefan.schantl@ipfire.org> In-Reply-To: <20200922182509.18643-1-stefan.schantl@ipfire.org> References: <20200922182509.18643-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- html/cgi-bin/country.cgi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 +# 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) {