#!/bin/sh #------------------------------------------------------------------------------ # index.cgi - startfile for the web administration # # Creation: 12.08.2005 hh # Last Update: $Id$ # #------------------------------------------------------------------------------ # get main helper functions . /srv/www/include/cgi-helper . /etc/rc.d/bootmsg-filter-common case $FORM_action in logout) case "x$FORM_time" in x) echo "Location: $myname?action=logout&time=`date +%s`" echo ;; *) ta=`date +%s` td=`expr $ta - $FORM_time` # only send 401 if time difference between logout request and entered password is less or equal 3 seconds case $td in 0|1|2|3) echo 'Status: 401 Unauthorized' echo 'WWW-Authenticate: Basic realm="admin"' echo ;; *) echo "Location: $myname" echo ;; esac ;; esac ;; delbootmsg) rm -f /bootmsg.txt reload ;; *) case x$FORM_link in x) show_html_header "$_MN_welc" cat <<-EOF
EOF if [ -f /bootmsg.txt ] then regex="$(httpd_get_bootmsg_regex)" data="$(grep -v "$regex" /bootmsg.txt)" if [ -n "$data" ] then show_error "There are messages in /bootmsg.txt (click to delete)" "
`echo "$data" | htmlspecialchars`" echo "
" fi fi ;; *) show_html_header echo "" ;; esac show_html_footer ;; esac