This project is read-only.


Community Server Extensions is as collection of unrelated bug fixes and behaviors that can be individually applied to a CS instance.
All features will be described individually.
Before adding any feature you must unzip package release and copy assembly NunoGomes.CommunityServer.dll to CS bin folder.


The implementation details aren't yet available but will be soon.
The Captcha is added to the page by configuring 4 ControlAdapters:
  • One for the ContactFormcontrol
  • Another for the WeblogPostCommentForm
  • Another for the CreateUserForm
  • And the last one for the OpenIdCreateUserSubForm
They can be applied individually but I recommend them to be used together.
Here is the configuration snipet that should be added to App_Browsers\default.browser file:

      <!-- Adapter for the ContactForm control in order to add the Captcha and prevent SPAM comments -->
      <adapter controlType="CommunityServer.Blogs.Controls.ContactForm" adapterType="NunoGomes.CommunityServer.Blogs.Controls.ContactFormCaptchaAdapter, NunoGomes.CommunityServer" />
      <!-- Adapter for the WeblogPostCommentForm control in order to add the Captcha and prevent SPAM comments -->
      <adapter controlType="CommunityServer.Blogs.Controls.WeblogPostCommentForm" adapterType="NunoGomes.CommunityServer.Blogs.Controls.WeblogPostCommentFormCaptchaAdapter, NunoGomes.CommunityServer" />
      <!-- Adapter for the CreateUserForm control in order to add the Captcha and prevent new SPAM user accounts -->
      <adapter controlType="CommunityServer.Controls.CreateUserForm" adapterType="NunoGomes.CommunityServer.Controls.CreateUserFormCaptchaAdapter, NunoGomes.CommunityServer" />
      <!-- Adapter for the OpenIdCreateUserSubForm control in order to add the Captcha and prevent new SPAM user accounts -->
      <adapter controlType="CommunityServer.Controls.OpenIdCreateUserSubForm" adapterType="NunoGomes.CommunityServer.Controls.OpenIdCreateUserSubFormCaptchaAdapter, NunoGomes.CommunityServer" />

To make the Captcha fully functional you must choose a CaptchaProvider. Currently there only 2 providers available:
  • The SimpleCaptchaProvider - This is a Captcha provider that uses a simple captcha algorithm.
  • The RecaptchaProvider - a Captcha provider that the free ReCaptcha service

Configuring the Captcha Provider

A specific configuration section exists to configure the Captcha provider and must be added to the web.config. Here are the configSections snippet:
    <!-- New section for Captcha providers configuration -->
    <section name="communityServer.Captcha" type="NunoGomes.CommunityServer.Captcha.Configuration.CaptchaSection" />

The SimpleCaptchaProvider

This provider adds an extra Control to the ControlAdapter original control and stores the ciphered Captcha numeric challenge in is ControlState.
The Captcha challenge image is generated and provided in a specific HttpHandler.
Here are the configuration snippets that should be added to the web.config file:
  <!-- Configuring a simple Captcha provider -->
  <communityServer.Captcha defaultProvider="simpleCaptcha">
      <add name="simpleCaptcha" type="NunoGomes.CommunityServer.Captcha.Providers.SimpleCaptchaProvider, NunoGomes.CommunityServer"

      <!-- The Captcha Image handler used by the simple Captcha provider -->
      <add verb="GET" path="captcha.ashx" type="NunoGomes.CommunityServer.Captcha.Providers.SimpleCaptchaProviderImageHandler, NunoGomes.CommunityServer" />

    <handlers accessPolicy="Read, Write, Script, Execute">
      <!-- The Captcha Image handler used by the simple Captcha provider -->
      <add verb="GET" name="captcha" path="captcha.ashx" type="NunoGomes.CommunityServer.Captcha.Providers.SimpleCaptchaProviderImageHandler, NunoGomes.CommunityServer" />

The RecaptchaProvider

In order to use this provider you must:
  • Unzip package release and copy assembly NunoGomes.CommunityServer.Recaptcha.dll to CS bin folder.
  • Create an account at ReCaptcha, then you must register your domain to get the public and private keys.
Once you got the keys pair use the following snippet in the web.config file:
  <communityServer.Captcha defaultProvider="recaptcha">
      <add name="recaptcha" type="NunoGomes.CommunityServer.Recaptcha.RecaptchaProvider, NunoGomes.CommunityServer.Recaptcha"

  • The Recaptcha ASP.NET plugin appears not to support multiple instances within the same page.
  • You must download the ReCaptcha ASP.NET plugin and copy assembly Recaptcha.dll to CS bin folder.
  • This provider was tested against Recaptcha API version and

Last edited Oct 18, 2010 at 2:13 PM by nmgomes, version 14


No comments yet.