Change that iptv-mac field could also empty for save
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 6 Oct 2009 19:09:52 +0000 (21:09 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 6 Oct 2009 19:09:52 +0000 (21:09 +0200)
html/cgi-bin/backup.cgi [changed mode: 0755->0644]
html/cgi-bin/dns.cgi [changed mode: 0755->0644]
html/cgi-bin/index.cgi [changed mode: 0755->0644]
html/cgi-bin/mac.cgi
html/cgi-bin/pakfire.cgi [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7c00cc3..83207d6 100644 (file)
@@ -22,8 +22,8 @@
 use strict;
 
 # enable only the following on debugging purpose
-use warnings;
-use CGI::Carp 'fatalsToBrowser';
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
@@ -56,16 +56,19 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
                $errormessage = $Lang::tr{'mac address error not valid'};
        }
        $macsettings{'MAC2'} =~ s/\-/:/g;
-       my @mac = split(/:/,$macsettings{"MAC2"});
-       if ($#mac == 5) { 
-               foreach (@mac) {
-                       unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
-                                       $errormessage = $Lang::tr{'mac address error not valid'};
-                                       last;                   
+       
+       if ( not ($macsettings{'MAC2'} eq "" )) {
+               my @mac = split(/:/,$macsettings{"MAC2"});
+               if ($#mac == 5) { 
+                       foreach (@mac) {
+                               unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
+                                               $errormessage = $Lang::tr{'mac address error not valid'};
+                                               last;                   
+                               }
                        }
+               } else {
+                       $errormessage = $Lang::tr{'mac address error not valid'};
                }
-       } else {
-               $errormessage = $Lang::tr{'mac address error not valid'};
        }
        if ($errormessage eq "") {
                $macsettings{'MAC'} =~ s/\:/-/g;
old mode 100755 (executable)
new mode 100644 (file)