Heitor Miguel
|
Posted: 10/29/2004, 4:03 AM |
|
I need help to
Manage user profiles on applications using Active Dir User and windows Authentication on CodeCharge
|
|
|
DayMatrix
Posts: 4
|
Posted: 12/07/2004, 8:58 AM |
|
Here's a piece of code I stuck in the Login page to make it bypass the CodeCharge login if there was a validated windows login....
'Page Event BeforeShow. Action Custom Code @9-73254650
' -------------------------
' Write your own code here.
' -------------------------
'Autologin if possible
'Build the windows user name
Dim CurrentUser as String = Web.HttpContext.Current.User.Identity.Name.ToString()
If InStr(CurrentUser,"IUSR") Then
'They are not logged in as a specific user load the login form
Else
'Need to split the CurrentUser at the \
Dim myIndex as Integer = CurrentUser.IndexOf("\")
CurrentUser = CurrentUser.Remove(0,myIndex + 1)
Dim myUserPassword as String = Settings.conSQLDataAccessObject.ExecuteScalar("SELECT UserPassword FROM Personnel WHERE UserName='"& CurrentUser & "'").ToString
If DBUtility.CheckUser(CurrentUser, myUserPassword) Then
If Not(HttpContext.Current.Request("ret_link") is Nothing) Then
If Not(HttpContext.Current.Request("ret_link")="") Then
Response.Redirect(HttpContext.Current.Request("ret_link"))
End If
End If
End If
End If
'End Page Event BeforeShow. Action Custom Code
Your mileage may vary.
_________________
Day Matrix
Member
Netfishbowl, LLC.
http://www.netfishbowl.com |
|
|
Heitor
|
Posted: 01/14/2005, 8:12 AM |
|
Thank man i'll try and get back to you
Heitor
|
|
|
|