This topic is locked

"Single login" for ver 6.0 with userlevel access & session

9/10/2009 05:58:04
ASPRunnerPro General questions
M
manan author

At the Tips & Tricks section, the provided scripts work like a charm:
if Request.ServerVariables("LOGON_USER")<>"" then

SESSION("UserID") = Request.ServerVariables("LOGON_USER")

SESSION("AccessLevel") = ACCESS_LEVEL_USER

Response.Redirect "..._list.asp"

end if

However, how do we give access rights to different level users? I discovered the Admin rights were removed for selected users.
Also, how do we load sessions variables such as:
Session("name") = rs("name")

Session("address") = rs("address")
when we use these scripts?
Please help.
Thank you.

Sergey Kornilov admin 9/10/2009

The code sample you mentioned does very basic job assigning Session("UserID").
Here is an example of more advanced method: http://www.asprunner.com/forums/index.php?/topic/12711-how-to-autologin-passing-username-and-password-via-url/
In other words, to populate session variables you need to run a SQL query that retrieves data from login table.



sql = "select * from LoginTable where UsernameField='" & Session("UserID") & "'"

set rs=Server.CreateObject("ADODB.Recordset")

rs.open sql, conn

Session("name") = rs("name")

Session("address") = rs("address")

rs.close : set rs=nothing