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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN 4.8 Update User Profile Properties?DNN 4.8 Update User Profile Properties?
Previous
 
Next
New Post
1/23/2008 11:37 AM
 

I am attempting to update a custom profile property in a custom module I am building.

How do I call the stored procedure 'UpdateUserProfileProperty' from a class in the library via a class such as UserController?

I saw an example here: (http://www.dotnetnuke.com/Products/Development/Projects/ModuleXML/Forums/tabid/963/forumid/111/threadid/58226/scope/posts/threadpage/3/Default.aspx)

where it is suggested that I could use the following code:

Dim objUser As UserInfo = UserController.GetCurrentUserInfo()
objUser.Profile.SetProfileProperty(
"propertyname", "propertyvalue")
UserController.UpdateUser(PortalSettings.PortalId, objUser)

But the UpdateUser method does ot update the UserProfile table.

Any suggestions please?

 

 

NEVER MIND. I figured it out... seems like half the time I figure stuff out AFTER I place a post, even though I wracked my brain beforehand...

 

Anyway, in case it's useful to someone else, I did the following

Imports DotNetNuke.Entities.Profile

and then in your method

ProfileController.UpdateUserProfile(objUser)

 
New Post
2/4/2008 1:21 PM
 

I have the same problem, and I tried using the same code you did - using ProfileController.UpdateUserProfile, but still can't get the profile to update.   Can anyone see what I'm doing wrong here? 

 

                'Create the saleman DNN UserInfo object and hydrate it
                Dim slsmanUserInfo As New UserInfo


                'Populate the salesman DotNetNuke UserInfo object and save it
                With slsmanUserInfo
                    .DisplayName = Name.Text
                    .Email = Email.Text
                    .FirstName = Split(Name.Text, " ")(0)
                    .LastName = Split(Name.Text, " ")(1)
                    .PortalID = PortalId
                    .Username = UserID.Text
                    .Membership.Password = Password.Text
                End With

                'Create the salesman, update the salesmanID and add the user to the Dealer role
                Dim UserSatus As Integer = UserController.CreateUser(slsmanUserInfo)
               

                'Add the SalesmanID
                slsmanUserInfo.Profile.SetProfileProperty("SalesmanID", salesman.SalesmanID)
                'Update the slsman User
                ProfileController.UpdateUserProfile(slsmanUserInfo)

 
New Post
5/16/2008 12:08 PM
 

I had same problem upgrading a module from dnn 4.4.1 to 4.8.2

My solution:

when u create a new user you have toi call:

dnnNewUser.Profile.InitialiseProfile(portalId, true); (no need of this in 4.4.1)

before setting custom propertie by:

dnnNewUser.Profile.SetProfileProperty(propname,propvalue)

 

Paolo.

 
New Post
6/21/2008 9:15 AM
 

I've been scouting around and I can't seem to find a solution to a simlar issue. 

I am working on building and automated user import.   My problem is that if a user already exist then I need to update the user.  Is there a function I can call that will update the users information if they are already defined in the User Table???

The code I am using is:

                

Public Shared Function CreateUser(ByRef NewUser As DotNetNuke.Entities.Users.UserInfo, ByVal PortalID As Integer) As DotNetNuke.Security.Membership.UserCreateStatus' Add New User to Portal User Database

 

 

 

 

 

objUserInfo = UserController.GetUserByName(PortalID, NewUser.Username,

 

 

Dim objSecurity As New DotNetNuke.Security.PortalSecurityDim objModules As New ModuleControllerDim UserController As DotNetNuke.Entities.Users.UserControllerDim objUserInfo As DotNetNuke.Entities.Users.UserInfoDim objNewUser As New DotNetNuke.Entities.Users.UserInfoFalse)Dim userCreateStatus As DotNetNuke.Security.Membership.UserCreateStatus = DotNetNuke.Security.Membership.UserCreateStatus.AddUser'if a user is found with that username, error.

 

'this prevents you from adding a username

 

'with the same name as a superuser.

 

If Not objUserInfo Is Nothing Then

 

'username already exists in DB so update the user and show user an error
CreateUser = DotNetNuke.Security.Membership.UserCreateStatus.UsernameAlreadyExists
Exit Function

 

End If

objNewUser.PortalID = NewUser.PortalID
objNewUser.FirstName = NewUser.Profile.FirstName
objNewUser.LastName = NewUser.Profile.LastName
objNewUser.Email = NewUser.Email
objNewUser.Username = NewUser.Username
objNewUser.Membership.Password = NewUser.Membership.Password
objNewUser.Membership.Approved = NewUser.Membership.Approved
objNewUser.AffiliateID = DotNetNuke.Common.Utilities.Null.NullInteger
objNewUser.Membership.Approved = NewUser.Membership.Approved
objNewUser.AffiliateID = DotNetNuke.Common.Utilities.Null.NullInteger

 

 

 

'initialize the profile
objNewUser.Profile.InitialiseProfile(NewUser.PortalID)
objNewUser.Profile.SetProfileProperty("Unit", NewUser.Profile.Unit)
objNewUser.Profile.SetProfileProperty("Street", NewUser.Profile.Street)
objNewUser.Profile.SetProfileProperty("City", NewUser.Profile.City)
objNewUser.Profile.SetProfileProperty("Region", NewUser.Profile.Region)
objNewUser.Profile.SetProfileProperty("PostalCode", NewUser.Profile.PostalCode)
objNewUser.Profile.SetProfileProperty("Country", NewUser.Profile.Country)
objNewUser.Profile.Telephone = NewUser.Profile.Telephone
objNewUser.Profile.SetProfileProperty("Cell", NewUser.Profile.Cell)
objNewUser.Profile.SetProfileProperty("Fax", NewUser.Profile.Fax)
objNewUser.Profile.SetProfileProperty("IM", NewUser.Profile.IM)
objNewUser.Profile.Website = NewUser.Profile.Website
objNewUser.Profile.PreferredLocale = NewUser.Profile.PreferredLocale
'Return create status
CreateUser = UserController.CreateUser(objNewUser)End Function

 

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN 4.8 Update User Profile Properties?DNN 4.8 Update User Profile Properties?


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