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 <bbitsch@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
$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