Message ID | trinity-27870ff7-5e8c-4923-a575-41117857fda7-1559643840434@3c-app-gmx-bs71 |
---|---|
State | Accepted |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id 4971888892E for <patchwork@web07.i.ipfire.org>; Tue, 4 Jun 2019 11:37:00 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 45J7dl2VPtz58BPf; Tue, 4 Jun 2019 11:36:59 +0100 (BST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 45J7dg1V5Yz5K46v for <development@lists.ipfire.org>; Tue, 4 Jun 2019 11:36:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1559644597; bh=Q3eEwdALX7nX7Jx25b5YEi/okATR4/Qy+VEKe+xt5Gg=; h=X-UI-Sender-Class:From:To:Subject:Date; b=XG8pWMwQlAFwbnRt/iB2Z0zAdCg7bI9SCx9+vQjUwcBKhrvvILyycOWhkNbdUztfD LLOKaER6AaViVeNPr/ANU8G7agJd+Y2pm4vTzGhXJ0O1GPH3n6SEVd2B5UIIfDLIxC xlKui4hujTx2xoMDlp3oyvDfCXevlvqsYyQ8HP20= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [149.172.151.26] ([149.172.151.26]) by web-mail.gmx.net (3c-app-gmx-bs71.server.lan [172.19.170.216]) (via HTTP); Tue, 4 Jun 2019 12:24:00 +0200 MIME-Version: 1.0 Message-ID: <trinity-27870ff7-5e8c-4923-a575-41117857fda7-1559643840434@3c-app-gmx-bs71> From: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> To: "IPFire Development" <development@lists.ipfire.org> Subject: [PATCH] dhcp.cgi: Fix for bug #12050 Content-Type: text/plain; charset=UTF-8 Date: Tue, 4 Jun 2019 12:24:00 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:l9jIvHq0AsmGJz+2fgqjFJeIc0KMbAOx1jU4zfLpG1UWxXkf3KDZ2YeLCHpb7cNqgHq+h DzqFJ2HGgks2w/uZey1qkvXy/J3Z0GhAJ+ZgQDgqZft48RSJ2bIN2ngXErNlAAAUIiXUsZZPdpEg UaAoMCVcqiq2lURzYzr8qdHWHRnDwIE3+IIYKvAjxaWetDPhh53Pw8KRy1kddcslOKR73m3dpz9z 8F8ZYgbiZQ1H5qywzcWPFcp6fuNBb3bR3pkUGwFH4/BujnLw2Ula1VI4zAZYo9WzTHf280l5YD9I Kg= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:qxuDqB7xM8Q=:wOU9I1aUBHGSlehSC1WM/f RxtGnXtaZ2/7hTBtHZhUtjbtwtown/6kb9S7QX7nUS3ys7/52sWHiL2frUb3LkWQa6JMPE4aR /40Kzm7M+uBBJ7q65uKmzS5A8c5Pb+Pd4r2mqKD+AQ4kIMv2V9Taantejk+yBZC2hUbZ8wXC3 Z2aU+fXGSTB/GwTVto7w+DX1NMSK3/W36nt1rKjg3bJgOzCa4m0SLLNmc7TJc7rOzAN6RfGmF PjCtGTm2WfXt6uDHCuP79u0bw11x9zVds2Hhbd5JsKhvjh2mOJBc7YL2V087CsNTaQ00rOGkm fqMaRRhiXC7sTiJsKDTPbTaWDrf4wlsm5YnK0ZcvjxiA7l5BQgJ3AQDH8yoK0watN+wFjWM+G c5I8ONBQa300hKeIUcSb6dWw8DuRTP+iB/J9pJ96ntCGUNikMayVFMY34+bhpW5Wj/i71S5AF oK8ZSdb+dq4VmND6dIZdpoFqG738u2ViyiguhGlmVec5PeL4ewTaEZP5P9hUpjMLe0oE9pYQk LYCwToeVHNLhGAeCduSocXdZoOw+DSqSmpOS7Xm2zLnkOib0Fw9mRDKMeC1Xf+QNYdNF+8hpi Jri2rKPiJ+1hmGVkm6xMs+w4YvHOB9sHJgzKPe3/DvUPhrbXN0SnLJAQ== Content-Transfer-Encoding: quoted-printable Authentication-Results: mail01.ipfire.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=XG8pWMwQ; dmarc=none; spf=pass (mail01.ipfire.org: domain of Bernhard.Bitsch@gmx.de designates 212.227.17.20 as permitted sender) smtp.mailfrom=Bernhard.Bitsch@gmx.de X-Rspamd-Queue-Id: 45J7dg1V5Yz5K46v X-Spamd-Result: default: False [-6.11 / 11.00]; R_SPF_ALLOW(-0.20)[+ip4:212.227.17.0/27]; FREEMAIL_FROM(0.00)[gmx.de]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmx.net:+]; MX_GOOD(-0.01)[mx00.emig.gmx.net,mx01.emig.gmx.net]; HAS_X_PRIO_THREE(0.00)[3]; RCVD_IN_DNSWL_LOW(-0.10)[20.17.227.212.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[26.151.172.149.zen.spamhaus.org : 127.0.0.10]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; FREEMAIL_ENVFROM(0.00)[gmx.de]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; BAYES_HAM(-3.00)[100.00%]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gmx.de]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM(-3.00)[-0.999,0]; IP_SCORE(0.00)[ipnet: 212.227.0.0/16(-4.93), asn: 8560(-3.76), country: DE(-0.08)]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2] 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 <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <https://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
dhcp.cgi: Fix for bug #12050
|
|
Commit Message
Bernhard Bitsch
June 4, 2019, 8:24 p.m. UTC
Save fixed leases to file after addition of a new lease
Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org>
---
html/cgi-bin/dhcp.cgi | 3 +++
1 file changed, 3 insertions(+)
--
2.21.0.windows.1
Comments
I think this patch has been submitted before. Why was it submitted again? What has changed? -Michael > On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > Save fixed leases to file after addition of a new lease > > Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > > --- > html/cgi-bin/dhcp.cgi | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > index 675d80012..19c55eb6d 100644 > --- a/html/cgi-bin/dhcp.cgi > +++ b/html/cgi-bin/dhcp.cgi > @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > + print FILE @current2; > + close(FILE); > &General::log($Lang::tr{'fixed ip lease added'}); > > # Enter edit mode > -- > 2.21.0.windows.1 >
I've just completed the subject. -Bernhard > Gesendet: Dienstag, 04. Juni 2019 um 14:33 Uhr > Von: "Michael Tremer" <michael.tremer@ipfire.org> > An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > Cc: "IPFire Development" <development@lists.ipfire.org> > Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > > I think this patch has been submitted before. > > Why was it submitted again? What has changed? > > -Michael > > > On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > > > Save fixed leases to file after addition of a new lease > > > > Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > > > > --- > > html/cgi-bin/dhcp.cgi | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > > index 675d80012..19c55eb6d 100644 > > --- a/html/cgi-bin/dhcp.cgi > > +++ b/html/cgi-bin/dhcp.cgi > > @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > > $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > > if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > > unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > > + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > > + print FILE @current2; > > + close(FILE); > > &General::log($Lang::tr{'fixed ip lease added'}); > > > > # Enter edit mode > > -- > > 2.21.0.windows.1 > > > >
Hello, I merged this patch. I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. I am happy that we can finally close this bug. Best, -Michael > On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > Save fixed leases to file after addition of a new lease > > Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > > --- > html/cgi-bin/dhcp.cgi | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > index 675d80012..19c55eb6d 100644 > --- a/html/cgi-bin/dhcp.cgi > +++ b/html/cgi-bin/dhcp.cgi > @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > + print FILE @current2; > + close(FILE); > &General::log($Lang::tr{'fixed ip lease added'}); > > # Enter edit mode > -- > 2.21.0.windows.1 >
Hello, Thanks for the merge. > Gesendet: Mittwoch, 05. Juni 2019 um 11:05 Uhr > Von: "Michael Tremer" <michael.tremer@ipfire.org> > An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > Cc: "IPFire Development" <development@lists.ipfire.org> > Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > > Hello, > > I merged this patch. > > I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. > The commit message just describes what has changed. The new entry is just added to the file. It is not the "one-click-solution" I would prefer, too. I can submit a patch for this functionality, if we want to do it this way. > I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. > I've read your message. If the patch contained this functionality I would have stated that in this way. > I am happy that we can finally close this bug. > So am I. Best, Bernhard > Best, > -Michael > > > On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > > > Save fixed leases to file after addition of a new lease > > > > Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > > > > --- > > html/cgi-bin/dhcp.cgi | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > > index 675d80012..19c55eb6d 100644 > > --- a/html/cgi-bin/dhcp.cgi > > +++ b/html/cgi-bin/dhcp.cgi > > @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > > $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > > if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > > unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > > + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > > + print FILE @current2; > > + close(FILE); > > &General::log($Lang::tr{'fixed ip lease added'}); > > > > # Enter edit mode > > -- > > 2.21.0.windows.1 > > > >
Hi, > On 5 Jun 2019, at 12:13, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > Hello, > > Thanks for the merge. > >> Gesendet: Mittwoch, 05. Juni 2019 um 11:05 Uhr >> Von: "Michael Tremer" <michael.tremer@ipfire.org> >> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> >> Cc: "IPFire Development" <development@lists.ipfire.org> >> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 >> >> Hello, >> >> I merged this patch. >> >> I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. >> > > The commit message just describes what has changed. The new entry is just added to the file. > It is not the "one-click-solution" I would prefer, too. > I can submit a patch for this functionality, if we want to do it this way. I tested the patch and I could add an extra from the fixed list with one click. What are you referring to? > >> I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. >> > I've read your message. If the patch contained this functionality I would have stated that in this way. What does the patch do from your point of view? > >> I am happy that we can finally close this bug. >> > So am I. > > Best, > Bernhard > >> Best, >> -Michael >> >>> On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: >>> >>> Save fixed leases to file after addition of a new lease >>> >>> Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> >>> >>> --- >>> html/cgi-bin/dhcp.cgi | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi >>> index 675d80012..19c55eb6d 100644 >>> --- a/html/cgi-bin/dhcp.cgi >>> +++ b/html/cgi-bin/dhcp.cgi >>> @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { >>> $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); >>> if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? >>> unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); >>> + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; >>> + print FILE @current2; >>> + close(FILE); >>> &General::log($Lang::tr{'fixed ip lease added'}); >>> >>> # Enter edit mode >>> -- >>> 2.21.0.windows.1 >>> >> >>
Hi, > Gesendet: Mittwoch, 05. Juni 2019 um 14:06 Uhr > Von: "Michael Tremer" <michael.tremer@ipfire.org> > An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > Cc: "IPFire Development" <development@lists.ipfire.org> > Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > > Hi, > > > On 5 Jun 2019, at 12:13, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > > > Hello, > > > > Thanks for the merge. > > > >> Gesendet: Mittwoch, 05. Juni 2019 um 11:05 Uhr > >> Von: "Michael Tremer" <michael.tremer@ipfire.org> > >> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > >> Cc: "IPFire Development" <development@lists.ipfire.org> > >> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > >> > >> Hello, > >> > >> I merged this patch. > >> > >> I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. > >> > > > > The commit message just describes what has changed. The new entry is just added to the file. > > It is not the "one-click-solution" I would prefer, too. > > I can submit a patch for this functionality, if we want to do it this way. > > I tested the patch and I could add an extra from the fixed list with one click. > > What are you referring to? > Okay it is a mix-up. For editing the new entry is added to the fixed leases list. Thus if I skip the edit step, the entry is contained anyway, but it is not sorted in. A one-click-solution should add the new entry, sort the list and return to default state of the page. > > > >> I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. > >> > > I've read your message. If the patch contained this functionality I would have stated that in this way. > > What does the patch do from your point of view? > It only synchronises the internal fixed leases list and the fixed leases file, without synching the sort order. > > > >> I am happy that we can finally close this bug. > >> > > So am I. > > > > Best, > > Bernhard > > > >> Best, > >> -Michael > >> > >>> On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > >>> > >>> Save fixed leases to file after addition of a new lease > >>> > >>> Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > >>> > >>> --- > >>> html/cgi-bin/dhcp.cgi | 3 +++ > >>> 1 file changed, 3 insertions(+) > >>> > >>> diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > >>> index 675d80012..19c55eb6d 100644 > >>> --- a/html/cgi-bin/dhcp.cgi > >>> +++ b/html/cgi-bin/dhcp.cgi > >>> @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > >>> $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > >>> if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > >>> unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > >>> + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > >>> + print FILE @current2; > >>> + close(FILE); > >>> &General::log($Lang::tr{'fixed ip lease added'}); > >>> > >>> # Enter edit mode > >>> -- > >>> 2.21.0.windows.1 > >>> > >> > >> > >
> On 5 Jun 2019, at 14:10, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > Hi, > >> Gesendet: Mittwoch, 05. Juni 2019 um 14:06 Uhr >> Von: "Michael Tremer" <michael.tremer@ipfire.org> >> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> >> Cc: "IPFire Development" <development@lists.ipfire.org> >> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 >> >> Hi, >> >>> On 5 Jun 2019, at 12:13, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: >>> >>> Hello, >>> >>> Thanks for the merge. >>> >>>> Gesendet: Mittwoch, 05. Juni 2019 um 11:05 Uhr >>>> Von: "Michael Tremer" <michael.tremer@ipfire.org> >>>> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> >>>> Cc: "IPFire Development" <development@lists.ipfire.org> >>>> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 >>>> >>>> Hello, >>>> >>>> I merged this patch. >>>> >>>> I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. >>>> >>> >>> The commit message just describes what has changed. The new entry is just added to the file. >>> It is not the "one-click-solution" I would prefer, too. >>> I can submit a patch for this functionality, if we want to do it this way. >> >> I tested the patch and I could add an extra from the fixed list with one click. >> >> What are you referring to? >> > > Okay it is a mix-up. For editing the new entry is added to the fixed leases list. Thus if I skip the edit step, the entry is contained anyway, but it is not sorted in. > A one-click-solution should add the new entry, sort the list and return to default state of the page. This is intentional that the page remains in edit mode. People usually want to change the remark or hostname. If you have a list of 200 leases, then finding the one that you have just added can be a pain. That is why this is there. > >>> >>>> I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. >>>> >>> I've read your message. If the patch contained this functionality I would have stated that in this way. >> >> What does the patch do from your point of view? >> > > It only synchronises the internal fixed leases list and the fixed leases file, without synching the sort order. Is that a problem when they are not sorted? By what would it be best to sort them? I do not think that the MAC address is a good option. Finding something in there is impossible as soon as the list becomes large. > >>> >>>> I am happy that we can finally close this bug. >>>> >>> So am I. >>> >>> Best, >>> Bernhard >>> >>>> Best, >>>> -Michael >>>> >>>>> On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: >>>>> >>>>> Save fixed leases to file after addition of a new lease >>>>> >>>>> Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>>> >>>>> --- >>>>> html/cgi-bin/dhcp.cgi | 3 +++ >>>>> 1 file changed, 3 insertions(+) >>>>> >>>>> diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi >>>>> index 675d80012..19c55eb6d 100644 >>>>> --- a/html/cgi-bin/dhcp.cgi >>>>> +++ b/html/cgi-bin/dhcp.cgi >>>>> @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { >>>>> $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); >>>>> if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? >>>>> unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); >>>>> + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; >>>>> + print FILE @current2; >>>>> + close(FILE); >>>>> &General::log($Lang::tr{'fixed ip lease added'}); >>>>> >>>>> # Enter edit mode >>>>> -- >>>>> 2.21.0.windows.1
> Gesendet: Mittwoch, 05. Juni 2019 um 15:26 Uhr > Von: "Michael Tremer" <michael.tremer@ipfire.org> > An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > Cc: "IPFire Development" <development@lists.ipfire.org> > Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > > > > > On 5 Jun 2019, at 14:10, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > > > > Hi, > > > >> Gesendet: Mittwoch, 05. Juni 2019 um 14:06 Uhr > >> Von: "Michael Tremer" <michael.tremer@ipfire.org> > >> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > >> Cc: "IPFire Development" <development@lists.ipfire.org> > >> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > >> > >> Hi, > >> > >>> On 5 Jun 2019, at 12:13, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > >>> > >>> Hello, > >>> > >>> Thanks for the merge. > >>> > >>>> Gesendet: Mittwoch, 05. Juni 2019 um 11:05 Uhr > >>>> Von: "Michael Tremer" <michael.tremer@ipfire.org> > >>>> An: "Bernhard Bitsch" <Bernhard.Bitsch@gmx.de> > >>>> Cc: "IPFire Development" <development@lists.ipfire.org> > >>>> Betreff: Re: [PATCH] dhcp.cgi: Fix for bug #12050 > >>>> > >>>> Hello, > >>>> > >>>> I merged this patch. > >>>> > >>>> I had to spend a little time to figure out what you actually wanted to achieve here. It would have helped to add to the commit message that the expected behaviour just wasn’t programmed into the file and that this patch now changes that. > >>>> > >>> > >>> The commit message just describes what has changed. The new entry is just added to the file. > >>> It is not the "one-click-solution" I would prefer, too. > >>> I can submit a patch for this functionality, if we want to do it this way. > >> > >> I tested the patch and I could add an extra from the fixed list with one click. > >> > >> What are you referring to? > >> > > > > Okay it is a mix-up. For editing the new entry is added to the fixed leases list. Thus if I skip the edit step, the entry is contained anyway, but it is not sorted in. > > A one-click-solution should add the new entry, sort the list and return to default state of the page. > > This is intentional that the page remains in edit mode. People usually want to change the remark or hostname. If you have a list of 200 leases, then finding the one that you have just added can be a pain. That is why this is there. > You can set these fields with the first addition operation. No need to make it easy editable in all cases. But the actual solution leaves a somehow irritating state: data is displayed in the edit fields, top entry ( the entry just added ) is in yellow; "is the entry added or must I click 'update' to accomplish this?" I'm talking of adding new fixed leases, not about adding dynamic leases to the fixed leases set. That's another case, where you should edit the data to separate the IP ranges for these sets. > > > >>> > >>>> I updated the commit message for your future reference. Please read through that and take some inspiration from that with your next patch. > >>>> > >>> I've read your message. If the patch contained this functionality I would have stated that in this way. > >> > >> What does the patch do from your point of view? > >> > > > > It only synchronises the internal fixed leases list and the fixed leases file, without synching the sort order. > > Is that a problem when they are not sorted? By what would it be best to sort them? I do not think that the MAC address is a good option. Finding something in there is impossible as soon as the list becomes large. File fixedleases is sorted by the setting 'SORT_FLEASES' from setttings. This is true for the internal array in dhcp.cgi, also. > > > > >>> > >>>> I am happy that we can finally close this bug. > >>>> > >>> So am I. > >>> > >>> Best, > >>> Bernhard > >>> > >>>> Best, > >>>> -Michael > >>>> > >>>>> On 4 Jun 2019, at 11:24, Bernhard Bitsch <Bernhard.Bitsch@gmx.de> wrote: > >>>>> > >>>>> Save fixed leases to file after addition of a new lease > >>>>> > >>>>> Signed-off-by: Bernhard Bitsch <bbitsch@ipfire.org> > >>>>> > >>>>> --- > >>>>> html/cgi-bin/dhcp.cgi | 3 +++ > >>>>> 1 file changed, 3 insertions(+) > >>>>> > >>>>> diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi > >>>>> index 675d80012..19c55eb6d 100644 > >>>>> --- a/html/cgi-bin/dhcp.cgi > >>>>> +++ b/html/cgi-bin/dhcp.cgi > >>>>> @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { > >>>>> $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); > >>>>> if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? > >>>>> unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); > >>>>> + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; > >>>>> + print FILE @current2; > >>>>> + close(FILE); > >>>>> &General::log($Lang::tr{'fixed ip lease added'}); > >>>>> > >>>>> # Enter edit mode > >>>>> -- > >>>>> 2.21.0.windows.1 > >
diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index 675d80012..19c55eb6d 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -443,6 +443,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { $dhcpsettings{'FIX_ROOTPATH'} = &Header::cleanhtml($dhcpsettings{'FIX_ROOTPATH'}); if ($dhcpsettings{'KEY2'} eq '') { #add or edit ? unshift (@current2, "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"); + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; + print FILE @current2; + close(FILE); &General::log($Lang::tr{'fixed ip lease added'}); # Enter edit mode