View Full Version : How do I implement human verification on my custom page
veenuisthebest
06-14-2008, 02:59 AM
Hii..
I was looking for how to implement vB's default human verification on my custom page.
Then I found this in one of the pages of vB.
require_once(DIR . '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
$human_verify = $verify->output_token();
if (!$verify->verify_token($vbulletin->GPC['humanverify']))
{
standard_error(fetch_error($verify->fetch_error()));
}
and then simply adding $human_verify at the desired location in the template. This works just perfect BUT even the correct entered captcha is giving error saying "Incorrect String entered."
There must be some minor mistake I am making.. any help is much appreciated !!
Dismounted
06-14-2008, 06:31 AM
In the ASKING stage, add:
require_once(DIR . '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
$human_verify = $verify->output_token();
Use $human_verify in your template. Then in the verifying stage, add:
$vbulletin->input->clean_gpc('r', 'humanverify', TYPE_ARRAY);
require_once(DIR . '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
if (!$verify->verify_token($vbulletin->GPC['humanverify']))
{
eval(standard_error(fetch_error($verify->fetch_error())));
}
veenuisthebest
06-14-2008, 06:48 AM
excellent.... works perfect !!!
thank you so much.. I had posted the same on so many forums but could not get it to work. thanks again
nerofix
10-07-2008, 12:22 PM
hmm... where is the "veryfying stage" ? I don't know where to put this code.
Lynne
10-07-2008, 02:45 PM
The "asking" stage is when the user is presented with the form. The "verifying" stage is when the form is submitted and the contents are processed.
nerofix
10-07-2008, 05:31 PM
I wonder a bit, because I can't even find an "verifying stage" in the original register tempate.
Lynne
10-07-2008, 05:43 PM
Sure it's on the registration page. It's the form action "<form action="register.php?do=register" method="post">". When you click submit, the form action is done and that is the "verifying stage". (I'm talking about "in general". That is not the actual form action on the page that has the captcha image - it will have a different form action.)
ivand
03-12-2009, 07:49 AM
How this code should be modified to work with 3.8.1?
I am trying to build a quick registration module on a custom page and can not solve the human verify function.
Thanks for any help.
ragtek
03-12-2009, 07:53 AM
require_once(DIR . '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
$human_verify = $verify->output_token();
check:
$vbulletin->input->clean_array_gpc('p', array(
'humanverify' => TYPE_ARRAY
));
require_once(DIR . '/includes/class_humanverify.php');
$verify =& vB_HumanVerify::fetch_library($vbulletin);
if (!$verify->verify_token($vbulletin->GPC['humanverify']))
{
standard_error(fetch_error($verify->fetch_error()));
}
I'm doing something similar in modifying the Standard_Error template to also have user registration fields complete with human verifacation for when someone that is not logged in tries to post.
Does this mean that I need to modify newreply.php and newthread.php (in addition to any other pages that would generate the standard error message) with the code samples in this thread?
I've tried that, and inserted almost the entire register template into the standard error template. Everything except for human verification works and the $human_verify hook is in there.
Any thoughts?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.