#!/bin/sh
set -f

echo Content-type: text/html
echo
BASE=`pwd`
APPLDIR=$BASE/appl
DATADIR=$BASE/data
PATH=$PATH:$BASE/ihd/bin:.
export PATH APPLDIR DATADIR

x=$REMOTE_USER
x=miguel.mondaca

usuar=./tmp/usuar
./appl/sh/usuar | egrep $x | awk -F^ ' {

# |  1 H00 correl 03 15   0 | 2 H01 codigo 12 07   3 | 3 H02 identi 40 00  15 |
# |  4 H03 passwo 20 00  55 | 5 H04 nombre 40 00  75 | 6 H05 correo 40 00 115 |
# |  7 H06 telefo 50 00 155 | 8 H07 especi 02 00 205 | 9 H08 status 02 52 207 |

print "<html>"
print "<head>"
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
print "<meta name=\"GENERATOR\" content=\"Inhedo 4gt 1.0\">"
print "<meta name=\"ProgId\" content=\"Inhedo Form Generator\">"
print "</head>"
print "<body> "
print "</body>"
print "<script language=\"Javascript\">"
print "window.opener.document.prodsform.USER.value=\""$1"\""
//print "alert(window.opener.document.prodsform.USER.value)"

print "self.close()"
print "</script>"

print "	"
print "</html>"
} ' 
