]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/dhcp.cgi
DHCP Webseite angepasst damit beim speichern auch die rc links gesetzt werden
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / dhcp.cgi
index 1ccaa400310bbd3325e0e8e1cb263686ef003909..6d88a7f46a7ffcc244096be448e9ceaf5fa5474f 100644 (file)
@@ -44,12 +44,14 @@ our $filename3 = "${General::swroot}/dhcp/advoptions-list"; # Describe the allow
 my $errormessage = '';
 my $warnNTPmessage = '';
 my @nosaved=();
+my %color = ();
 
 #Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS 
 our $OptionTypes = 'boolean|((un)?signed )?integer (8|16|32)|ip-address|text|string|encapsulate \w+|array of ip-address';
 
 &Header::showhttpheaders();
-our @ITFs=('GREEN','BLUE');
+our @ITFs=('GREEN');
+if (&Header::blue_used()){push(@ITFs,'BLUE');}
 
 #Settings1 for the first screen box
 foreach my $itf (@ITFs) {
@@ -101,6 +103,7 @@ foreach my $itf (@ITFs) {
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 &General::readhash("${General::swroot}/time/settings", \%timesettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 #Get GUI values
 &Header::getcgihash(\%dhcpsettings);
@@ -720,9 +723,9 @@ foreach my $line (@current1) {
     if ($dhcpsettings{'KEY1'} eq $key) {
        print "<tr bgcolor='${Header::colouryellow}'>";
     } elsif ($key % 2) {
-       print "<tr bgcolor='${Header::table2colour}'>";
+       print "<tr bgcolor='$color{'color22'}'>";
     } else {
-       print "<tr bgcolor='${Header::table1colour}'>"; 
+       print "<tr bgcolor='$color{'color20'}'>"; 
     }
 
     print <<END
@@ -918,9 +921,9 @@ foreach my $line (@current2) {
     if ($dhcpsettings{'KEY2'} eq $key) {
        print "<tr bgcolor='${Header::colouryellow}'>";
     } elsif ($key % 2) {
-       print "<tr bgcolor='${Header::table2colour}'>";
+       print "<tr bgcolor='$color{'color22'}'>";
     } else {
-       print "<tr bgcolor='${Header::table1colour}'>"; 
+       print "<tr bgcolor='$color{'color20'}'>"; 
     }
     my $TAG0 = '';
     my $TAG1 = '';
@@ -1199,11 +1202,9 @@ sub buildconf {
            print FILE "} #$itf\n";
 
            system ('/usr/bin/touch', "${General::swroot}/dhcp/enable_${lc_itf}");
-           system ('/usr/local/bin/dhcpctrl enable');
            &General::log("DHCP on ${itf}: " . $Lang::tr{'dhcp server enabled'})
        } else {
            unlink "${General::swroot}/dhcp/enable_${lc_itf}";
-           system ('/usr/local/bin/dhcpctrl disable');
            &General::log("DHCP on ${itf}: " . $Lang::tr{'dhcp server disabled'})
        }
     }
@@ -1226,6 +1227,8 @@ sub buildconf {
        }
     }
     close FILE;
+    if ( $dhcpsettings{"ENABLE_GREEN"} eq 'on' || $dhcpsettings{"ENABLE_BLUE"} eq 'on' ) {system '/usr/local/bin/dhcpctrl enable >/dev/null 2>&1';}
+    else {system '/usr/local/bin/dhcpctrl disable >/dev/null 2>&1';}
     system '/usr/local/bin/dhcpctrl restart >/dev/null 2>&1';
 }