#!/bin/sh
#This script is created by ssparser automatically. The parser first created by MaoShouyan
printf "Content-type: text/html
Cache-Control: no-cache

"
echo -n "";
. ../common/common.sh 
myself="/cgi-bin/Maintain/`basename $0`"

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script language=\"javascript\">
function kickoff(loginfile)
{
	if (confirm(\"ȷҪǿ?\"))
		window.location.href = \"${myself}?action=kickoff&loginfile=\" + loginfile;
}
</script>
<body>
";
if [ "${CGI_action}" = "kickoff" ]; then
	operator_check "${myself}"
	rm -f /usr/ramdisk/weblogin/${CGI_loginfile}
	afm_dialog_msg "ɹ!"
fi

echo -n "
"; cgi_show_title "־->û" 
echo -n "
<br>
<table width=700 border=0 cellspacing=1 cellpadding=1>
<tr id=tblhdr height=22>
	<td width=125 align=center>û</td>
	<td width=125 align=center>¼ַ</td>
	<td width=160 align=center>½ʱ</td>
	<td width=160 align=center></td>
	<td width=* align=center></td>
</tr>
";
cd /usr/ramdisk/weblogin
STAT=/usr/ramdisk/bin/stat
filelist=`ls palogin_*`
thisuser="palogin_${HTTP_COOKIE##*palogin_}"
if [ "$?" = "0" ]; then
	tblid="row1"
	for loginfile in ${filelist}
	do
		. /usr/ramdisk/weblogin/${loginfile}

echo -n "
		<tr id=${tblid}>
		<td align=center>${user}</td>
		<td align=center>${ip}</td>
		<td align=center>${logintime}</td>
		<td align=center>`${STAT} -f %Sm -t \"%Y.%m.%d/%H:%M:%S\" /usr/ramdisk/weblogin/${loginfile}`</td>
		"; if [ "${thisuser}" != "${loginfile}" ]; then 
echo -n "
		<td align=center><a style=\"color:#0000ff\" href=\"javascript:kickoff('${loginfile}')\">ǿ</a></td>
		"; else 
echo -n "
		<td align=center>ǿ</td>
		"; fi 
echo -n "
		</tr>
";
		if [ "${tblid}" = "row1" ]; then
			tblid="row2"
		else
			tblid="row1"
		fi
	done
fi
cd -

echo -n "
</table>
</body>
</html>
";