]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
mail.cgi: Always check content of fields
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Oct 2019 10:58:59 +0000 (10:58 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 13 Nov 2019 18:41:01 +0000 (18:41 +0000)
These checks did not do anything but clear all fields
when mailing was disabled.

It makes a lot more sense to retain people's settings,
even when they have been disabled.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/mail.cgi

index 9cf14cac8b0d3d8b4b56d8f017daf3db86a84991..07986a4d65951cee660cd444eb029f1990eedd46 100755 (executable)
@@ -81,19 +81,10 @@ if ( -f $mailfile){
 
 #ACTIONS
 if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){ #SaveButton on configsite
-       #Check fields
-       if ($cgiparams{'USEMAIL'} eq 'on'){
-               $errormessage=&checkmailsettings;
-       }else{
-               $cgiparams{'txt_mailserver'}='';
-               $cgiparams{'txt_mailport'}='';
-               $cgiparams{'txt_mailuser'}='';
-               $cgiparams{'txt_mailpass'}='';
-               $cgiparams{'mail_tls'}='';
-               $cgiparams{'txt_mailsender'}='';
-               $cgiparams{'txt_recipient'}='';
-       }
-       if(!$errormessage){
+       # Check fields
+       $errormessage = &checkmailsettings();
+
+       if (!$errormessage) {
                #clear hashes
                %auth=();
                %dma=();