Extending user properties..

Posted by Community Admin on 05-Aug-2018 16:36

Extending user properties..

All Replies

Posted by Community Admin on 08-Oct-2010 00:00

Have the need to extend user properties/profiles for front end users.  For example adding a customer account number or other custom user properties that can be accessed at runtime to display custom pricing, etc inside of pages.  Is there a way to extend the built-in provider to store this additional information, or should I consider going with a custom provider?
Are there any examples of this in 4.x basically showing how to add properties, and then gain access to them at runtime?

Posted by Community Admin on 10-Oct-2010 00:00

Hello Bobby,

You could get/set property values by using ProfileManager class

ProfileManager profileManager = ProfileManager.GetManager();
var profileUser = profileManager.CreateProfile(user);
profileManager.SaveChanges();
 
var prof = profileManager.GetProfiles().Where(p => p.User.UserName == "newUser1").SingleOrDefault();
var getField = prof.GetValue("somefield");
prof.SetValue("someField", "someValue");
profileManager.SaveChanges();

The profile provider is declared inside App_Data\Sitefinity\Configuration\SecurityConfig.config from where you can change its properties. Another option is using backend UI - Sitefinity/Administration/Settings/Security/Profile Providers

Currently there is an issue with adding custom profile properties. I will update the status of the post  with more details once the issue has been resolved.

Sincerely yours,
Ivan Dimitrov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 19-Jan-2011 00:00

Hi

How does one add additional fiedls to the profile in the first palce?

Many Thanks

Regards

Posted by Community Admin on 19-Jan-2011 00:00

Hello John01,

You can do this only programmatically as the code above shows.

All the best,
Ivan Dimitrov
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 23-Feb-2011 00:00

Hi,

it gives design time error.

'Telerik.Sitefinity.Security.Model.Profile' does not contain a definition for 'SetValue' and no extension method 'SetValue' accepting a first argument of type 'Telerik.Sitefinity.Security.Model.Profile' could be found (are you missing a using directive or an assembly reference?)

Thanks
Johar Iqbal


Posted by Community Admin on 23-Feb-2011 00:00

Hello,

Please check whether you have a reference to Telerik.Sitefinity.dll. Also you should have reference to Telerik.Sitefinity.Model.DataExtensions


Best wishes,
Ivan Dimitrov
the Telerik team

Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

Posted by Community Admin on 08-Mar-2011 00:00

Hello,

I'm trying to add a custom properties to profiles and have started out based on information I found in this post, then found some additional information here which seems like it might be helpful but before I do any further debugging I'd like to know for sure if adding custom properties in this matter is actually supported at this time and that it won't cause any problems with any future releases.   It sounds here like profiles may not be fully implemented yet.   If it just comes down with not having a UI at this time I'm ok with doing everything I need programmatically, just don't want to duplicate my efforts down the line.

Thanks!

Posted by Community Admin on 14-Mar-2011 00:00

Hello,

User profiles will be changed for Q1 release and we will provide advanced options for profile management.  I would recommend you to wait for it, if your deadlines allow it, because  The code that Ivan Dimitrov posted in a previous post should work, but might cause problems after upgrade to Q1 release, since we changed the API.


Greetings,
Lyubomir Dokov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

Posted by Community Admin on 20-Apr-2011 00:00

Could you provide some details around this post release of Q1.  I have created custom profile types in the UI but wondering how to access these properties from within the SDK.

Cheers,
Matt

Posted by Community Admin on 21-Apr-2011 00:00

Seconded. Trying to do the same thing as Matt.

Posted by Community Admin on 25-Apr-2011 00:00

Hi ,

You need to use SitefinityProfile object

http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/retrieving-custom-profile-fields.aspx

http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/how-to-set-avatar-in-user-profile.aspx

Profiles API has been changed with Sitefinity 4.1( Q1) release.

Kind regards,
Ivan Dimitrov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

This thread is closed