6.3.5024 captcha custom char set

Posted by Community Admin on 04-Aug-2018 12:29

6.3.5024 captcha custom char set

All Replies

Posted by Community Admin on 08-Apr-2014 00:00

It seems I am blind again.

 I want to set the characters to be used in the captcha of my for myself. I dont like it when i have 0 O l I (one is an captital i the other a lowercase L)

 But I simply cant find it were to set. I went into edit - advaced - captcha but cant find it.

 Any one can help me? I guess I simply overlook it somehow.

 demos.telerik.com/.../defaultcs.aspx

Markus

 

Posted by Community Admin on 11-Apr-2014 00:00

Hello,

You need to create a new Form Captcha control which inherit from the default FormCaptcha. Then you need to change the captcha image char set and register the control.

Custom For Captcha:

public class CustomFormCaptcha : FormCaptcha
    
        public string CharSet get; set;
 
        protected override string ScriptDescriptorTypeName
        
            get
            
                return typeof(FormCaptcha).FullName;
            
        
 
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            base.InitializeControls(container);
            if (!string.IsNullOrEmpty(this.CharSet))
            
                this.Captcha.CaptchaImage.TextChars = CaptchaPossibleChars.CustomCharSet;
                this.Captcha.CaptchaImage.CharSet = this.CharSet;
            
            else
            
                this.Captcha.CaptchaImage.TextChars = CaptchaPossibleChars.LettersAndNumbers;
            
        
    

To register your control follow the steps in our Sitefinity documentation.

I have added a feature request for you in our Feedback portal. You could review its description in our Feedback portal on the following link.

Regards,
Stefani Tacheva
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 11-Apr-2014 00:00

Could you open up another feature request (more like a bug)

The captcha is not localizable. Neither by Administration- Label & Messages nor by setting the text in advanced mode. So for now it seems I am stuck with english captchas on all my pages.

I wonder why default RadControls stuff is not exposed.

Markus

Posted by Community Admin on 15-Apr-2014 00:00

Support opened a feedback entry for this.

 Anyone using multilingual sites and forms captchas and feels like voting?

feedback.telerik.com/.../125592-form-captcha-control-localizable

Strange enough the captcha on comments is localized :-(

 Markus

Posted by Community Admin on 15-Apr-2014 00:00

Hi,

As you mentioned we have opened a feature request about this missing functionality which description could be found in our Feedback portal on the following link. However you could achieve the desired functionality using some customizations. I am sharing our solution with the community as well:

You can apply the approaches described in the following articles:

https://demos.telerik.com/aspnet-ajax/captcha/examples/localization/defaultcs.aspx

http://www.telerik.com/help/aspnet-ajax/captcha-localization.html

Here is a sample on how you can plug in your logic and alter the text:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Modules.Forms.Web.UI.Fields;
  
namespace SitefinityWebApp
    public class CustomFormsCaptcha : FormCaptcha
    
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            this.Captcha.CaptchaLinkButtonText = "This is the custom link";
            this.Captcha.CaptchaTextBoxLabel = "This is custom label";
  
            base.InitializeControls(container);
        
    

Then you need to register your control as described in our Sitefinity documentation.

Regards,
Stefani Tacheva
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 02-Jun-2014 00:00

Hi,

I tried to add this code you posted above but I get Uncaught ReferenceError. See attached file.

Regards,
Dejan Pecnik

Posted by Community Admin on 03-Jun-2014 00:00

Hello,

It seems that your project name is different. Please create a new class calledCustomFormsCaptcha in your project and include the following code inside it:

protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            this.Captcha.CaptchaLinkButtonText = "This is the custom link";
            this.Captcha.CaptchaTextBoxLabel = "This is custom label";
   
            base.InitializeControls(container);
        

Build your project and register the control. To register it follow the steps in our Sitefinity documentation.

Regards,
Stefani Tacheva
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 04-Jun-2014 00:00

Hello,

I tried to create a new class but there is no difference. I can add control in the backend and it looks like it works well, but when I publish form and reopen it an error occurs.

Regards,
Dejan Pecnik

Posted by Community Admin on 16-Jun-2014 00:00

Hello Dejan,

You should add the ScriptDescriptorType of the control to the FormCaptcha, so all other resources will be loaded from it:

protected override string ScriptDescriptorType
      
          get
          
             return typeof(FormCaptcha).FullName;
          
      

I attach a sample custom RadCaptcha for sake of future simplicity. Here is a image reference on how to register in the FormControls section.

Regards,
Nikola Zagorchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 17-Jun-2014 00:00

Thanks Nikola. This is solved my problem.

Regars,
Dejan Pecnik

This thread is closed