src/User.php
public function verifyEmailToken($token)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = false;
		$token = base64_decode($token);
		$vals = array(
			'token_hash' => $this->db->quoteValue(sha1($token)),
		);
		$query = Str::quickTemp('SELECT * FROM `email_tokens`
			WHERE `token_hash` = [::token_hash::]', $vals);
		$rows = $this->db->query($query)[0];
		$this->debug->table($rows, 'rows');
		if ($rows) {
			// found token in table
			$return = $rows[0]['userid'];
			// remove the token
			$where = $vals;
			$this->db->rowMan('email_tokens', null, $where);
			$this->log('pwForgotTokenSuccess', $rows[0]['userid']);
		} else {
			$this->log('pwForgotTokenFail');
		}
		$this->debug->groupEnd();
		return $return;
	}
public function verifyEmailToken($token)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = false;
		$token = base64_decode($token);
		$vals = array(
			'token_hash' => $this->db->quoteValue(sha1($token)),
		);
		$query = Str::quickTemp('SELECT * FROM `email_tokens`
			WHERE `token_hash` = [::token_hash::]', $vals);
		$rows = $this->db->query($query)[0];
		$this->debug->table($rows, 'rows');
		if ($rows) {
			// found token in table
			$return = $rows[0]['userid'];
			// remove the token
			$where = $vals;
			$this->db->rowMan('email_tokens', null, $where);
			$this->log('pwForgotTokenSuccess', $rows[0]['userid']);
		} else {
			$this->log('pwForgotTokenFail');
		}
		$this->debug->groupEnd();
		return $return;
	}
public function verifyEmailToken ( $ token ) { $ this -> debug -> groupCollapsed ( __METHOD__ ) ; $ return = false ; $ token = base64_decode ( $ token ) ; $ vals = array ( 'token_hash' => $ this -> db -> quoteValue ( sha1 ( $ token ) ) , ) ; $ query = Str :: quickTemp ( 'SELECT * FROM `email_tokens`
			WHERE `token_hash` = [::token_hash::]' , $ vals ) ; $ rows = $ this -> db -> query ( $ query ) [ 0 ] ; $ this -> debug -> table ( $ rows , 'rows' ) ; if ( $ rows ) { // found token in table $ return = $ rows [ 0 ] [ 'userid' ] ; // remove the token $ where = $ vals ; $ this -> db -> rowMan ( 'email_tokens' , null , $ where ) ; $ this -> log ( 'pwForgotTokenSuccess' , $ rows [ 0 ] [ 'userid' ] ) ; } else { $ this -> log ( 'pwForgotTokenFail' ) ; } $ this -> debug -> groupEnd ( ) ; return $ return ; }
verifies a token sent via email
searches for token in db
if found will remove from db

@param string $token token value

@return mixed userid or false
verifies a token sent via email searches for token in db if found will remove from db