gticket2 released

Date 2006-05-06 04:50:43 | Category: XOOPS

in englishin japanese
A ticket/token class named XoopsGTicket is updated.
In the version named gticket2, repost form will be opened if ticket error occurrs.
This feature must reduce user's stresses.

The usage of gticket2 is almost the same as gticket.

- include_once include/gtickets.php
- add hidden into your form
- add check() into your transaction


form side with XoopsForm:

	$form = new XoopsThemeForm( ... );
	$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ , 1800 , '(your area name)' ) ;


form side with plain HTML:

	$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , '(your area name)' )



transaction side:

	if ( ! $xoopsGTicket->check( true , '(your area name)' ) ) {
		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
	}

If an error occurs in cheking the ticket, "repost form" is displayed automatically.

If you don't want to display "repost form", call check() like this.

	if ( ! $xoopsGTicket->check( true , '(your area name)' , false ) ) {
		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
	}


You can check the behaviors and usages of gticket2 by downloading the latest blocksadmin module.

note: Don't check doublly by XoopsSecurity::check() even if you use XoopsForm.
If you call core's check() also, the system of repost can't work.

----------
2006/5/6 fixed typo (thx gusagi!)




You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=95