CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Authenticating Active Dir User

Print topic Send  topic

Author Message
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
View profile  Send private message
Heitor
Posted: 01/14/2005, 8:12 AM

Thank man i'll try and get back to you
Heitor

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.