al_3asel
05-09-2004, 06:27 AM
hi all
I created a user database but I need a code to determine the admin user for this web because the admin can see some additional features among the web whereas the others don't
thanks
buntine
05-09-2004, 06:37 AM
What method are you using to temporarily store the users details once they have logged in?
I will assume your using Session variables.
All you need to do is store the users ID number in your session and then each time you need to gain additional data (such as his/her admin status), you extract the required data from the table using a where clause, like so.
rs.open("SELECT security_level FROM tableName WHERE id = " & CInt(Session("userid")))
In your database, you shouold store the users admin rights. This way, you can run an if statement to determine whether or not the additional features should be enabled.
' 3 = Admin.
' 2 = Senior member.
' 1 = Regular member.
if rs("security_level") = 3 then
'|Statement sequence..
end if
Try to limit the amount of data you store in session variables. You should only need one Session for each user, and you should keep a very small amount of data in each one.
Regards,
Andrew Buntine.
PeOfEo
05-09-2004, 11:59 AM
it would work about the same way with a cookie too. Same principles.