[vhffs-dev] [1330] Added a vocal reading of the subscribe capcha to improve the panel' s accessibility for visualy impaired users. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [1330] Added a vocal reading of the subscribe capcha to improve the panel' s accessibility for visualy impaired users.
- From: subversion@xxxxxxxxxxxxx
- Date: Sun, 25 Jan 2009 02:50:37 +0100
Revision: 1330
Author: crafty
Date: 2009-01-25 02:50:37 +0100 (Sun, 25 Jan 2009)
Log Message:
-----------
Added a vocal reading of the subscribe capcha to improve the panel's accessibility for visualy impaired users.
The subcribe page is now using espeak to generate .wav files
Modified Paths:
--------------
trunk/vhffs-intl/POTFILES.in
trunk/vhffs-intl/de_DE.po
trunk/vhffs-intl/en_US.po
trunk/vhffs-intl/es_ES.po
trunk/vhffs-intl/fr_FR.po
trunk/vhffs-panel/Makefile.am
trunk/vhffs-panel/subscribe.pl
trunk/vhffs-panel/templates/user/create.tmpl
Added Paths:
-----------
trunk/vhffs-panel/play_code.pl
Modified: trunk/vhffs-intl/POTFILES.in
===================================================================
--- trunk/vhffs-intl/POTFILES.in 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-intl/POTFILES.in 2009-01-25 01:50:37 UTC (rev 1330)
@@ -284,6 +284,7 @@
vhffs-panel/user/delete.pl
vhffs-panel/alert.pl
vhffs-panel/show_code.pl
+vhffs-panel/play_code.pl
vhffs-panel/getavatar.pl
vhffs-panel/lost.pl
vhffs-panel/subscribe.pl
Modified: trunk/vhffs-intl/de_DE.po
===================================================================
--- trunk/vhffs-intl/de_DE.po 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-intl/de_DE.po 2009-01-25 01:50:37 UTC (rev 1330)
@@ -943,6 +943,10 @@
msgid "Code confirmation"
msgstr ""
+#: vhffs-panel/subscribe.pl:251
+msgid "Or listen to the code"
+msgstr "Oder hören Sie den Code"
+
#: vhffs-panel/subscribe.pl:107
msgid "Codes do not match"
msgstr ""
Modified: trunk/vhffs-intl/en_US.po
===================================================================
--- trunk/vhffs-intl/en_US.po 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-intl/en_US.po 2009-01-25 01:50:37 UTC (rev 1330)
@@ -930,6 +930,10 @@
msgid "Code confirmation"
msgstr ""
+#: vhffs-panel/subscribe.pl:251
+msgid "Or listen to the code"
+msgstr ""
+
#: vhffs-panel/subscribe.pl:107
msgid "Codes do not match"
msgstr ""
Modified: trunk/vhffs-intl/es_ES.po
===================================================================
--- trunk/vhffs-intl/es_ES.po 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-intl/es_ES.po 2009-01-25 01:50:37 UTC (rev 1330)
@@ -973,6 +973,10 @@
msgid "Code confirmation"
msgstr "Código de confirmación"
+#: vhffs-panel/subscribe.pl:251
+msgid "Or listen to the code"
+msgstr "O escuchar el código"
+
#: vhffs-panel/subscribe.pl:107
msgid "Codes do not match"
msgstr "Los códigos no corresponden"
Modified: trunk/vhffs-intl/fr_FR.po
===================================================================
--- trunk/vhffs-intl/fr_FR.po 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-intl/fr_FR.po 2009-01-25 01:50:37 UTC (rev 1330)
@@ -8,7 +8,7 @@
# Cyril Brulebois <cyril.brulebois@xxxxxxxxxxxxxxxx>, 2006.
# Sylvain Vrignaud <misric@xxxxxxxxxx>, 2007.
# Sylvain Rochet <gradator@xxxxxxxxxxxx>, 2007, 2008.
-# Samuel Lesueur <crafty@xxxxxxxxxxxxx>, 2007.
+# Samuel Lesueur <crafty@xxxxxxxxxxxxx>, 2007, 2008, 2009.
msgid ""
msgstr ""
"Project-Id-Version: fr_FR\n"
@@ -987,6 +987,10 @@
msgid "Code confirmation"
msgstr "Code de confirmation"
+#: vhffs-panel/subscribe.pl:251
+msgid "Or listen to the code"
+msgstr "Ou écoutez le code"
+
#: vhffs-panel/subscribe.pl:107
msgid "Codes do not match"
msgstr "Les codes ne correspondent pas"
Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-panel/Makefile.am 2009-01-25 01:50:37 UTC (rev 1330)
@@ -21,6 +21,7 @@
lost_ack.pl \
panel.pl \
show_code.pl \
+ play_code.pl \
subscribe.pl \
acl/view.pl \
ajax/help.pl \
Added: trunk/vhffs-panel/play_code.pl
===================================================================
--- trunk/vhffs-panel/play_code.pl (rev 0)
+++ trunk/vhffs-panel/play_code.pl 2009-01-25 01:50:37 UTC (rev 1330)
@@ -0,0 +1,60 @@
+#!%PERL% -w
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+use CGI;
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Main;
+
+#Get some basics informations with CGI
+my $cgi = new CGI;
+$cgi->charset('utf-8');
+my $vhffs = init Vhffs::Main;
+
+my $code = $cgi->param("code");
+
+my $buffer;
+
+exit 0 unless ( defined $code && $code =~ /^[0-9a-fA-F]{32}$/ );
+exit 0 unless ( open(WAV, $vhffs->get_config()->get_panel->{'captchadir'}."/$code.wav") );
+
+print CGI->header( -type=>'audio/wav', -attachment => 'capcha.wav' );
+
+select((select(STDOUT), $| = 1)[0]);
+binmode STDOUT;
+binmode WAV;
+
+while( read(WAV, $buffer, 1024) ) {
+ print STDOUT $buffer;
+}
+close WAV;
+close STDOUT;
Property changes on: trunk/vhffs-panel/play_code.pl
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/vhffs-panel/subscribe.pl
===================================================================
--- trunk/vhffs-panel/subscribe.pl 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-panel/subscribe.pl 2009-01-25 01:50:37 UTC (rev 1330)
@@ -237,14 +237,21 @@
$template->param( SEND => gettext("Subscribe") );
$template->param( BACK => gettext("Back to Login") );
- my $md5 = $captcha->generate_code( 6 );
+ my $md5;
+ my $chars;
+ my $espeak_chars;
+ ($md5,$chars) = $captcha->generate_code( 6 );
+ my $capcha_file = $dir.'/'.$md5.'.wav';
+ $espeak_chars = join(': ', split(//,$chars));
+ system("find $dir -iname '*.wav'".' -mmin +5 -exec rm {} \;');
+ system("echo $espeak_chars | espeak -s 80 -w $capcha_file");
$template->param( MD5_CODE => $md5 );
$template->param( CONFIRMATION_TEXT => gettext('Code confirmation') );
$template->param( REPEAT_CONFIRMATION_TEXT => gettext('Recopy the code') );
$template->param( CONFIRMATION_ALT => gettext('Confirmation code, contact administrator team if you can\'t read it') );
-
+ $template->param( CONFIRMATION_SOUND_TEXT => gettext('Or listen to the code') );
$template->param( USERNAME_TIP_TEXT => gettext('Your username. It must contains only alphanumeric characters in lowercase, its length must be between 3 and 12 chars') );
$template->param( EMAIL_TIP_TEXT => gettext('Your email address. It will be used to contact you when needed and as a destination address if you use our email forwarding service') );
}
Modified: trunk/vhffs-panel/templates/user/create.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/create.tmpl 2009-01-14 21:10:35 UTC (rev 1329)
+++ trunk/vhffs-panel/templates/user/create.tmpl 2009-01-25 01:50:37 UTC (rev 1330)
@@ -64,7 +64,7 @@
<label for="CONFIRMATION">
<TMPL_VAR ESCAPE=1 NAME="CONFIRMATION_TEXT">
</label>
- <img src="show_code.pl?code=<TMPL_VAR ESCAPE=1 NAME="MD5_CODE">" alt="<TMPL_VAR ESCAPE=1 NAME="CONFIRMATION_ALT">"/>
+ <img src="show_code.pl?code=<TMPL_VAR ESCAPE=1 NAME="MD5_CODE">" alt="<TMPL_VAR ESCAPE=1 NAME="CONFIRMATION_ALT">"/> <a href="play_code.pl?code=<TMPL_VAR ESCAPE=1 NAME="MD5_CODE">"><TMPL_VAR ESCAPE=1 NAME="CONFIRMATION_SOUND_TEXT"></a>
</p>
<p>
<label for="CONFIRMATION">