#!/bin/sh

# /* ******** netUstad: Network Ustadi (Network Master) *********/
# /* This software is Copyright (C) 2004 by Ozkan KIRIK.        */
# /* Permission is granted to redistribute and modify this      */
# /* software under the terms of the GNU General Public License */
# /* available at http://www.gnu.org/                           */
# /**************************************************************/


cd $work_path
# ==================
# == Send Headers ==
# ==================

echo "Content-type: text/html&&" | $tr_cmd "&" "\n"
echo '<html>'
echo '<head>'
echo '	<title> netUstad </title>'
echo '  <META http-equiv="Content-Type" content="text/html; charset='`$gettext_cmd "charset"`'">'
echo '	<link rel="STYLESHEET" type="text/css" href="netustad.css">'
echo '</head>'
echo ''
echo '<body>'
echo '<table width=100% height=100% cellspacing=0 cellpadding=0 class=std>'
echo '<tr>'
echo '	<td class=std height=100><center><table width=600 height=100 cellspacing=0 cellpadding=0 class=std background="images/banner.png">'
echo '		<tr>'
echo '			<td class=std valign=bottom rowspan=2 align=right height=100 width=132><img src="images/buton_1.png" width="20" height="35" border="0"></td>'
echo '			<td class=std align=center height=65 width=232>&nbsp;</td>'
echo '			<td class=std valign=bottom rowspan=2 align=left height=100 width=236><img src="images/buton_3.png" width="20" height="35" border="0"></td>'
echo '		</tr>'
echo '		<tr>'
echo '			<td class=std id=hdr1 height=35 background=images/buton_2.png valign=middle>'`$gettext_cmd "login panel"`'</td>'
echo '		</tr>'
echo '	</table></center><br></td>'
echo '</tr>'
echo '<tr>'
echo '	<td class=std valign=middle>'
echo '		<table width=100% height=35 cellspacing=0 cellpadding=0 class=std>'
echo '			<tr>'
echo '				<td class=std align=right background=images/buton_0.png><img src="images/buton_1.png" height=35 width=20 align=absmiddle border=0></td>'
echo '				<td class=std id=hdr2 align=middle width=100 background=images/buton_2.png><img src="images/menu_login.png" height=30 width=30 align=absmiddle border=0><b>'`$gettext_cmd "Login"`'</b></td>'
echo '				<td class=std align=left background=images/buton_0.png><img src="images/buton_3.png" height=35 width=20 align=absmiddle border=0></td>'
echo '			</tr>'
echo '		</table>'
echo '		<table width=100% cellspacing=0 cellpadding=0 class=std bgcolor=#DBE0E4>'
echo '			<tr>'
echo '				<td class=std><br><center><form name=auth id=auth>'
echo '					<h5>'$auth_msg'</h5>'
echo '					<table width=250 cellspacing=3 cellpadding=3>'
echo '					<tr class=header>'
echo '						<td colspan=2 id=hdr2 style="color:black;"><center><b>'`$gettext_cmd "Please Enter Your<br>Username and Password"`'</b></center></td>'
echo '					</tr>'
echo '					<tr>'
echo '						<td class=header align=right width=80><b>'`$gettext_cmd "Username"`' :</b></td>'
echo '						<td><input name=username type=text id=username maxlength=31 style="width:130px"></td>'
echo '					</tr>'
echo '					<tr>'
echo '						<td class=header align=right width=80><b>'`$gettext_cmd "Password"`' :</b></td>'
echo '						<td><input name=password type=password id=password maxlength=31 style="width:130px"></td>'
echo '					</tr>'
echo '					<tr>'
echo '						<td class=header colspan=2 style="padding:4px 4px 4px 4px;"><center><input class=btn name=login type=submit id=login value="-: '`$gettext_cmd "Submit"`' :-" onClick="do_auth();return false;" style="width:150px"></center></td>'
echo '					</tr>'
echo '					</table>'
echo '				</form></center><br></td>'
echo '			</tr>'
echo '		</table>'
echo '		<table width=100% height=35 cellspacing=0 cellpadding=0 class=std>'
echo '			<tr>'
echo '				<td class=std align=right background=images/buton_4.png>&nbsp;</td>'
echo '			</tr>'
echo '		</table>'
echo '	</td>'
echo '</tr>'
echo '<tr>'
echo '	<td class=std height=60><br><center><table width=600 height=60 cellspacing=0 cellpadding=0 class=std background="images/banner-alt.png">'
echo '		<tr>'
echo '			<td class=std valign=top rowspan=2 align=right height=60><img src="images/buton_5.png" width="20" height="35" border="0"></td>'
echo '			<td class=std align=center height=35 background=images/buton_6.png>netUstad - '$netustadversion'</td>'
echo '			<td class=std valign=top rowspan=2 align=left height=60><img src="images/buton_7.png" width="20" height="35" border="0"></td>'
echo '		</tr>'
echo '		<tr>'
echo '			<td class=std height=25></td>'
echo '		</tr>'
echo '	</table></center></td>'
echo '</tr>'
echo '</table>'
echo ''
echo '<script language="javascript" type="text/javascript">'
echo 'function do_auth()'
echo '{'
echo ' window.location = "/auth?"+document.getElementById("username").value+":"+document.getElementById("password").value;'
echo '}'
echo '</script>'
echo '</body>'
echo '</html>'
