Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Retrieving the LOGON_USER variableRetrieving the LOGON_USER variable
Previous
 
Next
New Post
4/21/2007 2:12 AM
 

 I need the LOGON_USER information for a module I'm creating on my intranet to run a query. I am not successful. Page.User.Identity.Name.ToString() does not work for me. Any guidance would be greatly appreciated. I am using Michael Washington's AlternateDAL to gain access to an external table and the code below is not working for me.

Dim myParam As SqlParameter = New SqlParameter("@samAccountName", SqlDbType.NChar, 75)
myParam.Value =
"Home\paskettj"                               >>>this WORKS
myParam.Value = Page.User.Identity.Name.ToString()   >>>this does NOT work
GetUser(SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure,
"Select_User_By_SAM", myParam))

Thanks in advance for help. <JP>

 
New Post
4/21/2007 9:33 AM
 

Is the problem with the DAL+ or is the problem getting the proper value (the LOGON_USER) to pass to the stored procedure? You indicate you have a method that works. Why is this insufficient?



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
4/21/2007 9:42 AM
 

Hi Michael,

I believe the problem is getting the proper value to the stored procedure. As far as having a method that works, it is hard coded to pass my credentials to test whether the sproc is actually doing the job, and it is.

 
New Post
4/21/2007 9:51 AM
 

I believe that if you run this in debug and examine the value passed when it works you will be surprised that it's not "Home\paskettj"  

I don't know for sure however.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
4/21/2007 9:59 AM
 

When I try this code:

Page.User.Identity.Name.ToString()

while logged into my DotNetNuke site it is set to "FormsIdentity" and returns just "Host" if I'm logged in as Host.

- Page.User.Identity {System.Web.Security.FormsIdentity} System.Security.Principal.IIdentity
+ System.Web.Security.FormsIdentity {System.Web.Security.FormsIdentity} System.Web.Security.FormsIdentity
AuthenticationType "Forms" String
IsAuthenticated True Boolean
Name "host" String

So perhaps that is the problem, you're getting forms authendication when you want to get Windows Authendication?



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Retrieving the LOGON_USER variableRetrieving the LOGON_USER variable


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out