#!/oracle/app/oracle/product/7.3.3/bin/oraperl

##### set Oracle's variables #####
$ENV{'ORACLE_HOME'}='/oracle/app/oracle/product/7.3.3';
$ENV{'ORACLE_SID'}='rabbit';
$orauser="vod";
$orapass="vod";

#### set web server address ####
$WSA = "http://clarissa.npac.syr.edu/vod";
$PROJDIR="/project/K136/VOD";



$pass = 'boston';

$input=<>;
#chop $input;

### split the input line ###
@param = split(/\&/, $input );

foreach (@param)
{
    ##### for URL decoding ######
    ### convert plus to space ###
    $_ =~ s/\+/ /g;
    ### convert %XX from hex numbers to alphanumeric ###
    $_ =~ s/%(..)/pack("c", hex($1))/ge;

    $passwd    = $1 if /password=(.*)/;
}


if ( $passwd eq $pass )
{
print "Content-type: text/html\n\n ";
print <<"EndOfHTML";
  <html>
  <head>
  <title>VSAM Title Frame</title>
  </head>
  <body bgcolor="teal" link="white" vlink="white">
  <center>
  <h2> <font color="darkred">Video Server Asset Management</font></h2>
  <form>
  <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0>
  <TD ALIGN=CENTER>
  <font color="darkred" size="+1">
  <INPUT TYPE="button" VALUE="Video Clips" NAME="butt1"
   onClick="top.frames[2].location='$WSA/cgi-bin/selectcoll'; 
            top.frames[1].location='$WSA/clipsman.html'">
  </TD>
  <TD ALIGN=CENTER>
  <font color="darkred" size="+1">
  <INPUT TYPE="button" VALUE="Video Archives" NAME="butt2"
   onClick="top.frames[2].location='$WSA/cgi-bin/listcoll'; 
            top.frames[1].location='$WSA/collman.html'">
  </TD>
  <TD ALIGN=CENTER>
  <font color="darkred" size="+1">
  <INPUT TYPE="button" VALUE="Video Servers" NAME="butt3"
   onClick="top.frames[2].location='$WSA/cgi-bin/listserver'; 
            top.frames[1].location='$WSA/servman.html'">
  </TD>
  <TD ALIGN=CENTER>
  <font color="darkred" size="+1">
  <INPUT TYPE="button" VALUE="Search Interface" NAME="butt4"
   onClick="top.frames[2].location='$WSA/cgi-bin/vnsqueryform'; 
            top.frames[1].location='$WSA/empty1.html'">
  </TD>
  <TR>
  </font>
  </TABLE>
  </center>
  </form>
  </body>
  </html>
EndOfHTML
}
else 
{
print "Content-type: text/html\n\n ";
  print <<"EndOfHTML";
  <html>
  <head>
  <title>VSAM Title Frame</title>
  </head>
  <body bgcolor="red" link="white" vlink="white">
  <center>
    <p>
    <H3>Authorization failed !!! </H3>
    <a href="$WSA/cgi-bin/vnsqueryform" target="browser">
    <font size=6><b>You still can access our video clip collection!</font></a>
    </body>
    </html>
EndOfHTML
}



