From: Michael Tremer Date: Mon, 1 Jun 2015 13:56:46 +0000 (+0200) Subject: dhcp: Enter edit mode after adding a static lease from list X-Git-Tag: v2.17-core91~31 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=91fc30309fcc929ae3b4b88f6cac67e1214e73a9 dhcp: Enter edit mode after adding a static lease from list After a lease has been added from the list of leases it is often desirable to edit it right away. It appeared that the system was in edit mode after the lease has been added because the form had the values of the recently added lease, but hitting the "Add" button cause an error message that stated that this is a duplicate entry. This patch will switch to edit more where the user can change the values and hit "Update". If he or she chooses to ignore that the entry is still saved. --- diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index e75207a219..dd48d58cb0 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -438,6 +438,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { 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"); &General::log($Lang::tr{'fixed ip lease added'}); + + # Enter edit mode + $dhcpsettings{'KEY2'} = $key; } else { @current2[$dhcpsettings{'KEY2'}] = "$dhcpsettings{'FIX_MAC'},$dhcpsettings{'FIX_ADDR'},$dhcpsettings{'FIX_ENABLED'},$dhcpsettings{'FIX_NEXTADDR'},$dhcpsettings{'FIX_FILENAME'},$dhcpsettings{'FIX_ROOTPATH'},$dhcpsettings{'FIX_REMARK'}\n"; $dhcpsettings{'KEY2'} = ''; # End edit mode