#!/bin/sh

# disable filename globbing
echo Content-type: text/html
echo

BASE=`pwd`
APPLDIR=$BASE/appl
DATADIR=$BASE/data
PATH=$PATH:$BASE/ihd/bin:.
stt=`echo $HTTP_USER_AGENT | awk ' { print index($0,"Firefox") } ' `

if [ $stt = 0 ]
then
echo "<br>"
echo "<br>"
echo "<br>"
echo "<br>"
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SOLO SE PERMITE NAVEGADOR FIREFOX"
exit
fi

export PATH APPLDIR DATADIR
ZONA=`./appl/sh/usuar|awk -v a=$REMOTE_USER -F"^" 'index($3,a){print substr($4,1,3);exit}' -`
NIV=`./appl/sh/usuar|awk -v a=$REMOTE_USER -F"^" 'index($3,a){print $11;exit}' -`
#echo  RU=$REMOTE_USER Z=$ZONA N=$NIV
awk ' BEGIN {
print "<html>"
print "<head>"
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">"
print "<meta name=\"GENERATOR\" content=\"Inhedo 4gt 1.0\">"
print "<meta name=\"ProgId\" content=\"Inhedo Form Generator\">"
printf "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=https://tm.inhedo.com/Acceso%d\">\n","'"$NIV"'"
print "</head>"
print "</body>"
print "</head>"
} '
