From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Bitsch To: development@lists.ipfire.org Subject: Patch for bugzilla #12050 Date: Sat, 13 Apr 2019 23:13:32 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0044861822878911354==" List-Id: --===============0044861822878911354== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Please find appended the solution. Short description of the problem: After adding a new lease, you are in editing mode. All fields are set right, but a second click ('update' ) is necessary. With determining the exact mode 'add/edit' this second click can be avoided f= or new entries ( new MAC/IP combination). The patch adds determination of add/edit mode. If the MAC/IP pair exists in t= he list of fixed leases edit mode is selected, add mode is selected else. Sorry, did not produce the patch from git but by diffing changed file and the= core 129 original. -Bernhard --===============0044861822878911354== Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dhcp.cgi.patch" MIME-Version: 1.0 LS0tIC9zcnYvd2ViL2lwZmlyZS9jZ2ktYmluL2RoY3AuY2dpLm9yZwkyMDE5LTA0LTEzIDEzOjMy OjAxLjAwMDAwMDAwMCArMDIwMAorKysgL3Nydi93ZWIvaXBmaXJlL2NnaS1iaW4vZGhjcC5jZ2kJ MjAxOS0wNC0xMyAxMzo1NzoyNy4zODYyMjgwODUgKzAyMDAKQEAgLTQxMiwxMiArNDEyLDE2IEBA CiAgICAgfQoKICAgICBteSAka2V5ID0gMDsKKyAgICBteSAkc3pjID0gIHNjYWxhcihAY3VycmVu dDIpOwogICAgIENIRUNLOmZvcmVhY2ggbXkgJGxpbmUgKEBjdXJyZW50MikgewogICAgICAgICBt eSBAdGVtcCA9IHNwbGl0KC9cLC8sJGxpbmUpOwogICAgICAgICBpZigkZGhjcHNldHRpbmdzeydL RVkyJ30gbmUgJGtleSkgewogIAkgICAgIyBzYW1lIE1BQyBpcyBPSyBvbiBkaWZmZXJlbnQgc3Vi bmV0cy4gVGhpcyB0ZXN0IGlzIG5vdCBjb21wbGV0ZSBiZWNhdXNlCiAJICAgICMga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nc3snRklYX0VOQUJMRUQnfSwkZGhjcHNldHRpbmdzeydGSVhfTkVYVEFERFInfSwk ZGhjcHNldHRpbmdzeydGSVhfRklMRU5BTUUnfSwkZGhjcHNldHRpbmdzeydGSVhfUk9PVFBBVEgn fSwkZGhjcHNldHRpbmdzeydGSVhfUkVNQVJLJ31cbiI7CiAJICAgICRkaGNwc2V0dGluZ3N7J0tF WTInfSA9ICcnOyAgICAgICAjIEVuZCBlZGl0IG1vZGUK --===============0044861822878911354==--