<%=Application("WebTitle")%>-UserMgr.asp
<%
GetUserRole Request.QueryString("username"), Request.QueryString("password"), "UserMgr.asp"
if Session("UserRole") < 2 then
Session("ErrorMsg") = "Sorry,you are common user and haven't authority of administrator!"
Response.Redirect("Error.asp")
end if
dim KVWebUserManager
if Request.QueryString("opt") = "Add" then
set KVWebUserManager = Server.CreateObject("KVWebSvr.UserManager")
if not KVWebUserManager is Nothing then
if KVWebUserManager.AddUser(Request.QueryString("name"), Request.QueryString("pwd"), Request.QueryString("desc"), Request.QueryString("role")) = 0 then
set KVWebUserManager = Nothing
Session("ErrorMsg") = "Sorry,Fail to add user!Please check network configuration,or contact administrator."
Response.Redirect("Error.asp")
end if
set KVWebUserManager = Nothing
end if
ElseIf Request.QueryString("opt") = "Del" then
set KVWebUserManager = Server.CreateObject("KVWebSvr.UserManager")
if not KVWebUserManager is Nothing then
if KVWebUserManager.DeleteUser(Request.QueryString("name")) = 0 then
set KVWebUserManager = Nothing
Session("ErrorMsg") = "Sorry,Fail to delete user!Please check network configuration,or contact administrator."
Response.Redirect("Error.asp")
end if
set KVWebUserManager = Nothing
end if
end if
%>