Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2009, 02:28 AM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default search not working, security token is invalid.

I try to fix for someone a portal site that use vB as search. It was working before an upgrade from 3.6 to 3.7.3.

Now, search inside the forum is all working fine, but my search fields on my portal are not.

I've been following closely these thread:
https://vborg.vbsupport.ru/showthread.php?t=177013
http://www.vbulletin.com/forum/showp...40&postcount=7


but I haven't found any answer for my portal, i'm still having "Your submission could not be processed because a security token was invalid.". The portal is not using any templates from the ACP, it operating on it own php code with snippets took from vB.

here's what my code looks like:

headerinclude.php
PHP Code:
<?php

define
('CSRF_PROTECTION'true);  
define(CURDIRgetcwd());

$root $_SERVER['DOCUMENT_ROOT'];

chdir($root."\board\\");

require_once(
'./global.php');

CURDIR chdir(CURDIR) : chdir("../");


$theme "/board/".$stylevar["imgdir_misc"];
$themename $style["title"];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>...</title>
    <link href="/board/images/common.css" rel="stylesheet" type="text/css" />
    <link href="<?=$theme?>/style.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="board/clientscript/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="board/clientscript/yui/connection/connection-min.js"></script>
    <script type="text/javascript" language="javascript">
    <!--
        var SESSIONURL = "$session[sessionurl_js]";
        var SECURITYTOKEN = "$bbuserinfo[securitytoken]";
        var IMGDIR_MISC = "$stylevar[imgdir_misc]";
        var vb_disable_ajax = parseInt("$vboptions[disable_ajax]", 10);
    -->
    </script>
    <script type="text/javascript" src="board/clientscript/vbulletin_global.js"></script>
    <script type="text/javascript" src="board/clientscript/vbulletin_menu.js"></script>   
</head>
<body><a name="totop"></a>
<?=$curdir?>


<?php 
    
@include("search.php"); 
?>
search.php
PHP Code:
<fieldset id="newssearch">
    <form action="/board/search.php" method="post">
            
            <input type="hidden" name="do" value="process" />            
            <?php
                $newsForumArray 
explode (",",$newsforumID);
                foreach(
$newsForumArray as $forumid) {
                    echo 
"<input type=\"hidden\" name=\"forumchoice[]\" value=\"".$forumid."\" />\n";
                }
            
?>
            <input type="hidden" name="childforums" value="0" />
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
            <label for="newssearch"><span>News Search</span>
            <input type="text" class="textbox" name="query" size="20" />
            </label>
            <input type="submit" class="button" value="Go" />     
    </form>
</fieldset>
<fieldset id="forumsearch">
    <form action="/board/search.php" method="post">
        <input type="hidden" name="do" value="process" />
        <input type="hidden" name="showposts" value="0" />
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
        <label for="forumsearch"><span>Forum search:</span>
        <input type="text" class="textbox" name="query" size="20" />
        </label>
        <input type="submit" class="button" value="Go"  />
        <div style="text-align:right;"><a href="/board/search.php">Go Advanced</a></div>
    </form>
</fieldset>

help please and thanks in advance!

--------------- Added [DATE]1239144847[/DATE] at [TIME]1239144847[/TIME] ---------------


found my solution in this thread:

https://vborg.vbsupport.ru/showthrea...=csrf+external

<input type="hidden" name="securitytoken" value="<?php echo($vbulletin->userinfo['securitytoken']); ?>" />

this input solved it for me.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:01 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.03440 seconds
  • Memory Usage 2,176KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete