ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_SQLiteStore Class Reference
+ Inheritance diagram for Auth_OpenID_SQLiteStore:
+ Collaboration diagram for Auth_OpenID_SQLiteStore:

Public Member Functions

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

Detailed Description

Definition at line 19 of file SQLiteStore.php.

Member Function Documentation

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

private

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 58 of file SQLiteStore.php.

References $timestamp.

{
// PECL SQLite extensions 1.0.3 and older (1.0.3 is the
// current release at the time of this writing) have a broken
// sqlite_escape_string function that breaks when passed the
// empty string. Prefixing all strings with one character
// keeps them unique and avoids this bug. The nonce table is
// write-only, so we don't have to worry about updating other
// functions with this same bad hack.
return parent::_add_nonce('x' . $server_url, $timestamp, $salt);
}
Auth_OpenID_SQLiteStore::setSQL ( )

This method should be overridden by subclasses.

This method is called by the constructor to set values in $this->sql, which is an array keyed on sql name.

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 20 of file SQLiteStore.php.

{
$this->sql['nonce_table'] =
"CREATE TABLE %s (server_url VARCHAR(2047), timestamp INTEGER, ".
"salt CHAR(40), UNIQUE (server_url, timestamp, salt))";
$this->sql['assoc_table'] =
"CREATE TABLE %s (server_url VARCHAR(2047), handle VARCHAR(255), ".
"secret BLOB(128), issued INTEGER, lifetime INTEGER, ".
"assoc_type VARCHAR(64), PRIMARY KEY (server_url, handle))";
$this->sql['set_assoc'] =
"INSERT OR REPLACE INTO %s VALUES (?, ?, ?, ?, ?, ?)";
$this->sql['get_assocs'] =
"SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
"WHERE server_url = ?";
$this->sql['get_assoc'] =
"SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
"WHERE server_url = ? AND handle = ?";
$this->sql['remove_assoc'] =
"DELETE FROM %s WHERE server_url = ? AND handle = ?";
$this->sql['add_nonce'] =
"INSERT INTO %s (server_url, timestamp, salt) VALUES (?, ?, ?)";
$this->sql['clean_nonce'] =
"DELETE FROM %s WHERE timestamp < ?";
$this->sql['clean_assoc'] =
"DELETE FROM %s WHERE issued + lifetime < ?";
}

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