tazpanel rev 56

Add a file view CASE so we can displa any file on the system (ex at boot.cgi with rcS.conf)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 10 20:20:19 2011 +0200 (2011-04-10)
parents eef817291804
children b542e1db674c
files boot.cgi index.cgi
line diff
     1.1 --- a/boot.cgi	Sun Apr 10 22:01:15 2011 +0200
     1.2 +++ b/boot.cgi	Sun Apr 10 20:20:19 2011 +0200
     1.3 @@ -149,6 +149,7 @@
     1.4  
     1.5  <div>
     1.6  	<a class="button" href="$SCRIPT_NAME?daemons">Manage daemons</a>
     1.7 +	Main configuration file: <a href="index.cgi?file=/etc/rcS.conf">rcS.conf</a>
     1.8  </div>
     1.9  
    1.10  <h3>`gettext "Kernel cmdline"`</h3>
     2.1 --- a/index.cgi	Sun Apr 10 22:01:15 2011 +0200
     2.2 +++ b/index.cgi	Sun Apr 10 20:20:19 2011 +0200
     2.3 @@ -12,6 +12,7 @@
     2.4  # Common functions from libtazpanel
     2.5  . lib/libtazpanel
     2.6  get_config
     2.7 +query_string_parser
     2.8  
     2.9  # Include gettext helper script.
    2.10  . /usr/bin/gettext.sh
    2.11 @@ -36,9 +37,18 @@
    2.12  #
    2.13  
    2.14  case "$QUERY_STRING" in
    2.15 +	file=*)
    2.16 +		#
    2.17 +		# Handle files (may have an edit function, will see)
    2.18 +		#
    2.19 +		TITLE="- File"
    2.20 +		xhtml_header
    2.21 +		echo "<h2>$WANT</h2>"
    2.22 +		echo '<pre>'
    2.23 +		cat $WANT
    2.24 +		echo '</pre>' ;;
    2.25  	debug*)
    2.26  		TITLE="- Debug"
    2.27 -		query_string_parser
    2.28  		xhtml_header
    2.29  		cat << EOT
    2.30  <h2>QUERY_STRING</h2>