From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Bitsch To: development@lists.ipfire.org Subject: Patch for bugzilla #12050, try #2 Date: Sun, 14 Apr 2019 01:04:46 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4465361211246262082==" List-Id: --===============4465361211246262082== 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 EDIT: produced an error by blind copy & paste, should correct with this patch. --===============4465361211246262082== Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dhcp.cgi.patch" MIME-Version: 1.0 LS0tIC9zcnYvd2ViL2lwZmlyZS9jZ2ktYmluL2RoY3AuY2dpLm9yZwkyMDE5LTA0LTEzIDEzOjMy OjAxLjAwMDAwMDAwMCArMDIwMAorKysgL3Nydi93ZWIvaXBmaXJlL2NnaS1iaW4vZGhjcC5jZ2kJ MjAxOS0wNC0xNCAwMDo0NTo0My40MzMxNTY5NzkgKzAyMDAKQEAgLTQxMiwxMiArNDEyLDE2IEBA CiAgICAgfQoKICAgICBteSAka2V5ID0gMDsKKyAgICBteSAkc3pjID0gIHNjYWxhcihAY3VycmVu dDIpOwogICAgIENIRUNLOmZvcmVhY2ggbXkgJGxpbmUgKEBjdXJyZW50MikgewogICAgICAgICBt eSBAdGVtcCA9IHNwbGl0KC9cLC8sJGxpbmUpOwogICAgICAgICBpZigkZGhjcHNldHRpbmdzeydL RVkyJ30gbmUgJGtleSkgewogIAkgICAgIyBzYW1lIE1BQyBpcyBPSyBvbiBkaWZmZXJlbnQgc3Vi bmV0cy4gVGhpcyB0ZXN0IGlzIG5vdCBjb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