This topic is locked

captcha

1/22/2007 1:56:06 AM
PHPRunner General questions
G
gjpyne author

RE: http://www.puremango.co.uk/cm_php_captcha_script_113.php
I assume the script is used in the Registration page: Onload or Before Registration:
I would like a working sample of how to implement this!
Thanks in advance.
By the way, I have implemented a "starter script" from SugarCRM that uses the Web/URL field to check a time stamped custom file and gives access to the phprunner system without a second password. I have some additional code that I manually inserted to prevent manually changing the URL to access different records, effectively locking down a single master record access (and only the related detail records).

D
Dale 1/22/2007

I have read previous posts about captcha in the forum. Doing a search on Captcha should bring some results.

But I was hoping I good butt in here and ask if you could share your code snippet for your comment below. To stop users from changing the url.

---------

I have some additional code that I manually inserted to prevent manually changing the URL to access different records, effectively locking down a single master record access (and only the related detail records).

---------

I have never had time to research it but it has always bothered me that smart users could change the id number for masterkey in the url and poof they have the record.
Would really appreciate the tip.
DaleM

G
gjpyne author 1/23/2007

I have read previous posts about captcha in the forum. Doing a search on Captcha should bring some results.



DaleM
I did a search and saw Alexey's comment but no code guidence. I sent a message to Alexey requesting details. I also sent you a message with the code you requested, hope it helps. By the way you will notice similar code in each edit and list... you should add the code after that code when you want to lock down the record access.

Alexey admin 1/25/2007

Hi,
here are the instructions.

  1. Open Register page in Visual Editor, switch to HTML mode and add this code there:

<script language="javascript">

function new_freecap()

{

if(document.getElementById)

{

thesrc = document.getElementById("freecap").src;

thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);

document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);

} else {

alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");

}

}

</script>

<img src="freecap.php" id="freecap"><br>

If you can't read the word, <a href="#" onClick="this.blur();new_freecap();return false;">click here</a>

<br>word above:<input type="text" name="word">



The code must fit between <form name=editform...>and </form> tags.
2. Proceed to Events tab and put the following code to Before register event:

if($_SESSION['hash_func'](strtolower($_POST['word']))==$_SESSION['freecap_word_hash'])

{

$_SESSION['freecap_attempts'] = 0;

$_SESSION['freecap_word_hash'] = false;

return true;

}

else

return false;


3. Build the pages in PHPRunner.

4. Download Freecap archive from this location

http://www.puremango.co.uk/cm_php_captcha_script_113.php

and unzip it to PHPRunner output folder.

5. Enjoy