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

Public Member Functions

 setSQL ()
 private More...
 
 blobEncode ($blob)
 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 MySQLStore.php.

Member Function Documentation

◆ blobEncode()

Auth_OpenID_MySQLStore::blobEncode (   $blob)

private

Definition at line 72 of file MySQLStore.php.

73  {
74  return "0x" . bin2hex($blob);
75  }

◆ setSQL()

Auth_OpenID_MySQLStore::setSQL ( )

private

Definition at line 23 of file MySQLStore.php.

24  {
25  $this->sql['nonce_table'] =
26  "CREATE TABLE %s (\n".
27  " server_url VARCHAR(2047) NOT NULL,\n".
28  " timestamp INTEGER NOT NULL,\n".
29  " salt CHAR(40) NOT NULL,\n".
30  " UNIQUE (server_url(255), timestamp, salt)\n".
31  ") ENGINE=InnoDB";
32 
33  $this->sql['assoc_table'] =
34  "CREATE TABLE %s (\n".
35  " server_url BLOB NOT NULL,\n".
36  " handle VARCHAR(255) NOT NULL,\n".
37  " secret BLOB NOT NULL,\n".
38  " issued INTEGER NOT NULL,\n".
39  " lifetime INTEGER NOT NULL,\n".
40  " assoc_type VARCHAR(64) NOT NULL,\n".
41  " PRIMARY KEY (server_url(255), handle)\n".
42  ") ENGINE=InnoDB";
43 
44  $this->sql['set_assoc'] =
45  "REPLACE INTO %s (server_url, handle, secret, issued,\n".
46  " lifetime, assoc_type) VALUES (?, ?, !, ?, ?, ?)";
47 
48  $this->sql['get_assocs'] =
49  "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
50  "WHERE server_url = ?";
51 
52  $this->sql['get_assoc'] =
53  "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
54  "WHERE server_url = ? AND handle = ?";
55 
56  $this->sql['remove_assoc'] =
57  "DELETE FROM %s WHERE server_url = ? AND handle = ?";
58 
59  $this->sql['add_nonce'] =
60  "INSERT INTO %s (server_url, timestamp, salt) VALUES (?, ?, ?)";
61 
62  $this->sql['clean_nonce'] =
63  "DELETE FROM %s WHERE timestamp < ?";
64 
65  $this->sql['clean_assoc'] =
66  "DELETE FROM %s WHERE issued + lifetime < ?";
67  }

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