<% M_UAdd = fun_chkRight("Staff","E") M_LAdd = fun_chkRight("Login","E") if M_UAdd = 0 and M_LAdd = 0 then %> <% response.end end if%> <% Function selectedVal(oriVal,dataVal) if Trim(oriVal) <> "" and Trim(dataVal) <> "" Then if cstr(oriVal) = cstr(dataVal) Then selectedVal = "selected" else selectedVal = "" end if else selectedVal = "" end if End Function Function checkedVal(oriVal,dataVal) if Trim(oriVal) <> "" and Trim(dataVal) <> "" Then if cstr(oriVal) = cstr(dataVal) Then checkedVal = "checked" else checkedVal = "" end if else checkedVal = "" end if End Function Function checkedInstrVal(oriVal,dataVal) if Trim(oriVal) <> "" and Trim(dataVal) <> "" Then if instr(oriVal,dataVal) > 0 Then checkedInstrVal = "checked" else checkedInstrVal = "" end if else checkedInstrVal = "" end if End Function userId = Trim(Request("userId")) DB_loginId = "" DB_linkNm = "" DB_rights = "" DB_userType = "SU" DB_active = "Y" if userId = "" or isNumeric(userId) = False Then Response.Redirect "userL.asp" Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select userId, userFnm, userLnm, notes, display from users where userId = " & userId rs.Open strSQL, con, 3, 3 if not rs.EOF Then userArr = rs.GetRows() end if rs.Close if userId <> "" Then strSQL = "select rightId, linkNm, rights from rights where display = 'Y' order by linkNm" rs.Open strSQL, con, 3, 3 if not rs.EOF Then rightsArr = rs.GetRows() end if rs.close strSQL = "select loginId, login, pasword, linkNm, rights, tableNm, colNm, recordId, userType, active from admin where tableNm = 'users' and recordId = " & userId rs.Open strSQL, con, 3, 3 if not rs.EOF Then loginArr = rs.GetRows() DB_loginId = Trim(loginArr(0,0)) DB_linkNm = Trim(loginArr(3,0)) DB_rights = Trim(loginArr(4,0)) DB_userType = Trim(loginArr(8,0)) DB_active = Trim(loginArr(9,0)) tmplinkNmArr = split(Trim(loginArr(3,0)),",") tmprightsArr = split(Trim(loginArr(4,0)),"|") end if rs.Close end if set rs = nothing con.Close set con = nothing %> <% if M_LAdd = 1 Then %> <% if isEmpty(loginArr) = False Then %> <% else %> <% end if%> <% if isEmpty(rightsArr) = False Then %> <% end if %> <% else %> <% end if %>
Edit User
First Name * Last Name *
Notes
Display >Yes    >No
Login Detail
Login <%=loginArr(1,0)%> Password
Login Password
Active > Yes > No User Type > Webmaster > System User
Rights <% Msg = "" for i=0 To UBound(rightsArr,2) tempArr = split(rightsArr(2,i),",") if rightsArr(1,i) = "Webmaster" Then Msg = "
(If User Type is Webmaster then select 'Y')" if DB_loginId = "" or instr(DB_linkNm,Trim(rightsArr(1,i))) = 0 Then %> <% else %> <% end if next %>
<%=rightsArr(1,i)%> <%=Msg%> <% for m=0 To UBound(tempArr) %> <%=tempArr(m)%>   <% next %>
<%=rightsArr(1,i)%> <%=Msg%> <% idAt = "" for l=0 To UBound(tmplinkNmArr) if tmplinkNmArr(l) = Trim(rightsArr(1,i)) Then idAt = l end if next for m=0 To UBound(tempArr) %> ><%=tempArr(m)%>   <% next %>