📄 admin.cgi
字号:
#!/perl/bin/perl
require "./setup.cgi";
use CGI;
$co=new CGI;
$action=$co->param('action');
$name=$co->param('name');
$key=$co->param('key');
unless ($action)
{
print $co->header(-charset=>'gb2312',-type=>'text/html');
print qq~
<html>
<head>
<title>站长管理</title>
<style>
<!--
body { line-height: 15px; font-size: 9pt }
td { line-height: 15px; font-size: 9pt }
a:visited { text-decoration:none }
a:link { text-decoration:none }
a:hover { text-decoration:underline }
-->
</style>
</head>
<body>
<script src=top.js></script>
<br>
<center>
<h2 align="center">站长管理</h2><br>
<form method="post" action="admin.cgi">
<input type=hidden name="action" value="master">
<table width="300" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#000000">
<tr bgcolor="#FFFFFF"><td>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr><td width="33%" align="right" height="30">用户名:</td>
<td width="67%"><input type="text" maxlength="30" name="name">
</td></tr><tr><td width="33%" align="right" height="30">密 码:</td>
<td width="67%"><input type="password" name="key" maxlength="30">
</td></tr>
</table></td></tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="31">
<input type="submit" value="确定">
<input type="reset" value="重写">
</td>
</tr>
</table>
</form>
</center>
<br>
<script src=buttom.js></script>
</body>
</html>
~;
exit;
}
if ($action eq "master") {&a_master;exit;}
if ($action eq "teacher") {&a_teacher;exit;}
&error ("未知错误,请联系管理员");
sub a_master
{
unless (($name eq $supername)&&($key eq $superkey)) {&error("你没有管理员的权限");}
$cookie1=$co->cookie(-name=>"name",-value=>"$name");
$cookie2=$co->cookie(-name=>"key",-value=>"$key");
print $co->header(-charset=>'gb2312',-type=>'text/html',-cookie=>[$cookie1,$cookie2]);
print qq~
<html>
<head><title>站长管理</title></head>
<body>
<center>
<br><br>
<a href=manage_html.cgi?object=student>管理会员</a><br><br>
<a href=manage_html.cgi?object=teacher>管理老师</a>
</center>
</body>
</html>
~;
}
sub a_teacher
{
unless (-e "$adminpath/$name.cgi") {&error("用户名不存在");}
open (f,"$adminpath/$name.cgi");
@t_data=<f>;
close f;
&del(@t_data);
unless (($key eq $t_data[0])&&($t_data[1])) {&error("密码错误或者帐号正在审核中,请等待开通");}
@t_kind=split(/=/,$t_data[1]); #统计老师所授课的分类,因为一个老师可以同时教授几门课
$cookie1=$co->cookie(-name=>"name",-value=>"$name");
$cookie2=$co->cookie(-name=>"key",-value=>"$key");
print $co->header(-charset=>'gb2312',-cookie=>[$cookie1,$cookie2]);
print qq~
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="0;url=seekind.cgi?kind=$t_kind[0]">
<title>正在转入相应页面</title>
</head>
</html>
~;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -