X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fupnp.cgi;fp=html%2Fcgi-bin%2Fupnp.cgi;h=2b7168c9cc25f427165e1caf02c6e507bafcc7cb;hb=5fd302326dd90d17abb8496d575c795a61c033d8;hp=3afaee2c47ea91e28bcd27203c403b045f79089c;hpb=2abc4aad764ccc198e265a7dc5a5c10b3f62275a;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi index 3afaee2c4..2b7168c9c 100644 --- a/html/cgi-bin/upnp.cgi +++ b/html/cgi-bin/upnp.cgi @@ -26,7 +26,7 @@ my %selected= () ; my %servicenames = ( - 'UPnP Daemon' => 'upnpd', + 'UPnP Daemon' => 'upnpd', ); &Header::showhttpheaders(); @@ -42,8 +42,14 @@ $upnpsettings{'UPSTREAM'} = '16000000'; $upnpsettings{'DESCRIPTION'} = 'gatedesc.xml'; $upnpsettings{'XML'} = '/etc/linuxigd'; $upnpsettings{'ENABLED'} = 'off'; -$upnpsettings{'GREEN'} = 'on'; -$upnpsettings{'BLUE'} = 'off'; +$upnpsettings{'GREENi'} = 'on'; +$upnpsettings{'BLUEi'} = 'off'; +$upnpsettings{'REDi'} = 'off'; +$upnpsettings{'ORANGEi'} = 'off'; +$upnpsettings{'GREENe'} = 'off'; +$upnpsettings{'BLUEe'} = 'off'; +$upnpsettings{'REDe'} = 'on'; +$upnpsettings{'ORANGEe'} = 'off'; ### Values that have to be initialized $upnpsettings{'ACTION'} = ''; @@ -60,9 +66,9 @@ if ($upnpsettings{'ACTION'} eq $Lang::tr{'save'}) { &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings); - open (FILE, ">${General::swroot}/upnp/upnpd.conf") or die "Can't save the upnp config: $!"; - flock (FILE, 2); - + open (FILE, ">${General::swroot}/upnp/upnpd.conf") or die "Can't save the upnp config: $!"; + flock (FILE, 2); + print FILE <$errormessage\n"; - print " \n"; - &Header::closebox(); + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + print "$errormessage\n"; + print " \n"; + &Header::closebox(); } -$checked{'GREEN'}{'on'} = ''; -$checked{'GREEN'}{'off'} = ''; -$checked{'GREEN'}{"$upnpsettings{'GREEN'}"} = 'checked'; -$checked{'BLUE'}{'on'} = ''; -$checked{'BLUE'}{'off'} = ''; -$checked{'BLUE'}{"$upnpsettings{'BLUE'}"} = 'checked'; +$checked{'GREENi'}{'on'} = ''; +$checked{'GREENi'}{'off'} = ''; +$checked{'GREENi'}{"$upnpsettings{'GREENi'}"} = 'checked'; +$checked{'BLUEi'}{'on'} = ''; +$checked{'BLUEi'}{'off'} = ''; +$checked{'BLUEi'}{"$upnpsettings{'BLUEi'}"} = 'checked'; +$checked{'REDi'}{'on'} = ''; +$checked{'REDi'}{'off'} = ''; +$checked{'REDi'}{"$upnpsettings{'REDi'}"} = 'checked'; +$checked{'ORANGEi'}{'on'} = ''; +$checked{'ORANGEi'}{'off'} = ''; +$checked{'ORANGEi'}{"$upnpsettings{'ORANGEi'}"} = 'checked'; +$checked{'GREENe'}{'on'} = ''; +$checked{'GREENe'}{'off'} = ''; +$checked{'GREENe'}{"$upnpsettings{'GREENe'}"} = 'checked'; +$checked{'BLUEe'}{'on'} = ''; +$checked{'BLUEe'}{'off'} = ''; +$checked{'BLUEe'}{"$upnpsettings{'BLUEe'}"} = 'checked'; +$checked{'REDe'}{'on'} = ''; +$checked{'REDe'}{'off'} = ''; +$checked{'REDe'}{"$upnpsettings{'REDe'}"} = 'checked'; +$checked{'ORANGEe'}{'on'} = ''; +$checked{'ORANGEe'}{'off'} = ''; +$checked{'ORANGEe'}{"$upnpsettings{'ORANGEe'}"} = 'checked'; ############################################################################################################################ ############################################################################################################################ &Header::openbox('100%', 'center', 'UPnP'); print < - + +
END ; - if ( $message ne "" ) { - print "\n"; } - else { - print "\n"; } - print "
$message"; - } - - my $lines = 0; - my $key = ''; - foreach $key (sort keys %servicenames) - { - if ($lines % 2) { - print "
$key\n"; - my $shortname = $servicenames{$key}; - my $status = &isrunning($shortname); - print "$status\n"; - $lines++; - } - print <Alle Dienste: - - - -
- -
-
- - \n"; } + else { + print "\n"; } + print "
$Lang::tr{'options'} -
$Lang::tr{'interfaces'} -   $Lang::tr{'green'} - $netsettings{'GREEN_DEV'} -END -; - if (&Header::blue_used()){ + if ( $message ne "" ) { + print "
$message"; + } + + my $lines = 0; + my $key = ''; + foreach $key (sort keys %servicenames) + { + if ($lines % 2) { + print "
$key\n"; + my $shortname = $servicenames{$key}; + my $status = &isrunning($shortname); + print "$status\n"; + $lines++; + } print <  $Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'} +
Alle Dienste: + + + +
END ; - } - print < - +#print <
+#
+#

+# +# +# +# +# +# +#
External Interface
 RED - $netsettings{'RED_DEV'}

+# $Lang::tr{'green'} - $netsettings{'GREEN_DEV'}

+#END +#; +# if (&Header::blue_used()){ +# print <$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}

+#END +#; +# } +# if (&Header::orange_used()){ +# print <$Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}

+#END +#; +# } +# print <


Internal Interface
 RED - $netsettings{'RED_DEV'}

+# $Lang::tr{'green'} - $netsettings{'GREEN_DEV'}

+#END +#; +# if (&Header::blue_used()){ +# print <$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}

+#END +#; +# } +# if (&Header::orange_used()){ +# print <$Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}

+#END +#; +# } +# print <
+print < +

+ + + @@ -174,6 +234,7 @@ END +
$Lang::tr{'options'}


Debug Mode:
Forward Rules:
Forward Chain:
Up Strean:
Description Document:
XML Document:




@@ -190,33 +251,33 @@ END sub isrunning { - my $cmd = $_[0]; - my $status = "$Lang::tr{'stopped'}"; - my $pid = ''; - my $testcmd = ''; - my $exename; - - $cmd =~ /(^[a-z]+)/; - $exename = $1; - - if (open(FILE, "/var/run/${cmd}.pid")) - { - $pid = ; chomp $pid; - close FILE; - if (open(FILE, "/proc/${pid}/status")) - { - while () - { - if (/^Name:\W+(.*)/) { - $testcmd = $1; } - } - close FILE; - if ($testcmd =~ /$exename/) - { - $status = "$Lang::tr{'running'}"; - } - } - } - - return $status; -} + my $cmd = $_[0]; + my $status = "$Lang::tr{'stopped'}"; + my $pid = ''; + my $testcmd = ''; + my $exename; + + $cmd =~ /(^[a-z]+)/; + $exename = $1; + + if (open(FILE, "/var/run/${cmd}.pid")) + { + $pid = ; chomp $pid; + close FILE; + if (open(FILE, "/proc/${pid}/status")) + { + while () + { + if (/^Name:\W+(.*)/) { + $testcmd = $1; } + } + close FILE; + if ($testcmd =~ /$exename/) + { + $status = "$Lang::tr{'running'}"; + } + } + } + + return $status; +} \ No newline at end of file