Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  DNN 4.8 Update User Profile Properties?
Previous Previous
 
Next Next
New Post 1/23/2008 8:37 AM
Resolved
User is offline Tigris7
166 posts
9th Ranked


DNN 4.8 Update User Profile Properties? 
Modified By Tigris7  on 1/23/2008 11:54:08 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 10:21 AM
User is offline JM
3 posts
10th Ranked


Re: DNN 4.8 Update User Profile Properties? 

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 10:08 AM
User is offline PAOLO LABELLARTE
2 posts
10th Ranked


Re: DNN 4.8 Update User Profile Properties? 

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 7:15 AM
User is offline Wallaman
4 posts
10th Ranked


Re: DNN 4.8 Update User Profile Properties? 

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 Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  DNN 4.8 Update User Profile Properties?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions
Advanced Web Portals by Infoscaler
Infoscaler is a California based company that provides advanced Web Portals, E-commerce Sites, Database Applications and Intranet Solutions on the DotNetNuke and Microsoft.NET platforms.
www.infoscaler.com
DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP