TYPO3 CMS  TYPO3_6-2
Auth_OpenID_FileStore Class Reference
Inheritance diagram for Auth_OpenID_FileStore:
Auth_OpenID_OpenIDStore

Public Member Functions

 Auth_OpenID_FileStore ($directory)
 
 destroy ()
 
 _setup ()
 
 _mktemp ()
 
 cleanupNonces ()
 
 getAssociationFilename ($server_url, $handle)
 
 storeAssociation ($server_url, $association)
 
 getAssociation ($server_url, $handle=null)
 
 _getAssociation ($filename)
 
 removeAssociation ($server_url, $handle)
 
 useNonce ($server_url, $timestamp, $salt)
 
 _allAssocs ()
 
 clean ()
 
 _rmtree ($dir)
 
 _mkstemp ($dir)
 
 _listdir ($dir)
 
 _isFilenameSafe ($char)
 
 _safe64 ($str)
 
 _filenameEscape ($str)
 
 _removeIfPresent ($filename)
 
 cleanupAssociations ()
 
- Public Member Functions inherited from Auth_OpenID_OpenIDStore
 storeAssociation ($server_url, $association)
 
 cleanupNonces ()
 
 cleanupAssociations ()
 
 cleanup ()
 
 supportsCleanup ()
 
 getAssociation ($server_url, $handle=null)
 
 removeAssociation ($server_url, $handle)
 
 useNonce ($server_url, $timestamp, $salt)
 
 reset ()
 

Static Public Member Functions

static _mkdtemp ($dir)
 

Detailed Description

Definition at line 39 of file FileStore.php.

Member Function Documentation

◆ _allAssocs()

Auth_OpenID_FileStore::_allAssocs ( )

Remove expired entries from the database. This is potentially expensive, so only run when it is acceptable to take time.

private

Definition at line 414 of file FileStore.php.

References _listdir(), _removeIfPresent(), and Auth_OpenID_Association\deserialize().

Referenced by clean(), and cleanupAssociations().

◆ _filenameEscape()

Auth_OpenID_FileStore::_filenameEscape (   $str)

private

Definition at line 585 of file FileStore.php.

References _isFilenameSafe(), and Auth_OpenID\toBytes().

Referenced by getAssociationFilename(), and useNonce().

◆ _getAssociation()

Auth_OpenID_FileStore::_getAssociation (   $filename)

private

Definition at line 296 of file FileStore.php.

References _removeIfPresent(), Auth_OpenID_Association\deserialize(), and E_USER_ERROR.

Referenced by getAssociation().

◆ _isFilenameSafe()

Auth_OpenID_FileStore::_isFilenameSafe (   $char)

private

Definition at line 563 of file FileStore.php.

References Auth_OpenID_digits, and Auth_OpenID_letters.

Referenced by _filenameEscape().

◆ _listdir()

Auth_OpenID_FileStore::_listdir (   $dir)

private

Definition at line 548 of file FileStore.php.

Referenced by _allAssocs(), clean(), cleanupNonces(), and getAssociation().

◆ _mkdtemp()

static Auth_OpenID_FileStore::_mkdtemp (   $dir)
static

private

Definition at line 531 of file FileStore.php.

◆ _mkstemp()

Auth_OpenID_FileStore::_mkstemp (   $dir)

private

Definition at line 516 of file FileStore.php.

Referenced by _mktemp().

◆ _mktemp()

Auth_OpenID_FileStore::_mktemp ( )

Create a temporary file on the same filesystem as $this->association_dir.

The temporary directory should not be cleaned if there are any processes using the store. If there is no active process using the store, it is safe to remove all of the files in the temporary directory.

Returns
array ($fd, $filename) private

Definition at line 108 of file FileStore.php.

References _mkstemp(), and _removeIfPresent().

Referenced by storeAssociation().

◆ _removeIfPresent()

Auth_OpenID_FileStore::_removeIfPresent (   $filename)

Attempt to remove a file, returning whether the file existed at the time of the call.

private

Returns
bool $result True if the file was present, false if not.

Definition at line 608 of file FileStore.php.

Referenced by _allAssocs(), _getAssociation(), _mktemp(), clean(), cleanupAssociations(), cleanupNonces(), removeAssociation(), and storeAssociation().

◆ _rmtree()

Auth_OpenID_FileStore::_rmtree (   $dir)

private

Definition at line 478 of file FileStore.php.

Referenced by destroy().

◆ _safe64()

Auth_OpenID_FileStore::_safe64 (   $str)

private

Definition at line 573 of file FileStore.php.

References Auth_OpenID_SHA1().

Referenced by getAssociationFilename(), and useNonce().

◆ _setup()

Auth_OpenID_FileStore::_setup ( )

Make sure that the directories in which we store our data exist.

private

Definition at line 89 of file FileStore.php.

References Auth_OpenID\ensureDir().

Referenced by Auth_OpenID_FileStore().

◆ Auth_OpenID_FileStore()

Auth_OpenID_FileStore::Auth_OpenID_FileStore (   $directory)

Initializes a new Auth_OpenID_FileStore. This initializes the nonce and association directories, which are subdirectories of the directory passed in.

Parameters
string$directoryThis is the directory to put the store directories in.

Definition at line 49 of file FileStore.php.

References _setup(), E_USER_ERROR, and Auth_OpenID\ensureDir().

◆ clean()

Auth_OpenID_FileStore::clean ( )

◆ cleanupAssociations()

Auth_OpenID_FileStore::cleanupAssociations ( )

Definition at line 613 of file FileStore.php.

References _allAssocs(), and _removeIfPresent().

◆ cleanupNonces()

Auth_OpenID_FileStore::cleanupNonces ( )

Definition at line 119 of file FileStore.php.

References $Auth_OpenID_SKEW, _listdir(), and _removeIfPresent().

◆ destroy()

Auth_OpenID_FileStore::destroy ( )

Definition at line 77 of file FileStore.php.

References _rmtree().

◆ getAssociation()

Auth_OpenID_FileStore::getAssociation (   $server_url,
  $handle = null 
)

Retrieve an association. If no handle is specified, return the association with the most recent issue time.

Returns
mixed $association

Definition at line 232 of file FileStore.php.

References _getAssociation(), _listdir(), E_USER_ERROR, and getAssociationFilename().

Referenced by removeAssociation().

◆ getAssociationFilename()

Auth_OpenID_FileStore::getAssociationFilename (   $server_url,
  $handle 
)

Create a unique filename for a given server url and handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.

Returns
string $filename

Definition at line 150 of file FileStore.php.

References _filenameEscape(), _safe64(), and E_USER_ERROR.

Referenced by getAssociation(), removeAssociation(), and storeAssociation().

◆ removeAssociation()

Auth_OpenID_FileStore::removeAssociation (   $server_url,
  $handle 
)

Remove an association if it exists. Do nothing if it does not.

Returns
bool $success

Definition at line 347 of file FileStore.php.

References _removeIfPresent(), E_USER_ERROR, getAssociation(), and getAssociationFilename().

◆ storeAssociation()

Auth_OpenID_FileStore::storeAssociation (   $server_url,
  $association 
)

Store an association in the association directory.

Definition at line 182 of file FileStore.php.

References _mktemp(), _removeIfPresent(), E_USER_ERROR, and getAssociationFilename().

◆ useNonce()

Auth_OpenID_FileStore::useNonce (   $server_url,
  $timestamp,
  $salt 
)

Return whether this nonce is present. As a side effect, mark it as no longer present.

Returns
bool $present

Definition at line 369 of file FileStore.php.

References $Auth_OpenID_SKEW, $result, _filenameEscape(), _safe64(), and E_USER_ERROR.