vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do I implement human verification on my custom page (https://vborg.vbsupport.ru/showthread.php?t=182435)

veenuisthebest 06-14-2008 02:59 AM

How do I implement human verification on my custom page
 
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.

PHP Code:

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:
PHP Code:

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:
PHP Code:

$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

PHP Code:

        require_once(DIR '/includes/class_humanverify.php');
        
$verify =& vB_HumanVerify::fetch_library($vbulletin);
        
$human_verify $verify->output_token(); 

check:
PHP Code:

$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()));
        } 


doob 08-22-2012 02:55 AM

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?


All times are GMT. The time now is 03:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01147 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete