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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationDisplayName instead of FirstName???DisplayName instead of FirstName???
Previous
 
Next
New Post
7/31/2006 7:47 AM
 
Thanks to your help, i tryed to implement your solution, so i copy your code i dbo.addUser :

....

IF @UserID is null
    BEGIN
        INSERT INTO Users (
            Username,
            FirstName,
            LastName,
            AffiliateId,
            IsSuperUser,
            Email,
            DisplayName,
            UpdatePassword
          )
        VALUES (
            @Username,
            @FirstName,
            @LastName,
            @AffiliateId,
            @IsSuperUser,
            @Email,
            @DisplayName,
            @UpdatePassword
        )

        SELECT @UserID = SCOPE_IDENTITY()
    END

IF ( @DisplayName is null OR @DisplayName = '' )
    BEGIN
        SET @DisplayName = @FirstName + ' ' + @LastName
    END

...

My problem is it doesn't work, or not really. I explain myself

When a new user log on the intranet, it create a user on mmy DB but without the field Display name, after i have to unauthorized the user, and then only, the display name fill itself

Is it a normal work ?



 
New Post
7/31/2006 5:03 PM
 

cfrancois wrote
Thanks to your help, i tryed to implement your solution, so i copy your code i dbo.addUser :

cfransois,

The IF statement should be before the INSERT or UPDATE statement in the procedure, so that @DisplayName is set before database is being updated. I suggest putting it at the top, as the first statement in the stored procedure.

Cheers,
Lev.

 
New Post
8/14/2006 12:02 PM
 
Lev Gimelfarb wrote

Darren,

Same issue, installed DotNetNuke last week and got upset from a thought that I would need to manually update Display Names for all users in the company (although 60, not 200!). Being a lazy guy, I always search for easier solutions ...

I have analyzed the current source code, and the only way I could fix the issue is by hacking the database stored procedure.  But in the end it works perfectly! Modify the dbo.AddUser stored procedure, and check if the @DisplayName parameter is empty, then make it @Firstname + ' ' + @Lastname:

IF ( @DisplayName is null OR @DisplayName = '' )
BEGIN
   SET @DisplayName = @FirstName + ' ' + @LastName
END

More so, apparently our AD did not have email addresses properly entered for all users. So I put a hack into the stored procedure to infer the email, if it's emtpy. But you don't have such a problem.

The only downside, is that this fix might be overwritten by SQL scripts if dotnetnuke installation is ever upgraded. By that time I am hoping proper fix will be available, though.

Hope this helps (until official fix is posted).

Cheers,
Lev.

 

Hi Lev,

I tried this in my database and it isn't working at all. I'm not getting any name fields at all in my user table. I'm only getting the AD userid.

Here's what my dbo.adduser stored proc looks like:

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

ALTER PROCEDURE [dbo].[AddUser]

@PortalID int,

@Username nvarchar(100),

@FirstName nvarchar(50),

@LastName nvarchar(50),

@AffiliateId int,

@IsSuperUser bit,

@Email nvarchar(256),

@DisplayName nvarchar(100),

@UpdatePassword bit,

@Authorised bit

AS

DECLARE @UserID int

SELECT @UserID = UserID

FROM Users

WHERE Username = @Username

IF ( @DisplayName is null OR @DisplayName = ' ' )

BEGIN

SET @DisplayName = @FirstName + ' ' + @LastName

END

IF @UserID is null

BEGIN

INSERT INTO Users (

Username,

FirstName,

LastName,

AffiliateId,

IsSuperUser,

Email,

DisplayName,

UpdatePassword

)

VALUES (

@Username,

@FirstName,

@LastName,

@AffiliateId,

@IsSuperUser,

@Email,

@DisplayName,

@UpdatePassword

)

SELECT @UserID = SCOPE_IDENTITY()

END

IF @IsSuperUser = 0

BEGIN

IF not exists ( SELECT 1 FROM UserPortals WHERE UserID = @UserID AND PortalID = @PortalID )

BEGIN

INSERT INTO UserPortals (

UserID,

PortalID,

Authorised

)

VALUES (

@UserID,

@PortalID,

@Authorised

)

END

END

SELECT @UserID

My setup is SQL 2000 (MSDE)

DotNetNuke 4.3.4 source

Win2k Server

Any ideas?

Thanks,

David

 
New Post
8/17/2006 11:10 PM
 
catsnak wrote

Hi Lev,

I tried this in my database and it isn't working at all. I'm not getting any name fields at all in my user table. I'm only getting the AD userid.

...

Any ideas?

Thanks,

David

David,

If you are not getting FirstName and LastName passed to stored procedure at all, then it means they cannot be retrieved from AD. Several scenarios when this can happen:

  1. DotNetNuke cannot access AD and uses failback mechanism (see DotNetNuke.Authentication.ADSIProvider source). But in this case it makes up FirstName and LastName based on the NTLM username.
  2. Expected fields are not received from AD. Check that "givenName" and "sn" exist for the user entry in AD. Can use any LDAP browser. (e.g. http://www.topshareware.com/LDAP-Browser-download-41756.htm).

Hope this helps

Lev

 
New Post
8/30/2006 11:04 AM
 
Lev Gimelfarb wrote

David,

If you are not getting FirstName and LastName passed to stored procedure at all, then it means they cannot be retrieved from AD. Several scenarios when this can happen:

  1. DotNetNuke cannot access AD and uses failback mechanism (see DotNetNuke.Authentication.ADSIProvider source). But in this case it makes up FirstName and LastName based on the NTLM username.
  2. Expected fields are not received from AD. Check that "givenName" and "sn" exist for the user entry in AD. Can use any LDAP browser. (e.g. http://www.topshareware.com/LDAP-Browser-download-41756.htm).

Hope this helps

Lev

 

Lev,

Thanks for the info. I downloaded the LDAP browser and we were able to access AD. So I atleast know now that the server running DNN can access AD and we were able to verify that the givenName and sn fields were there and filled in properly. This leads me to believe that your first scenario is the problem and for some reason DNN itself can't access AD. Any ideas on what could be causing this and how to fix it? I'm also still getting the error that windows authentication is unavailable when ever I try to set it up through DNN and we've tried everything. Right now it's in a partial working state even though DNN says it's not available, users are getting auto logged in but we have to go into the database and fill in the name information. We also have another odd issue where one user keeps getting logged in as the server admin instead of himself. I'm starting to think somewhere along the line I borked something even though this is a fresh install and we haven't made any modifications to any of the code other then following the steps laid out here in the forums for trying to get windows auth working.

At this point I'm at a complete loss!

David

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationDisplayName instead of FirstName???DisplayName instead of FirstName???


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