#!/bin/sh
#------------------------------------------------------------------------------
# support.cgi - give the user some support-infos
#
# Creation: 24.02.2001 tg
# Last Update: $Id$
#
#------------------------------------------------------------------------------
# get main helper functions
. /srv/www/include/cgi-helper
tmpfile=/tmp/support.txt
head ()
{
show_tab_header "$1" no
echo "
"
}
foot ()
{
echo "
"
show_tab_footer
echo "
"
}
cmd ()
{
if [ 0$# -gt 2 ]
then
command=$3
else
command=$2
fi
if [ "$FORM_action" = "$1" ]
then
tabs="$tabs'$1' 'no' "
else
tabs="$tabs'$1' '$myname?section=show&action=`url_encode $1`' "
fi
echo "$1:$command:eval $2 | htmlspecialchars" >> $tmpfile
}
: ${FORM_section:=view}
case $FORM_section in
view) SEC_ACTION='view' ;;
*) SEC_ACTION='systeminfo' ;;
esac
# Security
check_rights "support" "$SEC_ACTION"
case $FORM_section in
show)
: ${FORM_action:="Liste aller Prozesse"}
> $tmpfile
tabs=
show_html_header "$_SUP_sinf"
show_backlink
echo "
"
. /usr/local/bin/support.inc
eval show_tab_header $tabs
doit=`grep "^$FORM_action:" $tmpfile | cut -d: -f3`
echo "
`grep "^$FORM_action:" $tmpfile | cut -d: -f2`
"
$doit
echo "
"
show_tab_footer
show_html_footer
;;
download)
http_header download "ctype=text/plain; filename=supportinfos.txt"
( . /usr/local/bin/support.sh )
sed "s/$/`echo -e \\\r`/" /tmp/support.txt
;;
*)
show_html_header "$_SUP_inf"
echo ''
echo ''
show_html_footer
;;
esac