?? login.asp
字號:
<%@language="VBScript" codepage="936"%>
<!--#include file="function.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
Randomize
chk=Int((9999 - 1000 + 1) * Rnd + 1000)
session("chk")=chk
'-----------------
if session("goindex") then
response.redirect("index.asp")
end if
'-----------------
if session("adminlogin")<>"" then
title="管理員管理"
else
title="登錄"
end if
%>
<html>
<head>
<title><%=title%>--<%=name%>--[By BrightStar]</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Meta Name="description" Content="BS在線文件管理系統">
<Meta Name="Keywords" Content="BS在線文件管理系統">
<meta http-equiv="pragma" content="no-cache">
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="">
<!--
function adminlogin(action){
switch (action){
case "login" :
{obj=document.login;
obj.action="chk.asp?type="+action;
if(!obj.admin.value||obj.admin.value.length<5) {alert("管理員不可為空也不能少于5個字符!");return;}
if(!obj.pwd.value||obj.pwd.value.length<5) {alert("密碼不可為空也不能少于5個字符!");return;}
if(obj.chk.value!=<%=chk%>) {alert("驗證碼不正確!");return;}
window.showModalDialog(obj.action+"&admin="+obj.admin.value+"&pwd="+obj.pwd.value+"&chk="+obj.chk.value,"","dialogWidth:280px;dialogHeight:150px;scroll:no;status:no;help:no");
window.location.reload();}
break;//---------
case "adminlogin" :
{obj=document.login;
obj.action="chk.asp?type=login";
if(!obj.admin.value||obj.admin.value.length<5) {alert("管理員不可為空也不能少于5個字符!");return;}
if(!obj.pwd.value||obj.pwd.value.length<5) {alert("密碼不可為空也不能少于5個字符!");return;}
if(obj.chk.value!=<%=chk%>) {alert("驗證碼不正確!");return;}
window.showModalDialog(obj.action+"&admin="+obj.admin.value+"&pwd="+obj.pwd.value+"&chk="+obj.chk.value+"&goindex=1","","dialogWidth:280px;dialogHeight:150px;scroll:no;status:no;help:no");
window.location.reload();}
break;//---------
<%
if session("adminlogin") <> "" then
set rs=CreateObject("ADODB.Recordset")
if session("admin") and session("adminlogin") <> "" then
rs.open "select * from admin", conn,3,3
else
rs.open "select * from admin where admin='"&session("adminlogin")&"'", conn,3,3
end if
if not rs.eof then
i = 1
while not rs.eof
%>
case "gotoupdate<%=i%>" :
{var super<%=i%>=0;
obj=document.gotoupdate<%=i%>;
obj.action="chk.asp?type=modify";
if(!obj.admin.value||obj.admin.value.length<5) {alert("管理員不可為空也不能少于5個字符!");return;}
if(!obj.pwd.value) {if(!confirm("不修改密碼嗎?"))return;}
if(obj.pwd.value&&obj.pwd.value.length<5) {alert("密碼長度應大于5個字符!");return;}
if(!obj.dir.value||obj.dir.value.length<2) {alert("請設置權限目錄!");return;}
<% if session("admin") then %>
if(obj.super_v.checked) super<%=i%>=1;else super<%=i%>=0;
<% end if %>
//請設置權限目錄!
window.showModalDialog(obj.action+"&admin="+obj.admin.value+"&pwd="+obj.pwd.value+"&dir="+obj.dir.value+"&super1="+super<%=i%>,"","dialogWidth:280px;dialogHeight:150px;scroll:no;status:no;help:no");
window.location.reload();}
break;//---------
<% rs.movenext
i = i + 1
wend
end if
rs.close()
set rs=nothing
end if
%>
<% if session("adminlogin") <> "" then %>
case "addordel" :
{var super1
obj=document.addordel;
obj.action="chk.asp?type="+obj.aord_v.value;
if(!obj.aord_v.value) {alert("請選擇操作!");return;}
if(!obj.admin.value||obj.admin.value.length<5) {alert("管理員不可為空也不能少于5個字符!");return;}
if(obj.aord_v.value=="add"){
if(!obj.pwd.value||obj.pwd.value.length<5) {alert("密碼不可為空也不能少于5個字符!");return;}
if(!obj.dir.value||obj.dir.value.length<2) {alert("請設置權限目錄!");return;}
if(obj.super_v.checked) super1=1;else super1=0;
window.showModalDialog(obj.action+"&admin="+obj.admin.value+"&pwd="+obj.pwd.value+"&dir="+obj.dir.value+"&super1="+super1,"","dialogWidth:280px;dialogHeight:150px;scroll:no;status:no;help:no");
window.location.reload();}
else {
window.showModalDialog(obj.action+"&admin="+obj.admin.value,"是誰?","dialogWidth:280px;dialogHeight:150px;scroll:no;status:no;help:no");
window.location.reload();}
}
break;//---------
<% end if %>
}//end switch
}//end function
//-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<br>
<% if session("adminlogin")="" then %>
<br>
<table width="390" align="center" cellpadding="2" cellspacing="0" class="table" style="border: 1 solid #000000">
<form action="" method="post" name="login">
<tr>
<td colspan="2" align="center" bgcolor="#CCCCCC" style="font: 10.5pt;border-bottom: 1 solid #000000;">請登錄</td>
</tr>
<tr bgcolor="#eeeeee">
<td height="5" colspan="2"></td>
</tr>
<tr bgcolor="#eeeeee">
<td width="100" align="center"> </td>
<td width="290">管理員:
<input name="admin" type="text" id="admin" value="" size="15" maxlength="20">
</td>
</tr>
<tr bgcolor="#eeeeee">
<td align="center"> </td>
<td>密 碼:
<input name="pwd" type="password" id="pwd" value="" size="15" maxlength="20">
</td>
</tr>
<tr bgcolor="#eeeeee">
<td align="center"> </td>
<td>驗證碼:
<input name="chk" type="text" id="chk" size="7" maxlength="4">
【<%=chk%>】</td>
</tr>
<tr bgcolor="#eeeeee">
<td height="5" colspan="2"></td>
</tr>
<tr bgcolor="#CfCfCf">
<td align="center" style="border-top: 1 solid #000000"> </td>
<td style="border-top: 1 solid #000000"> <input onclick="javascript: adminlogin('login');" class="button" type="button" name="Submit" value="登錄系統">
<input onclick="javascript:adminlogin('adminlogin');" class="button" type="button" name="Submit2" value="文件管理">
</td>
</tr>
</form>
</table>
<% else %>
<%
set rs=CreateObject("ADODB.Recordset")
if session("admin") then
rs.open "select * from admin order by date_add desc", conn,3,3
else
rs.open "select * from admin where admin='"&session("adminlogin")&"' order by date_add desc", conn,3,3
end if
if not rs.eof then
%>
<table width="758" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="border: 1 solid #000000" width="57" align="center"><a href="logout.asp?logout=1">退出管理</a></td>
<td width="28" align="center"> </td>
<td width="57" align="center" style="border: 1 solid #000000"><a href="index.asp">文件管理</a></td>
<td align="center"><b><font size="4">[<%=name%>]</font></b><font color="#ccaacc">-version:<%=version%></font> </td>
</tr>
</table>
<br>
<table width="758" align="center" cellpadding="2" cellspacing="0" class="table" style="border: 1 solid #000000">
<tr>
<td align="center" bgcolor="#CCCCCC" style="font: 10.5pt;border-bottom: 1 solid #000000;">管理員操作</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<% i = 1
while not rs.eof
%>
<tr><form action="" method="post" name="gotoupdate<%=i%>">
<td>管 理 員:
<input name="admin" type="text" disabled id="admin22" value="<%=rs("admin")%>" size="15" maxlength="20">
密碼:
<input name="pwd" type="password" id="pwd22" value="" size="15" maxlength="20" title="修改管理員權限目錄時,若密碼域留空則不更新密碼!">
<% if session("admin") then %>
是否超級管理員:
<% if rs("super") and lcase(rs("admin")) <> lcase(session("adminlogin"))then %>
<input name="super_v" type="checkbox" onClick="javascript:alert('請慎重此項操作!');" id="super_v" style="border: 0 solid #ffffff;" value="1" checked>[選中為是]
<% else %>
<input name="super_v" type="checkbox" onClick="javascript:alert('請慎重此項操作!');" id="super_v" style="border: 0 solid #ffffff;" value="1"<% if lcase(rs("admin")) = lcase(session("adminlogin")) then %> checked disabled<% end if %>>[選中為是]
<% end if %>
<% end if %>
<br>
權限目錄:
<input name="dir" <% if not session("admin") then response.write("disabled") end if %> value="<%=rs("dir")%>" type="text" id="dir" title="1.如果權限目錄為多個,請用“|”分隔! 2.非超級管理員無修改此目錄的權限! 3.超級管理員此權限目錄第一個有效目錄為登錄默認目錄!" size="80">
<input class="button" onClick="javascript:adminlogin('gotoupdate<%=i%>');" type="button" name="Submit4" value="更新">
</td></form>
</tr>
<% rs.movenext
i = i + 1
wend
end if
rs.close()
set rs=nothing
set conn=nothing
%>
<% if session("admin") then %>
<tr>
<td height="1" bgcolor="#000000"></td>
</tr>
<tr>
<td height="4" bgcolor="#eeeeee"></td>
</tr>
<tr><form action="" method="post" name="addordel">
<td bgcolor="#eeeeee"> 管 理 員:
<input name="admin" type="text" id="admin" value="" size="15" maxlength="20">
密碼:
<input name="pwd" type="text" id="pwd25" value="" size="15" maxlength="20">
設為超級管理員:
<input name="super_v" style="border: 0 solid #ffffff;" type="checkbox" id="super_v" value="1">
執行操作:
<input type="radio" style="border: 0 solid #ffffff;" name="aord" value="add" onClick="javascript:document.addordel.aord_v.value = this.value;">添加
<input type="radio" style="border: 0 solid #ffffff;" name="aord" value="del" onClick="javascript:if(confirm('確認執行刪除管理員操作嗎?\t'))document.addordel.aord_v.value = this.value; else return false;">刪除
<input name="aord_v" type="hidden" id="aord_v"><br>
權限目錄:
<input name="dir" type="text" id="dir" title="如果權限目錄為多個,請用“|”分隔!" size="80">
<input class="button" type="button" onClick="javascript:adminlogin('addordel');" name="Submit3" value="執行">
</td></form>
</tr>
<% end if %>
<tr>
<td height="5" bgcolor="#eeeeee"></td>
</tr>
<tr bgcolor="#CfCfCf">
<td style="border-top: 1 solid #000000"> </td>
</tr>
</table>
<table width="680" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td>注意:<font color=red>如果有時操作結果錯誤,請清空瀏覽器緩存!</font>本系統所在目錄為:<font color=red><%=Request.ServerVariables("APPL_PHYSICAL_PATH")%></font>,請注意權限目錄的設置!</td>
</tr>
</table>
<%
end if
%>
<br><center><%=copyright%></center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -