XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XoopsToken Class Reference

Public Member Functions

 __construct ($name, $timeout=XOOPS_TOKEN_TIMEOUT)
 
 _generateToken ()
 
 getTokenName ()
 
 getTokenValue ()
 
 setSerialNumber ($serial_number)
 
 getSerialNumber ()
 
 getHtml ()
 
 getUrl ()
 
 validate ($token=null)
 

Data Fields

 $_name_
 
 $_token_
 
 $_lifetime_
 
 $_unlimited_
 
 $_number_ =0
 

Detailed Description

This class express token. this has name, token's string for inquiry, lifetime, serial number. this does not have direct validation method, therefore this does not depend on $_Session and $_Request.

You can refer to a handler class for this token. this token class means ticket, and handler class means ticket agent. there is a strict ticket agent type(XoopsSingleTokenHandler), and flexible ticket agent for the tab browser(XoopsMultiTokenHandler).

Definition at line 35 of file token.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $name,
$timeout = XOOPS_TOKEN_TIMEOUT )
Parameters
this$nametoken's name string.
int$timeouttime(if $timeout equal 0, this token will become unlimited)

Definition at line 72 of file token.php.

Member Function Documentation

◆ _generateToken()

_generateToken ( )

Returns random string for token's string.

@access protected

Returns
string

Definition at line 94 of file token.php.

◆ getHtml()

getHtml ( )

Returns hidden tag string that includes this token. you can use it for <form> tag's member.

@access public

Returns
string

Definition at line 151 of file token.php.

◆ getSerialNumber()

getSerialNumber ( )

Returns this token's serial number.

@access public

Returns
int

Definition at line 139 of file token.php.

◆ getTokenName()

getTokenName ( )

Returns this token's name.

@access public

Returns
string

Definition at line 106 of file token.php.

◆ getTokenValue()

getTokenValue ( )

Returns this token's string.

@access public

Returns
string

Definition at line 117 of file token.php.

◆ getUrl()

getUrl ( )

Returns url string that includes this token. you can use it for hyper link.

Returns
string

Definition at line 162 of file token.php.

◆ setSerialNumber()

setSerialNumber ( $serial_number)

Set this token's serial number.

@access public

Parameters
serial$serial_numbernumber

Definition at line 128 of file token.php.

◆ validate()

validate ( $token = null)

If $token equals this token's string, true is returned.

Parameters
null$token
Returns
bool

Definition at line 173 of file token.php.

Field Documentation

◆ $_lifetime_

$_lifetime_

the unixtime when this token is effective.

@access protected

Definition at line 54 of file token.php.

◆ $_name_

$_name_

token's name. this is used for identification. @access protected

Definition at line 41 of file token.php.

◆ $_number_

$_number_ =0

serial number. this used for identification of tokens of same name tokens.

@access private

Definition at line 66 of file token.php.

◆ $_token_

$_token_

token's string for inquiry. this should be a random code for security. @access private

Definition at line 47 of file token.php.

◆ $_unlimited_

$_unlimited_

unlimited flag. if this is true, this token is not limited in lifetime.

Definition at line 59 of file token.php.


The documentation for this class was generated from the following file: