From: Bernhard Bitsch Date: Tue, 4 Jun 2019 10:24:00 +0000 (+0200) Subject: dhcp.cgi: Save fixed leases immediately after addition of a new lease X-Git-Tag: v2.23-core133~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4f9ea3c1650d369f8a764605203778bfea0d390;p=ipfire-2.x.git dhcp.cgi: Save fixed leases immediately after addition of a new lease This changes the behaviour of the script to immediately save the added lease to file but still remain in edit mode to make changes. If the user does not make any changes, the lease is immediately saved and there is no second click required to write it to file. This a more natural flow that is expected by almost all users of this feature. Fixes: #12050 Signed-off-by: Bernhard Bitsch Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index 675d800120..19c55eb6d4 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