[TYPO3-english] ve_guestbook: captcha checking always fails

Damien Sauveron damien.sauveron at unilim.fr
Sat Apr 11 01:39:38 CEST 2009


Dear Andreas,

First of all, thanks for your answer.

Andreas Burg a écrit :
> Damien
> 
>> My configuration is the following:
>> typo3 4.2.4
>> captcha  1.1.0
>> sr_freecap 1.1.2
>> ve_guestbook 2.7.1
> 
> update to TYPO3 4.2.6
After updating typo3, sr_freecap works but not captcha 1.1.0. Perhaps an 
error on my side. I was a bit stupid to not upgrade typo3 before to send 
my mail. Sorry.
Nevertheless, if you have any idea for this captcha I would prefer since 
sr_freecap is perhaps a bit more difficult to guess for considered users 
(men of the street).


> did you choose sr_freecap on the Formular-Tab in the plugin?
Yes. I did it.

> Do you have something like this in your template?
> 
> <!-- ###SR_FREECAP_INSERT### this subpart is removed if CAPTCHA is not enabled! -->
>    <fieldset>
>      <legend>###FORM_LEGEND_CAPTCHA###</legend>
>      <div>###SR_FREECAP_IMAGE######SR_FREECAP_ACCESSIBLE###</div>
>      <div class="type-text">
>        <label for="freecap">###FORM_CAPTCHA###&nbsp;<span class="highlight">*</span></label>
>        <input type="text" name="tx_veguestbook_pi1[captcha_response]" 
> title="###SR_FREECAP_NOTICE###" value="" id="freecap" />
>      </div>
>      <div class="info">
>        <p>###SR_FREECAP_NOTICE###</p>
>        <p>###SR_FREECAP_CANT_READ###</p>
>      </div>
>    </fieldset>
> <!-- ###SR_FREECAP_INSERT### -->
> 
> Do you have something like this in your TSsetup?
> 
> plugin.tx_veguestbook_pi1 {
>    userFunc     = tx_veguestbook_pi1->main
>    templateFile = fileadmin/veguestbook_template.html
> }
I had and I have the code from the ext_typoscript_constants.txt and 
ext_typoscript_setup.txt. I have just modified the path to the template 
(this is the same file with small modifications to really avoid spam by 
using javascript code -- XHTML 1.0 script compliant):

<!-- ###TEMPLATE_FORM### -->
<p class="tx-guestbook-form-error">###FORM_ERROR###</p>
###FORM_ERROR_FIELDS###

<form method="post" action="no-more-spam###ACTION_URL###no-more-spam" 
id="commentform">
<fieldset>
	<legend>###FORM_LEGEND###</legend>
	
	<div class="tx-guestbook-field">
		<label for="firstname">###FORM_FIRSTNAME### <span 
class="tx-guestbook-form-obligationfield">###FORM_FIRSTNAME_OBLIGATION###</span></label>
		<input type="text" name="tx_veguestbook_pi1[firstname]" 
value="###VALUE_FIRSTNAME###" class="tx-guestbook-form-inputfield-med" 
id="firstname" />
	</div>
	
	<div class="tx-guestbook-field">
		<label for="surname">###FORM_SURNAME### <span 
class="tx-guestbook-form-obligationfield">###FORM_SURNAME_OBLIGATION###</span></label>
		<input type="text" name="tx_veguestbook_pi1[surname]" 
value="###VALUE_SURNAME###" class="tx-guestbook-form-inputfield-med" 
id="surname" />
	</div>
	
	<div class="tx-guestbook-field">
		<label for="email">###FORM_EMAIL### <span 
class="tx-guestbook-form-obligationfield">###FORM_EMAIL_OBLIGATION###</span></label>
		<input type="text" name="tx_veguestbook_pi1[email]" 
value="###VALUE_EMAIL###" class="tx-guestbook-form-inputfield-big" 
id="email" />
	</div>

	<div class="tx-guestbook-field">
		<label for="homepage">###FORM_HOMEPAGE### <span 
class="tx-guestbook-form-obligationfield">###FORM_HOMEPAGE_OBLIGATION###</span></label>
		<input type="text" name="tx_veguestbook_pi1[homepage]" 
value="###VALUE_HOMEPAGE###" class="tx-guestbook-form-inputfield-big" 
id="homepage" />
	</div>
	
	<div class="tx-guestbook-field">
		<label for="place">###FORM_PLACE### <span 
class="tx-guestbook-form-obligationfield">###FORM_PLACE_OBLIGATION###</span></label>
		<input type="text" name="tx_veguestbook_pi1[place]" 
value="###VALUE_PLACE###" class="tx-guestbook-form-inputfield-med" 
id="place" />
	</div>
	
<!-- ###CAPTCHA_INSERT### this subpart is removed if CAPTCHA is not 
enabled! -->
     <div class="tx-guestbook-field">
		<label for="capture">###FORM_CAPTCHA_RESPONSE### <span 
class="tx-guestbook-form-obligationfield">*</span><br 
/>###CAPTCHA_IMAGE###</label>
		<input type="text" class="tx-guestbook-form-inputfield-med" 
name="tx_veguestbook_pi1[captcha_response]" value="" id="capture" />
	
     </div>
  <!-- ###CAPTCHA_INSERT### -->
	
<!-- ###SR_FREECAP_INSERT### this subpart is removed if CAPTCHA is not 
enabled! -->
  	<div class="tx-guestbook-field">
		<label for="freecap">###SR_FREECAP_NOTICE### <span 
class="tx-guestbook-form-obligationfield">*</span><br /><span 
class="freecap-span">###SR_FREECAP_CANT_READ###</span></label>
		###SR_FREECAP_IMAGE###&nbsp;<input type="text" 
class="tx-guestbook-form-inputfield-med" 
name="tx_veguestbook_pi1[captcha_response]" 
title="###SR_FREECAP_NOTICE###" value="" id="freecap" />
		
	</div>
<!-- ###SR_FREECAP_INSERT### -->
  	
	<div class="tx-guestbook-field">
		<label for="message">###FORM_ENTRY### <span 
class="tx-guestbook-form-obligationfield">###FORM_ENTRY_OBLIGATION###</span></label>
		<textarea name="tx_veguestbook_pi1[entry]" 
class="tx-guestbook-form-textarea" rows="4" cols="25" 
id="message">###VALUE_ENTRY###</textarea>
	</div>	
	
	<div class="tx-guestbook-field">
		<input type="hidden" name="id" value="###PID###" />
		<input type="hidden" name="tx_veguestbook_pi1[submitted]" value="1" />
		<input type="submit" id="submit" value="###FORM_SUBMIT###" 
class="tx-guestbook-submit" />
	</div>
	
</fieldset>
</form>
<script type="text/javascript">
	//<![CDATA[

<!--
// Dieses Script soll verhindern, dass Spam-Roboter andauernd Einträge 
im Gästebuch machen.
// Das Gästebuch ist einfach für die Dauer von X Sekunden 
funktionsunfähig (form-action ist absichltich falsch)
// Nach X Sekunden wird die form-action dann richtig gesetzt und der 
"Eintragen"-Button wird aktiviert.
// 05.03.2006
// (c) Christoph Neumüller

var secs
var timerID = null
var timerRunning = false
var delay = 1000
var submitbuttonlangname

function InitializeTimer()	{
	// Dauer der Spamsperre
	secs = 9
	submitbuttonlangname = document.getElementById("submit").value
	StopTheClock()
	StartTheTimer()
}

function StopTheClock()	{
	if(timerRunning)
		clearTimeout(timerID)
	timerRunning = false
}

function StartTheTimer()	{
	if (secs==0)	{
		StopTheClock()
		document.getElementById('commentform').action = 
document.getElementById('commentform').action.replace(/no-more-spam/g,'')
		document.getElementById('submit').disabled = false
		document.getElementById('submit').value = submitbuttonlangname
	} else {
		document.getElementById("submit").disabled = true
		document.getElementById("submit").value = submitbuttonlangname +" (" + 
secs + ")"
		secs = secs - 1
		timerRunning = true
		timerID = self.setTimeout("StartTheTimer()", delay)
	}
}

InitializeTimer()
//-->
	//]]>
</script>

<!-- ###TEMPLATE_FORM### end -->


Best regards,
-- 
Damien Sauveron
http://damien.sauveron.fr/


More information about the TYPO3-english mailing list