tazpanel diff network.cgi @ rev 81

Use httpd_helper parser (GET)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Apr 13 16:41:02 2011 +0200 (2011-04-13)
parents 7ac8e561d0a5
children df959815c470
line diff
     1.1 --- a/network.cgi	Tue Apr 12 04:24:35 2011 +0200
     1.2 +++ b/network.cgi	Wed Apr 13 16:41:02 2011 +0200
     1.3 @@ -2,12 +2,11 @@
     1.4  #
     1.5  # Network configuration CGI interface
     1.6  #
     1.7 -echo "Content-Type: text/html"
     1.8 -echo ""
     1.9  
    1.10  # Common functions from libtazpanel
    1.11  . lib/libtazpanel
    1.12  get_config
    1.13 +header
    1.14  
    1.15  # Include gettext helper script.
    1.16  . /usr/bin/gettext.sh
    1.17 @@ -19,13 +18,13 @@
    1.18  TITLE="- Network"
    1.19  
    1.20  # Actions commands before page is displayed
    1.21 -case "$QUERY_STRING" in
    1.22 -	start)
    1.23 +case " $(GET) " in
    1.24 +	*\ start\ *)
    1.25  		# Here we sleep a bit to let udhcp get the lease before reloading
    1.26  		# page with status
    1.27  		/etc/init.d/network.sh start | log
    1.28  		sleep 2 ;;
    1.29 -	stop)
    1.30 +	*\ stop\ *)
    1.31  		/etc/init.d/network.sh stop | log ;;
    1.32  	*)
    1.33  		continue ;;
    1.34 @@ -35,8 +34,8 @@
    1.35  # Main Commands for pages
    1.36  #
    1.37  
    1.38 -case "$QUERY_STRING" in
    1.39 -	eth)
    1.40 +case " $(GET) " in
    1.41 +	*\ eth\ *)
    1.42  		# Wired connections settings
    1.43  		xhtml_header
    1.44  		
    1.45 @@ -47,7 +46,7 @@
    1.46  </pre>
    1.47  EOT
    1.48  		;;
    1.49 -	wifi)
    1.50 +	*\ wifi\ *)
    1.51  		# Wireless connections settings
    1.52  		xhtml_header
    1.53