tazpanel rev 71

lib/libtazpanel: this time fix query_string_parser to handle all case in TazPanel
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 12 01:22:50 2011 +0200 (2011-04-12)
parents 1938c9c0603b
children 26455264ec32
files hardware.cgi lib/libtazpanel
line diff
     1.1 --- a/hardware.cgi	Tue Apr 12 03:09:51 2011 +0200
     1.2 +++ b/hardware.cgi	Tue Apr 12 01:22:50 2011 +0200
     1.3 @@ -43,16 +43,22 @@
     1.4  </div>
     1.5  EOT
     1.6  		# Request may be modinfo output that we want in the page itself
     1.7 -		case "$QUERY_STRING" in
     1.8 +		case "$CASE" in
     1.9  			modinfo=*)
    1.10  				mod=${QUERY_STRING#modinfo=}
    1.11 -				gettext "Detailed information for module:"; echo " $mod"
    1.12 +				gettext "Detailed information for module: "; echo "$mod"
    1.13  				echo '<pre>'
    1.14  				modinfo $mod
    1.15  				echo '</pre>' ;;
    1.16  			rmmod=*)
    1.17  				mod=${QUERY_STRING#rmmod=}
    1.18  				modprobe -r $mod ;;
    1.19 +			search=*)
    1.20 +				mod=${QUERY_STRING#search=}
    1.21 +				gettext "Matching result(s) for: "; echo "$mod"
    1.22 +				echo '<pre>'
    1.23 +				modprobe -l | grep "$mod"
    1.24 +				echo '</pre>' ;;
    1.25  		esac
    1.26  		cat << EOT
    1.27  	`table_start`
     2.1 --- a/lib/libtazpanel	Tue Apr 12 03:09:51 2011 +0200
     2.2 +++ b/lib/libtazpanel	Tue Apr 12 01:22:50 2011 +0200
     2.3 @@ -24,10 +24,11 @@
     2.4  # we use that to help get URL string variables and user names
     2.5  query_string_parser() {
     2.6  	id=0
     2.7 -	IFS="&"
     2.8 +	#IFS="&"
     2.9  	for var in $(echo "$QUERY_STRING" | sed s'@=@ @'g)
    2.10  	do
    2.11  		id=$((id + 1))
    2.12 +		var=${var#&}
    2.13  		case "$id" in
    2.14  			'1') CASE=${var% } ;;
    2.15  			'2') WANT=${var% } ;;
    2.16 @@ -35,7 +36,7 @@
    2.17  			'4') VAR_2=${var% } ;;
    2.18  		esac
    2.19  	done
    2.20 -	unset IFS
    2.21 +	#unset IFS
    2.22  }
    2.23  
    2.24  # LOG activities