/** * Lookup nonce value for the tool consumer. * * @param OAuthConsumer $consumer OAuthConsumer object * @param string $token Token value * @param string $value Nonce value * @param string $timestamp Date/time of request * @return boolean True if the nonce value already exists */ function lookup_nonce($consumer, $token, $value, $timestamp) { $nonce = new LTI_Consumer_Nonce($this->tool_provider->consumer, $value); $ok = !$nonce->load(); if ($ok) { $ok = $nonce->save(); } if (!$ok) { $this->tool_provider->reason = 'Invalid nonce.'; } return !$ok; }