ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_PostgreSQLStore Class Reference
+ Inheritance diagram for Auth_OpenID_PostgreSQLStore:
+ Collaboration diagram for Auth_OpenID_PostgreSQLStore:

Public Member Functions

 setSQL ()
 private
 _set_assoc ($server_url, $handle, $secret, $issued, $lifetime, $assoc_type)
 private
 blobEncode ($blob)
 private
 blobDecode ($blob)
 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
 createTables ()
 create_nonce_table ()
 create_assoc_table ()
 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.
 _add_nonce ($server_url, $timestamp, $salt)
 private
 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 PostgreSQLStore.php.

Member Function Documentation

Auth_OpenID_PostgreSQLStore::_set_assoc (   $server_url,
  $handle,
  $secret,
  $issued,
  $lifetime,
  $assoc_type 
)

private

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 78 of file PostgreSQLStore.php.

References $result, and Auth_OpenID_SQLStore\_get_assoc().

{
$result = $this->_get_assoc($server_url, $handle);
if ($result) {
// Update the table since this associations already exists.
$this->connection->query($this->sql['set_assoc']['update_assoc'],
array($secret, $issued, $lifetime,
$assoc_type, $server_url, $handle));
} else {
// Insert a new record because this association wasn't
// found.
$this->connection->query($this->sql['set_assoc']['insert_assoc'],
array($server_url, $handle, $secret,
$issued, $lifetime, $assoc_type));
}
}

+ Here is the call graph for this function:

Auth_OpenID_PostgreSQLStore::blobDecode (   $blob)

private

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 107 of file PostgreSQLStore.php.

References Auth_OpenID_SQLStore\_unoctify().

{
return $this->_unoctify($blob);
}

+ Here is the call graph for this function:

Auth_OpenID_PostgreSQLStore::blobEncode (   $blob)

private

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 99 of file PostgreSQLStore.php.

References Auth_OpenID_SQLStore\_octify().

{
return $this->_octify($blob);
}

+ Here is the call graph for this function:

Auth_OpenID_PostgreSQLStore::setSQL ( )

private

Reimplemented from Auth_OpenID_SQLStore.

Definition at line 23 of file PostgreSQLStore.php.

{
$this->sql['nonce_table'] =
"CREATE TABLE %s (server_url VARCHAR(2047) NOT NULL, ".
"timestamp INTEGER NOT NULL, ".
"salt CHAR(40) NOT NULL, ".
"UNIQUE (server_url, timestamp, salt))";
$this->sql['assoc_table'] =
"CREATE TABLE %s (server_url VARCHAR(2047) NOT NULL, ".
"handle VARCHAR(255) NOT NULL, ".
"secret BYTEA NOT NULL, ".
"issued INTEGER NOT NULL, ".
"lifetime INTEGER NOT NULL, ".
"assoc_type VARCHAR(64) NOT NULL, ".
"PRIMARY KEY (server_url, handle), ".
"CONSTRAINT secret_length_constraint CHECK ".
"(LENGTH(secret) <= 128))";
$this->sql['set_assoc'] =
array(
'insert_assoc' => "INSERT INTO %s (server_url, handle, ".
"secret, issued, lifetime, assoc_type) VALUES ".
"(?, ?, '!', ?, ?, ?)",
'update_assoc' => "UPDATE %s SET secret = '!', issued = ?, ".
"lifetime = ?, assoc_type = ? WHERE server_url = ? AND ".
"handle = ?"
);
$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: