18 public function check($clearIfValid =
true, $tokenValue =
false)
20 return $this->validateToken($tokenValue, $clearIfValid);
23 public function createToken($timeout = XOOPS_TOKEN_TIMEOUT)
26 return $token->getTokenValue();
29 public function validateToken($tokenValue =
false, $clearIfValid =
true)
31 if (
false !== $tokenValue) {
33 $token =& $handler->fetch(XOOPS_TOKEN_DEFAULT);
34 if ($token->validate($tokenValue)) {
36 $handler->unregister($token);
40 $this->setErrors(
'No token found');
47 public function getTokenHTML()
50 return $token->getHtml();
53 public function setErrors($error)
55 $this->errors[] = trim($error);
58 public function &getErrors($ashtml =
false)
64 if (count($this->errors) > 0) {
65 foreach ($this->errors as $error) {
66 $ret .= $error.
'<br>';