📄 changepw.asp
字号:
<!--#include file="passinc.asp" -->
<%
userid = trim(request("id"))
if IsNumeric(userid) = true then
userid = CInt(userid)
else
response.redirect "noadmin.asp"
end if
gourl = trim(request("gourl"))
Set em = Application("em")
em.GetUserByIndex2 userid, name, domain, comment, forbid, lasttime, amode
comment = NULL
forbid = NULL
lasttime = NULL
if isadmin() = false then
if name = Application("em_SystemAdmin") then
set em = nothing
domain = NULL
name = NULL
amode = NULL
response.redirect "noadmin.asp"
end if
dim ed
set ed = server.createobject("easymail.domain")
ed.Load
dim wem_user
wem_user = Session("wem")
if ed.GetUserManagerDomainCount(wem_user) < 1 then
set ed = nothing
set em = nothing
domain = NULL
name = NULL
amode = NULL
response.redirect "noadmin.asp"
end if
i = 0
allnum = ed.GetUserManagerDomainCount(wem_user)
dim isok
isok = false
do while i < allnum
cdomainstr = ed.GetUserManagerDomain(wem_user, i)
if cdomainstr = domain then
isok = true
end if
cdomainstr = NULL
i = i + 1
loop
set ed = nothing
if isok = false then
set em = nothing
domain = NULL
name = NULL
amode = NULL
response.redirect "noadmin.asp"
end if
end if
'-----------------------------------------
dim mam
set mam = server.createobject("easymail.AdminManager")
mam.Load
Enable_DAdminAllotSize = mam.Enable_DAdminAllotSize
set mam = nothing
if trim(request("onlychangesize")) = "1" and (isadmin() = true or Enable_DAdminAllotSize = true) then
uSize = trim(request("uSize"))
if trim(request("changeSize")) <> "" and IsNumeric(uSize) then
em.SetMailBoxSize name, CLng(uSize)
end if
set em = nothing
domain = NULL
name = NULL
amode = NULL
Response.Redirect "ok.asp?" & getGRSN() & "&gourl=" & Server.URLEncode(gourl)
elseif trim(request("onlychangesize")) = "2" then
accessmode = trim(request("accessmode"))
if IsNumeric(accessmode) = true then
if amode <> CInt(accessmode) then
em.SetAccessMode name, CInt(accessmode)
end if
end if
set em = nothing
domain = NULL
name = NULL
amode = NULL
Response.Redirect "ok.asp?" & getGRSN() & "&gourl=" & Server.URLEncode(gourl)
end if
pw = trim(request("pw1"))
if pw <> "" then
em.ChangeUserPassWord name, pw
set em = nothing
domain = NULL
name = NULL
amode = NULL
Response.Redirect "ok.asp?" & getGRSN() & "&gourl=" & Server.URLEncode(gourl)
end if
%>
<html>
<head>
<title>Edit</title>
<LINK href="images\hwem.css" rel=stylesheet>
</head>
<SCRIPT LANGUAGE=javascript>
<!--
function modifyAccess()
{
form1.onlychangesize.value = "2";
form1.submit();
}
function changeAccess_onclick() {
if (form1.accessmode.disabled == true)
{
form1.btaccesschange.disabled = false;
form1.accessmode.disabled = false;
}
else
{
form1.btaccesschange.disabled = true;
form1.accessmode.disabled = true;
}
}
function modifySize()
{
form1.onlychangesize.value = "1";
form1.submit();
}
function changeSize_onclick() {
if (form1.uSize.disabled == true)
{
form1.btchange.disabled = false;
form1.uSize.disabled = false;
}
else
{
form1.btchange.disabled = true;
form1.uSize.disabled = true;
}
}
function checkpw(){
if (form1.pw1.value != "" && form1.pw2.value != "")
{
if (form1.pw1.value != form1.pw2.value)
alert("Your new password entries did not match.");
else
form1.submit();
}
}
//-->
</script>
<body>
<br>
<br>
<div align="center">
<form name="form1" method="post" action="changepw.asp">
<input type="hidden" name="onlychangesize">
<input type="hidden" name="gourl" value="<%=gourl %>">
<input type="hidden" name="id" value="<%=trim(request("id")) %>">
<table width="80%" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF">
<tr bgcolor="#dbeaf5">
<td colspan="2" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-top:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>
<%
if isadmin() = false then
%>
<div align="center">Account: <font color="#FF3333"><%=name %></font> Password Modification</div>
<% else %>
<div align="center">Password Modification</div>
<% end if %>
</td>
</tr>
<tr>
<td width="40%" height="25" style='border-bottom:1px #8CA5B5 solid;'>
<div align="center">New Password:</div>
</td>
<td width="60%" style='border-bottom:1px #8CA5B5 solid;'>
<input type="password" name="pw1" maxlength="32" size="40" class="textbox">
</td>
</tr>
<tr>
<td height="25" style='border-bottom:1px #8CA5B5 solid;'>
<div align="center">Re-enter New Password:</div>
</td>
<td style='border-bottom:1px #8CA5B5 solid;'>
<input type="password" name="pw2" maxlength="32" size="40" class="textbox">
</td>
</tr>
<tr>
<td colspan="2" align="right"><br>
<input type="button" value="Submit" onclick="checkpw()" class="Bsbttn">
<input type="button" value="Cancel" onclick="javascript:history.back();" class="Bsbttn">
</td>
</tr>
</table>
<br><br><br>
<table width="80%" border="0" align="center" cellspacing="0" style="border-top:1px #8CA5B5 solid;">
<%
if isadmin() = true or Enable_DAdminAllotSize = true then
%>
<tr>
<td width="62%" bgcolor="#EFF7FF" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;">
<table><tr><td width="90%"><input type="checkbox" name="changeSize" LANGUAGE=javascript onclick="return changeSize_onclick()"><label style="width: 200">User mailbox size modification </label>
<input type="text" name="uSize" value="<%=em.GetMailBoxSize(name) %>" maxlength="9" class="textbox" disabled> K
</td><td><input type="button" id="btchange" value="Submit" onclick="modifySize()" class="Bsbttn" disabled>
</td></tr></table></td>
</tr>
<%
end if
%>
<tr>
<td width="62%" bgcolor="#EFF7FF" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;">
<table><tr><td width="90%"><input type="checkbox" name="changeAccess" LANGUAGE=javascript onclick="return changeAccess_onclick()"><label style="width: 200">User access mode modification </label>
<select name="accessmode" class=drpdwn size="1" disabled>
<%
anum = 0
if wem_user <> name then
do while anum < 7
if amode = anum then
response.write "<option value=""" & anum & """ selected>" & getaccessmode(anum) & "</option>"
else
response.write "<option value=""" & anum & """>" & getaccessmode(anum) & "</option>"
end if
anum = anum + 1
loop
else
do while anum < 7
if anum <> 1 and anum <> 5 and anum <> 6 then
if amode = anum then
response.write "<option value=""" & anum & """ selected>" & getaccessmode(anum) & "</option>"
else
response.write "<option value=""" & anum & """>" & getaccessmode(anum) & "</option>"
end if
end if
anum = anum + 1
loop
end if
%>
</select>
</td><td><input type="button" id="btaccesschange" value="Submit" onclick="modifyAccess()" class="Bsbttn" disabled>
</td></tr></table></td>
</tr>
</table>
</form>
</div>
<br><br><br>
<div align="center">
<table width="80%" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" style='border-top:1px #8CA5B5 solid;'>
<tr>
<td colspan="2" height="10">
</td>
</tr>
<tr>
<td width="8%" valign="top"><font color="#FF3333"> *Note: </font></td>
<td width="92%">Modes of visiting (can be combined):
<br>
Http: allows users to visit WebMail through browsers.
<br>
Smtp: allows user to visit mailboxes through smtp protocol.
<br>
Pop: allows user to visit mailboxes through pop protocol.
</td>
</tr>
<tr>
<td colspan="2" height="10">
</td>
</tr>
</table>
</div>
</body>
</html>
<%
set em = nothing
domain = NULL
name = NULL
amode = NULL
function getaccessmode(amode)
if amode = 0 then
getaccessmode = "http/smtp/pop"
elseif amode = 1 then
getaccessmode = "smtp/pop"
elseif amode = 2 then
getaccessmode = "http/smtp"
elseif amode = 3 then
getaccessmode = "http/pop"
elseif amode = 4 then
getaccessmode = "http"
elseif amode = 5 then
getaccessmode = "smtp"
elseif amode = 6 then
getaccessmode = "pop"
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -