<% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% If Not IsLoggedIn And Request.Cookies(ewProjectName)("autologin") = "autologin" And Request.Cookies(ewProjectName)("password") <> "" Then Response.Redirect "login.asp" Call LoadUserLevel() If IsLoggedIn Then ewCurSec = CurrentUserLevelPriv("Usuarios") Else ewCurSec = GetAnonymousPriv("Usuarios") End If If (ewCurSec And ewAllowView) <> ewAllowView Then Response.Redirect "Usuarioslist.asp" %> <% ' Initialize common variables x_usuario = Null: ox_usuario = Null: z_usuario = Null x_password = Null: ox_password = Null: z_password = Null x_UserLevelID = Null: ox_UserLevelID = Null: z_UserLevelID = Null %> <% Response.Buffer = True x_usuario = Request.QueryString("usuario") If x_usuario = "" Or IsNull(x_usuario) Then Response.Redirect "Usuarioslist.asp" ' Get action sAction = Request.Form("a_view") If sAction = "" Or IsNull(sAction) Then sAction = "I" ' Display with input box End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "I": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session(ewSessionMessage) = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "Usuarioslist.asp" End If End Select %>

View TABLE: Usuarios

Back to List  <% If (ewCurSec And ewAllowEdit) = ewAllowEdit Then %> ">Edit  <% End If %> <% If (ewCurSec And ewAllowAdd) = ewAllowAdd Then %> ">Copy  <% End If %> <% If (ewCurSec And ewAllowDelete) = ewAllowDelete Then %> ">Delete  <% End If %>

usuario <% Response.Write x_usuario %>
password <% Response.Write x_password %>
User Level ID <% If (ewCurSec And ewAllowAdmin) = ewAllowAdmin Then ' System admin %> <% Select Case x_UserLevelID Case "-1" sTmp = "Administrator" Case "0" sTmp = "Anonymous" Case "1" sTmp = "dataentry" Case "2" sTmp = "user" Case Else sTmp = Null End Select ox_UserLevelID = x_UserLevelID ' Backup Original Value x_UserLevelID = sTmp %> <% Response.Write x_UserLevelID %> <% x_UserLevelID = ox_UserLevelID ' Restore Original Value %> <% Else %> ******** <% End If %>

<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim rs, sSql, sFilter sFilter = ewSqlKeyWhere sFilter = Replace(sFilter, "@usuario", AdjustSql(x_usuario)) ' Replace key value sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sFilter, "") Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadData = False Else LoadData = True rs.MoveFirst ' Get the field contents x_usuario = rs("usuario") x_password = rs("password") x_UserLevelID = rs("UserLevelID") End If rs.Close Set rs = Nothing End Function %>