From patchwork Tue Oct 13 16:07:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3569 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 4C9gW60jT4z3x1S for ; Tue, 13 Oct 2020 16:10:26 +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 4C9gSz503hz1TJ; Tue, 13 Oct 2020 16:08:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4C9gSw0l7hz305y; Tue, 13 Oct 2020 16:08:32 +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 4C9gSt3khQz305n for ; Tue, 13 Oct 2020 16:08:30 +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 4C9gSr0mmJz1Hr; Tue, 13 Oct 2020 16:08:28 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1602605308; 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=/BwF6mWLR14wYJ2Mormawzi7xwLuAAKdYJScRUIFJ8A=; b=1/dOZ/MHTBnknsCPGXdCv8t6IfzZnEUyMsCJiv+jOA9VrDgmrQ1e8u7S3IrVFR6NnoPgxp 79cBfdnzb8iBHjDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1602605308; 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=/BwF6mWLR14wYJ2Mormawzi7xwLuAAKdYJScRUIFJ8A=; b=I0u7w23cDNhOF9UpaIuH6+omFDNe2CC/nHNIUCvVy4620x+ZzGlhzEfa+8oHzFHGznJnU3 0TT7pXQYn5LoOto2diDHPt2taskgd7ab21lupDkWC8koW6+ksqHy5XFgGxkj8v25kKwCuh ZJ2v5b+/zagYd8ElIcV6NIKJ6tfGEOxzHJzN9CLusvf0Dd9BBwzEZOkTkx0aT3xGKOkDdA Xy09cYUXOWq4EHzGAeNi9F8J/fdjETBWsS0xBGVcfFvA0h0PrNv3aLFEvkP9NVcYSGTHcq 3ZBHBi/lqHoKJIZCFSG0PDnfVGsx45Vvj8mKKGfGZk088MeqyXP54HC8eC5qmQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 39/54] samba: Refactor shares section Date: Tue, 13 Oct 2020 16:07:57 +0000 Message-Id: <20201013160812.27754-39-michael.tremer@ipfire.org> In-Reply-To: <20201013160812.27754-1-michael.tremer@ipfire.org> References: <20201013160812.27754-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/samba.cgi | 165 ++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 70 deletions(-) diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index 7d5b4336c..a64fc9177 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -608,94 +608,119 @@ END my %shares = config("${General::swroot}/samba/shares"); -print < - - - +print < + + + + END -; -my @Shares = keys(%shares); +my @shares = keys(%shares); my $lines = 0; my $col=""; -foreach my $shareentry (sort @Shares) - { +foreach my $shareentry (sort @shares) { chomp $shareentry; + if ($lines % 2) { - print ""; - $col="bgcolor='$color{'color20'}'"; + $col = "bgcolor='$color{'color20'}'"; } else { - print ""; - $col="bgcolor='$color{'color22'}'"; - } - print <$shareentry - - -END -; - $lines++; + $col = "bgcolor='$color{'color22'}'"; } -print < -
-
$Lang::tr{'manage shares'}
$Lang::tr{'sharename'}$Lang::tr{'options'}
$Lang::tr{'sharename'}
- - - -
- - - -
- - -
- - -
+ print < + $shareentry + +
+ + + +
+ + +
+ + + +
+ + END ; + $lines++; +} -if ($sambasettings{'ACTION'} eq 'shareadd') - { - print < - - - - +print < -
-
$Lang::tr{'add share'}
- + +
+ +
-
+ + +
+
+ + +
+
END -; - } -if ($sambasettings{'ACTION'} eq 'sharechange') - { +if ($sambasettings{'ACTION'} eq 'shareadd') { + print < + +
+ + + + + + + + + + +
$Lang::tr{'add share'}
+ +
+ + +
+
+END +} + +if ($sambasettings{'ACTION'} eq 'sharechange') { my $shareoption = $shares{$sambasettings{'NAME'}}; - print < - - - - -
$Lang::tr{'edit share'}
-
- - -
- -
+ + print < + +
+ + + + + + + + + + + + +
$Lang::tr{'edit share'}
+ +
+ + +
+
END -; - } +} if ($sambasettings{'ACTION'} eq 'smbshareadd') {