Jon from Proactive Logic » Blog Archive » Extending Community Se. Note: The pdf version of this post has been removed since I cleaned up the code formatting below.
This post will go over my notes on how I accomplished extending the CS schema and code base in order to: acquire additional user fields on user registration, enable modification of these fields in the user control panel, display the new fields in the public view of the user’s profile, and display the new fields for the user in forum posts. This post should be useful for developers that want to extend their CS schema and also contains content relevant for users just sticking with extended attributes (for example extending a theme with SubForms is useful for both scenarios). I have just started digging into Community Server 2007 as a pet project of mine. One thing that I wanted to do was link Community Server users with a set of tables that I already have in place.
The first thing I did was to install the Community Server 2007 SDK and install the CS schema as per their directions. Read. How to add 2 existing profile fields to new user registration fo. Community Server 2007: Extend user profile to add Twitter accoun. Community Server 2007: Extend user profile to add Twitter account and auto-tweet Jan 29 2009 As I posted recently, I’ve learned how to extend Community Server’s user profile fields to add additional ones for storing a Twitter account data and auto-posting when publishing new content.
In this post I will show you how to do it, but first of all I want to thank Jon for his fantastic post about how to extend user profiles. It avoided me a lot of work searching for what and where to change :) Database modifications Modify the table cs_users, and add two text fields for the account username and password (remember to make them nullable!) Modify the stored procedure cs_user_CreateUpdateDelete: · Add two new arguments: @TwitterUsername nvarchar (60) = null,@TwitterPassword nvarchar (60) = null, · And modify the INSERT INTO cs_Users and UPDATE cs_Users to include the two new arguments. Integrating Membership, Roles and Profile providers in your ASP.
My goal in this short piece is to provide an example of how to pull them all together.
We'll use the standard Membership Provider for authentication, the standard Role provider for Authorization, and we'll add a completely custom Profile example to show how custom user Profile data can be stored on a per-user basis, even for anonymous users, and then automatically migrated to their full User profile when they actually "sign up" on your site. You can set this up with any SQL Server database you want, including either a new or existing one. Plus, I'll include a SQL Script that will show you how to install Membership, Role and Profile required database information on a hosted site, and even an ASP.NET "SetupASPNETDatabase.aspx" page that does all this programmatically - something many developers aren't even aware exists.
The first thing we want to do before we even open the sample solution is to enable our database for the providers. There are actually three separate ways you can do this: