_name_ = $name; if($timeout) { $this->_lifetime_ = time() + $timeout; $this->_unlimited_ = false; } else { $this->_lifetime_ = 0; $this->_unlimited_ = true; } $this->_token_ = $this->_generateToken(); } /** * Returns random string for token's string. * * @access protected * @return string */ function _generateToken() { srand(microtime()*100000); return md5(XOOPS_SALT.$this->_name_.uniqid(rand(),true)); } /** * Returns this token's name. * * @access public * @return string */ function getTokenName() { return XOOPS_TOKEN_PREFIX.$this->_name_."_".$this->_number_; } /** * Returns this token's string. * * @access public * @return string */ function getTokenValue() { return $this->_token_; } /** * Set this token's serial number. * * @access public * @param $serial_number serial number */ function setSerialNumber($serial_number) { $this->_number_ = $serial_number; } /** * Returns this token's serial number. * * @access public * @return int */ function getSerialNumber() { return $this->_number_; } /** * Returns hidden tag string that includes this token. you can use it * for