ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
Auth_OpenID_SQLiteStore Class Reference
+ Inheritance diagram for Auth_OpenID_SQLiteStore:
+ Collaboration diagram for Auth_OpenID_SQLiteStore:

Public Member Functions

 setSQL ()
 
 _add_nonce ($server_url, $timestamp, $salt)
 private More...
 
- Public Member Functions inherited from Auth_OpenID_SQLStore
 Auth_OpenID_SQLStore ($connection, $associations_table=null, $nonces_table=null)
 This creates a new SQLStore instance. More...
 
 tableExists ($table_name)
 
 isError ($value)
 Returns true if $value constitutes a database error; returns false otherwise. More...
 
 resultToBool ($obj)
 Converts a query result to a boolean. More...
 
 setSQL ()
 This method should be overridden by subclasses. More...
 
 reset ()
 Resets the store by removing all records from the store's tables. More...
 
 _verifySQL ()
 private More...
 
 _fixSQL ()
 private More...
 
 blobDecode ($blob)
 
 blobEncode ($str)
 
 createTables ()
 
 create_nonce_table ()
 
 create_assoc_table ()
 
 _set_assoc ($server_url, $handle, $secret, $issued, $lifetime, $assoc_type)
 private More...
 
 storeAssociation ($server_url, $association)
 
 _get_assoc ($server_url, $handle)
 private More...
 
 _get_assocs ($server_url)
 private More...
 
 removeAssociation ($server_url, $handle)
 
 getAssociation ($server_url, $handle=null)
 
 _add_nonce ($server_url, $timestamp, $salt)
 private More...
 
 useNonce ($server_url, $timestamp, $salt)
 
 _octify ($str)
 "Octifies" a binary string by returning a string with escaped octal bytes. More...
 
 _unoctify ($str)
 "Unoctifies" octal-escaped data from PostgreSQL and returns the resulting ASCII (possibly binary) string. More...
 
 cleanupNonces ()
 
 cleanupAssociations ()
 
- Public Member Functions inherited from Auth_OpenID_OpenIDStore
 storeAssociation ($server_url, $association)
 This method puts an Association object into storage, retrievable by server URL and handle. More...
 
 cleanupNonces ()
 
 cleanupAssociations ()
 
 cleanup ()
 
 supportsCleanup ()
 Report whether this storage supports cleanup. More...
 
 getAssociation ($server_url, $handle=null)
 This method returns an Association object from storage that matches the server URL and, if specified, handle. More...
 
 removeAssociation ($server_url, $handle)
 This method removes the matching association if it's found, and returns whether the association was removed or not. More...
 
 useNonce ($server_url, $timestamp, $salt)
 Called when using a nonce. More...
 
 reset ()
 Removes all entries from the store; implementation is optional. More...
 

Detailed Description

Definition at line 19 of file SQLiteStore.php.

Member Function Documentation

◆ _add_nonce()

Auth_OpenID_SQLiteStore::_add_nonce (   $server_url,
  $timestamp,
  $salt 
)

private

Definition at line 58 of file SQLiteStore.php.

References $timestamp.

59  {
60  // PECL SQLite extensions 1.0.3 and older (1.0.3 is the
61  // current release at the time of this writing) have a broken
62  // sqlite_escape_string function that breaks when passed the
63  // empty string. Prefixing all strings with one character
64  // keeps them unique and avoids this bug. The nonce table is
65  // write-only, so we don't have to worry about updating other
66  // functions with this same bad hack.
67  return parent::_add_nonce('x' . $server_url, $timestamp, $salt);
68  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

◆ setSQL()

Auth_OpenID_SQLiteStore::setSQL ( )

Definition at line 20 of file SQLiteStore.php.

21  {
22  $this->sql['nonce_table'] =
23  "CREATE TABLE %s (server_url VARCHAR(2047), timestamp INTEGER, ".
24  "salt CHAR(40), UNIQUE (server_url, timestamp, salt))";
25 
26  $this->sql['assoc_table'] =
27  "CREATE TABLE %s (server_url VARCHAR(2047), handle VARCHAR(255), ".
28  "secret BLOB(128), issued INTEGER, lifetime INTEGER, ".
29  "assoc_type VARCHAR(64), PRIMARY KEY (server_url, handle))";
30 
31  $this->sql['set_assoc'] =
32  "INSERT OR REPLACE INTO %s VALUES (?, ?, ?, ?, ?, ?)";
33 
34  $this->sql['get_assocs'] =
35  "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
36  "WHERE server_url = ?";
37 
38  $this->sql['get_assoc'] =
39  "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
40  "WHERE server_url = ? AND handle = ?";
41 
42  $this->sql['remove_assoc'] =
43  "DELETE FROM %s WHERE server_url = ? AND handle = ?";
44 
45  $this->sql['add_nonce'] =
46  "INSERT INTO %s (server_url, timestamp, salt) VALUES (?, ?, ?)";
47 
48  $this->sql['clean_nonce'] =
49  "DELETE FROM %s WHERE timestamp < ?";
50 
51  $this->sql['clean_assoc'] =
52  "DELETE FROM %s WHERE issued + lifetime < ?";
53  }

The documentation for this class was generated from the following file: