From patchwork Thu May 24 20:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Marx X-Patchwork-Id: 1782 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 6D73B60993 for ; Thu, 24 May 2018 12:38:46 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 04801110BF3A; Thu, 24 May 2018 11:38:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1527158326; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:list-id:list-unsubscribe:list-subscribe:list-post; bh=SN1urkorr/TTUhkLvMqy6xg+16NYwwh9/XOwtvCq/O4=; b=ESP9pwhDW7cVQeZSNyzbfVSv2QKuLye/KmfOX9onl5V8UH5oEGcItGUSDYSQFINf8zVGxM J+LRbwj6QZozzgVnZ4agNDftPmz3yFeZ6dixvMTcLr5TCWKj3R3+bfuMIP/pi4z80ytM0Q hPuA0JauGfDgKPT2SIFAURNe/UED8ap2Y5qZHTI1R8NDtjbUxnx6sLaxV4n+fgB3jCv8Cb RBox7tZT3TDZkm0tt34qTBn2aaVAT5JGE881jFbYw2afEeiUyYH+wO9YcDaZnWp9SbyRJh srV0F9X6401tRImxmxTFE2nmTGCZvEAEtu63TmNxke0ggW2qF64M3EmAFTxJYw== Authentication-Results: mail01.i.ipfire.org; auth=pass smtp.auth=amarx smtp.mailfrom=alexander.marx@ipfire.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1527158322; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=SN1urkorr/TTUhkLvMqy6xg+16NYwwh9/XOwtvCq/O4=; b=Gk8hajUv8ZHGkIgzLgHtfLc4krQkjID8XMCVeNdgG6x/hiWySeazCzfkY4rqwG8rCnf3Ph kQIW30Gf/fribCOP6EwLfyTUxdaWIMzZV0Yzdl/nZKhQZVZvnmmWeut2kX714MN946EqsH ZWWusybK+c7qoylcUrecWvSfT8+QDzN0M2QooChDMduej+m+DRUYB0FIfxWV/r6apMjhbB rKp1lkGhWYcDIS4fpr68YkzO+h72jLxitP67wF+F7VCa8dA/EUC2YnzB6qHxihoUcFhOAA awzOBaHLcsJXFXWbsVBeG42UHnMnmgHosVHLZ7A7ADG02eEXnZmUVbHytyAxlA== Received: from EDV1.kappeln2011.lan (unknown [90.187.3.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id B2D9C110BF28; Thu, 24 May 2018 11:38:42 +0100 (BST) From: Alexander Marx To: development@lists.ipfire.org Subject: [PATCH] BUG11505: Captive Portal: no way to remove an uploaded logo Date: Thu, 24 May 2018 12:38:39 +0200 Message-Id: <1527158319-14437-1-git-send-email-alexander.marx@ipfire.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Spamd-Result: default: False [-4.97 / 11.00]; ASN(0.00)[asn:31334, ipnet:90.187.0.0/16, country:DE]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; BAYES_HAM(-3.00)[100.00%]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM(-2.87)[-0.957,0] X-Spam-Status: No, score=-4.97 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" added a delete button Signed-off-by: Alexander Marx --- html/cgi-bin/captive.cgi | 9 ++++++++- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/captive.cgi b/html/cgi-bin/captive.cgi index 65cc349..02b2eb5 100755 --- a/html/cgi-bin/captive.cgi +++ b/html/cgi-bin/captive.cgi @@ -142,6 +142,10 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) { } } +if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive delete logo'}") { + unlink $logo; +} + if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupons'}") { #check valid remark if ($cgiparams{'REMARK'} ne '' && !&validremark($cgiparams{'REMARK'})){ @@ -381,7 +385,10 @@ if (-e $logo) { print < $Lang::tr{'Captive logo uploaded'} - $Lang::tr{'yes'} + + $Lang::tr{'yes'}  + + END } diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index edff684..f00a667 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -28,6 +28,7 @@ 'Captive clients' => 'Clients', 'Captive config' => 'Konfiguration', 'Captive coupon' => 'Gutschein', +'Captive delete logo' => 'Logo löschen', 'Captive err doublevoucher' => 'Ein Gutschein mit diesem Code ist bereits im Umlauf', 'Captive expire' => 'Ablauf', 'Captive expiry time' => 'Ablaufzeit', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 0c77ce4..ef141a3 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -27,6 +27,7 @@ 'Captive client session expiry time' => 'Session Expiry Time', 'Captive config' => 'Settings', 'Captive coupon' => 'Coupon', +'Captive delete logo' => 'Delete Logo', 'Captive err doublevoucher' => 'A coupon with this code already exists', 'Captive expire' => 'Expire', 'Captive expiry time' => 'Expiry Time',