ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
TrivialOAuthDataStore.php
Go to the documentation of this file.
1 <?php
2 
7 {
8  private $consumers = array();
9 
10  public function add_consumer($consumer_key, $consumer_secret)
11  {
12  $this->consumers[$consumer_key] = $consumer_secret;
13  }
14 
15  public function lookup_consumer($consumer_key)
16  {
17  if (strpos($consumer_key, "http://") === 0) {
18  $consumer = new OAuthConsumer($consumer_key, "secret", null);
19  return $consumer;
20  }
21  if ($this->consumers[$consumer_key]) {
22  $consumer = new OAuthConsumer($consumer_key, $this->consumers[$consumer_key], null);
23  return $consumer;
24  }
25  return null;
26  }
27 
28  public function lookup_token($consumer, $token_type, $token)
29  {
30  return new OAuthToken($consumer, "");
31  }
32 
33  // Return NULL if the nonce has not been used
34  // Return $nonce if the nonce was previously used
35  public function lookup_nonce($consumer, $token, $nonce, $timestamp)
36  {
37  // Should add some clever logic to keep nonces from
38  // being reused - for no we are really trusting
39  // that the timestamp will save us
40  return null;
41  }
42 
43  public function new_request_token($consumer)
44  {
45  return null;
46  }
47 
48  public function new_access_token($token, $consumer)
49  {
50  return null;
51  }
52 }
new_access_token($token, $consumer)
add_consumer($consumer_key, $consumer_secret)
lookup_nonce($consumer, $token, $nonce, $timestamp)
$token
Definition: xapitoken.php:52
A Trivial memory-based store - no support for tokens.
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
lookup_token($consumer, $token_type, $token)