tazpanel rev 69

Fix query_string_parser used from a form (&)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 12 02:55:40 2011 +0200 (2011-04-12)
parents af9601acec8f
children 1938c9c0603b
files hardware.cgi lib/libtazpanel
line diff
     1.1 --- a/hardware.cgi	Tue Apr 12 00:47:59 2011 +0200
     1.2 +++ b/hardware.cgi	Tue Apr 12 02:55:40 2011 +0200
     1.3 @@ -27,13 +27,19 @@
     1.4  case "$QUERY_STRING" in
     1.5  	print*)
     1.6  		echo "TODO" ;;
     1.7 -	modules|modinfo=*)
     1.8 +	modules*|modinfo=*)
     1.9  		query_string_parser
    1.10  		xhtml_header
    1.11  		cat << EOT
    1.12  <div id="wrapper">
    1.13  	<h2>`gettext "Kernel modules"`</h2>
    1.14 -	<p>`gettext "Manage and get info about the Linux kernel modules`</p>
    1.15 +<div class="float-right">
    1.16 +	<form method="get" action="$SCRIPT_NAME">
    1.17 +		<input type="hidden" name="modules" />
    1.18 +		<input type="text" name="search" />
    1.19 +	</form>
    1.20 +</div>
    1.21 +	<p>`gettext "Manage, search or get info on the Linux kernel modules`</p>
    1.22  </div>
    1.23  EOT
    1.24  		# Request may be modinfo output that we want in the page itself
     2.1 --- a/lib/libtazpanel	Tue Apr 12 00:47:59 2011 +0200
     2.2 +++ b/lib/libtazpanel	Tue Apr 12 02:55:40 2011 +0200
     2.3 @@ -24,6 +24,7 @@
     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  	for var in $(echo "$QUERY_STRING" | sed s'@=@ @'g)
     2.9  	do
    2.10  		id=$((id + 1))
    2.11 @@ -34,6 +35,7 @@
    2.12  			'4') VAR_2=${var% } ;;
    2.13  		esac
    2.14  	done
    2.15 +	unset IFS
    2.16  }
    2.17  
    2.18  # LOG activities
    2.19 @@ -99,7 +101,7 @@
    2.20  xhtml_header() {
    2.21  	cat ${PANEL}$HEADER | sed s/'- %TITLE%'/"$TITLE"/
    2.22  	if [ $DEBUG == "1" ]; then
    2.23 -		echo "<div class='debug'>$REQUEST_METHOD ${QUERY_STRING}</div>"
    2.24 +		echo "<div class='debug'>$CASE $WANT $REQUEST_METHOD ${QUERY_STRING}</div>"
    2.25  	fi
    2.26  }
    2.27