Audio does not work in Forms Captcha Widget

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

Audio does not work in Forms Captcha Widget

All Replies

Posted by Community Admin on 28-Oct-2014 00:00

We've been using the baked in Captcha widget to protect our forms from SPAM. We recently received some angry feedback letting us know that our forms were not Visually Impaired friendly. The baked in Captcha is not accessible to those with vision problems. The standard Captcha (and RadCaptcha) have a download audio option that allows Visually Impaired people to download the audio and listent to what the letters/numbers are in the captcha so that they will be able to submit your forms. Unfortunately Sitefinity ended up pushing out the Captcha Widget without it being fully functional. They are aware of the problem but will not work on it unless enough people want it fixed. I think you would all agree that our forms need to be accessible. Please upvote the 'Bug Report' for this problem. Thanks!

http://feedback.telerik.com/Project/153/Feedback/Details/135331-audio-does-not-work-in-forms-captcha

Posted by Community Admin on 31-Oct-2014 00:00

Hello Richard,

We are really sorry for the inconvenience caused. Please, use the following extended captcha for the forms:

<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
 
<div>
<telerik:RadCaptcha EnableDownloadAudio="true" CaptchaAudioLinkButtonText="Get Audio" runat="server" ID="radCaptcha" EnableRefreshImage="true" CssClass="sfFormCaptcha" CaptchaTextBoxCssClass="sfTxt" CaptchaTextBoxLabelCssClass="sfTxtLbl">
 
    <CaptchaImage EnableCaptchaAudio="true" RenderImageOnly="true" ImageCssClass="rcCaptchaImage"
                  BackgroundColor="#609f0a" TextColor="White" BackgroundNoise="None"></CaptchaImage>
 
 
</telerik:RadCaptcha>
    </div>
<div>
<asp:TextBox ID="rcTextBox1" runat="server" MaxLength="5" Width="170px"></asp:TextBox>
 </div>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Modules.Forms.Web.UI.Fields;
 
namespace SitefinityWebApp.MyControls
    public class CustomRadCaptcha : FormCaptcha
    
        public override string LayoutTemplatePath
        
            get
            
                return "~/MyControls/CustomRadCaptchaTemplate.ascx";
                  
        
 
       protected override string ScriptDescriptorType
       
           get
           
               return typeof(FormCaptcha).FullName;
           
       
    

Please, register the control in the toolbox, in the Forms section. This could be done through the Advanced settings -> Toolboxes -> Toolboxes -> FormControls. The RadCaptcha folder with the sound files needs to be in ~/App_Data folder.

Hope this helps.

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 31-Oct-2014 00:00

Thanks Nikola! So is the first bit an .ascx file? And do I need to use the 2nd snippit of code as the .cs file for the first bit? Does it matter where I put the file(s) in the folder structure? And then once I've added this code do I have to 'build' the solution? and then register it in the Toolbox? Is that correct?

 Sorry I'm c#-impaired :)

Also will the original Captcha be fixed so we won't have to worry about updating the custom Captcha control with every version upgrade?

 Thanks!

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

IMO the safer route is to just inherit from the default captcha control and enable it right there... then just replace the stock toolbox one with your quick 'tweaked' version.

Overriding an ascx embedded template is exposing yourself to a future failpoint.  If the ever do anything to that widget template in an update you're hosed...

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

Hi all,

You can actually only modify the server side of the default captcha the following way:

using Telerik.Sitefinity.Modules.Forms.Web.UI.Fields;
 
namespace SitefinityWebApp.AudioFormsCaptcha
    public class AudioFormsCaptcha : FormCaptcha
    
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            base.InitializeControls(container);
            this.Captcha.CaptchaImage.EnableCaptchaAudio = true;
            this.Captcha.CaptchaImage.EnableAudioNoise = true;
        
 
        protected override string ScriptDescriptorType
        
            get
            
                return typeof(FormCaptcha).FullName;
            
        
    

Build your application including the added class. Then go to your application Advanced setting and either replace the default control or add an additional one. This is done from Toolboxes -> FormControls -> Sections -> a section (Common by default) -> Tools -> Create new - see reference.
Hope this helps.

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 03-Nov-2014 00:00

@Nikola

  Yep that's exactly what I was talking about, thanks for the detailed post, I was no where near a computer to write\validate it.

 (Although don't make a new toolbox widget, just set the type of the existing Captcha to SitefinityWebApp.AudioFormsCaptcha.AudioFormsCaptcha, SitefinityWebApp)  In no case do you want your content editors to use the other one (as it doesn't work)

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

Hello,

You can just override the default captcha by specifying your custom one type, indeed, as Steve mentioned. This way the content editors will not notice any change in the UI, however, the custom captcha that provides the audio will be used.
Write back to us if any troubles are experienced.

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
 

This thread is closed