beer-monkey.com
|
Posted: 01/29/2002, 5:14 AM |
|
I have quite a complicated problem so i'll try and give as much detail as possible. I have 4 seperate administration menus, one for each division of our company - each administration should only be accessed by certain users based upon a security id, the security id is division_id + country_id (called 'division_country') - (e.g. 0102 would be industrial/united kingdom)
So what i will require is a login box where the user enters 'user_name' and 'password', which then redirects that user based upon their unique 'division_country' value?
I think this would be beyond the standard security feature in CC, any help would be most appreciated
|
|
|
Ken Hardwick
|
Posted: 01/29/2002, 5:29 AM |
|
In a ASP application, I had a similar situation...and did the following in my custom login event.
Mine was based on user's business category..so did a lookup and set
session("CAT_ID") to the value returned. Then did a redirect based on that session value.
if bPassed > 0 then
'-------------------------------
' Login and password passed
'-------------------------------
Session("UserID") = sLogin
Session("UserRights") = CLng(DLookUp("KMG_WEB_LOGON", "VIEW_ACCESS", "LOGON_ID =" & ToSQL(sLogin, "Text") & " and PASSWORD=" & ToSQL(sPassword, "Text")))
session("CAT_ID") = DLookUp("KMG_WEB_ACCESS", "CATEGORY_ID", "LOGON_ID =" & ToSQL(Session("USERID"), "Text") & " and APP_CODE = " & ToSQL("PEP", "Text"))
cn.Close
Set cn = Nothing
'if not(sPage = request.serverVariables("SCRIPT_NAME")) and not(isEmpty(sPage)) then
' response.redirect(sPage & "?" & sQueryString)
'end if
if session("CAT_ID") = "RPTTO" then
' KMGV_EMP_IN_POS
'sRedirect = "ReportsTo.asp?TO_POSITION_ID=" & session("TO_POSITION_ID")
response.redirect("ReportsTo.asp")
else
session("CAT_ID") = "NOTRPTTO"
session("TO_POSITION_ID") = ""
response.redirect("BunIDs.asp")
end if
else
sFormErr = "Login or Password is incorrect."
end if
'-------------------------------
|
|
|
Neil Munro
|
Posted: 01/29/2002, 6:32 AM |
|
The mechanism is covered in the CC help (Login Form Events) which has an example custom login based on standard security level in PHP. This should be easy to modify to look up your security id and set the session var "UserRights", which you can then use to filter/direct as required.
|
|
|
|