From patchwork Thu Dec 1 17:22:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 6243 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 "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4NNNG03nkmz3xkh for ; Thu, 1 Dec 2022 17:23:36 +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 "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFp0kypz2tR; Thu, 1 Dec 2022 17:23:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NNNFm59sbz30Cm; Thu, 1 Dec 2022 17:23:24 +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 "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4NNNFk6sbdz2xNB for ; Thu, 1 Dec 2022 17:23:22 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (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 "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFk5WG3z2t1; Thu, 1 Dec 2022 17:23:22 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4NNNFj6WXGzTjnF; Thu, 1 Dec 2022 17:23:21 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 09/29] pppsetup.cgi: Add support for QMI profiles Date: Thu, 1 Dec 2022 17:22:58 +0000 Message-Id: <20221201172318.3166615-9-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201172318.3166615-1-michael.tremer@ipfire.org> References: <20221201172318.3166615-1-michael.tremer@ipfire.org> MIME-Version: 1.0 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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- html/cgi-bin/pppsetup.cgi | 37 +++++++++++++++++++++++++++++++++++-- langs/en/cgi-bin/en.pl | 3 +++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/pppsetup.cgi b/html/cgi-bin/pppsetup.cgi index d7e5799ec..696fa2c96 100644 --- a/html/cgi-bin/pppsetup.cgi +++ b/html/cgi-bin/pppsetup.cgi @@ -87,6 +87,16 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'}) $errormessage = $Lang::tr{'invalid input'}; goto ERROR; } + if ($pppsettings{'TYPE'} eq "qmi") { + # APN cannot be empty + if ($pppsettings{'APN'} eq "") { + $errormessage = $Lang::tr{'access point name is required'}; + goto ERROR; + } elsif (!&General::validdomainname($pppsettings{'APN'})) { + $errormessage = $Lang::tr{'access point name is invalid'}; + goto ERROR; + } + } if ($pppsettings{'PROFILENAME'} eq '') { $errormessage = $Lang::tr{'profile name not given'}; @@ -523,6 +533,7 @@ print <PPPoE + END ; @@ -719,7 +730,8 @@ END ; } -print < $Lang::tr{'idle timeout'} * @@ -738,7 +750,7 @@ print < END ; -print < $Lang::tr{'persistent'} @@ -767,6 +779,7 @@ END END ; +} if ($pppsettings{'TYPE'} eq 'pptp') { @@ -908,6 +921,26 @@ print < $Lang::tr{'authentication'} +END +; + +# Ask for the APN for QMI +if ($pppsettings{'TYPE'} eq 'qmi') { + print < + + $Lang::tr{'access point name'} +   + * + + + + + +END +} + +print < $Lang::tr{'username'} * diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index d504c58b6..c8fb82586 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -129,6 +129,9 @@ 'a connection with this name already exists' => 'A connection with this name already exists.', 'abort' => 'abort', 'access allowed' => 'Access allowed from:', +'access point name' => 'Access Point Name', +'access point name is invalid' => 'Access Point Name is invalid', +'access point name is required' => 'Access Point Name is required', 'access refused with this oinkcode' => 'Access refused with this Oink Code', 'accounting' => 'Accounting', 'accounting user nonpdc' => 'Accounting - none PDC Mode',