1
kaotik
xoopsSecurity through POST
  • 2005/11/5 16:55

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I've been tring to use xoopsSecurity through a hidden field in a POST form.
Hidden field:
['xoopsSecurity']->createToken(); ?>">


on the receiving end:
$token_valid $GLOBALS['xoopsSecurity']->check(true$_REQUEST['t']);
if (!
$token_valid){
redirect_header(XOOPS_URL."/"3implode("
"
,$GLOBALS['xoopsSecurity']->getErrors() ) );
}


This always returns $token_valid as false. What am I doing wrong?

Thanks

2
Dave_L
Re: xoopsSecurity through POST
  • 2005/11/5 18:45

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I think you have to use the name XOOPS_TOKEN_REQUEST:

['xoopsSecurity']->createToken() ?>'>


Then the check would be:

if (!$GLOBALS['xoopsSecurity']->check()) {
   
redirect_header(XOOPS_URL3implode(''$GLOBALS['xoopsSecurity']->getErrors()));
}


If that doesn't work, view the source for the generated HTML page, and verify that it contains something like:

<input type='hidden' name='XOOPS_TOKEN_REQUEST' id='XOOPS_TOKEN_REQUEST' value='db08170597299ee18a2b1267a93e25a2' />

3
kaotik
Re: xoopsSecurity through POST
  • 2005/11/22 14:41

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


It's always the simple things that get me.....
I forgot to insert echo in the code. Here's how it should look:
echo $GLOBALS['xoopsSecurity']->createToken(); ?>'>

Login

Who's Online

328 user(s) are online (213 user(s) are browsing Support Forums)


Members: 0


Guests: 328


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits