src/login_token.php
public function is_valid($mark_as_used=true) {
	if (!empty($this->data['used'])) {
		return false;
	}
	if (time() > $this->data['expire_at']) {
		return false;
	}
	
	if ($mark_as_used) {
		$this->mark_as_used();
	}
	
	return true;
}
public function is_valid($mark_as_used=true) {
	if (!empty($this->data['used'])) {
		return false;
	}
	if (time() > $this->data['expire_at']) {
		return false;
	}
	
	if ($mark_as_used) {
		$this->mark_as_used();
	}
	
	return true;
}
public function is_valid ( $ mark_as_used = true ) { if ( ! empty ( $ this -> data [ 'used' ] ) ) { return false ; } if ( time ( ) > $ this -> data [ 'expire_at' ] ) { return false ; } if ( $ mark_as_used ) { $ this -> mark_as_used ( ) ; } return true ; }
check if the token is still valid
also marks the token as used to prevent more people getting in

@param  boolean $mark_as_used set to false to validate w/o user action
@return boolean
check if the token is still valid also marks the token as used to prevent more people getting in