phpCAS  version 1.4.0
Modules | Namespaces | Functions | Variables

Modules

 PGT storage in a database
 
 PGT storage on the filesystem
 

Namespaces

 PhpCAS
 

Functions

 CAS_Client::_initPGTStorage ()
 
 CAS_Client::_storePGT ($pgt, $pgt_iou)
 
 CAS_Client::_loadPGT ($pgt_iou)
 
 CAS_Client::setPGTStorage ($storage)
 
 CAS_Client::setPGTStorageDb ( $dsn_or_pdo, $username='', $password='', $table='', $driver_options=null)
 
 CAS_Client::setPGTStorageFile ($path='')
 
 CAS_Client::_validatePGT (&$validate_url, $text_response, $tree_response)
 
 CAS_Client::retrievePT ($target_service, &$err_code, &$err_msg)
 
 CAS_PGTStorage_AbstractStorage::__construct ($cas_parent)
 
 CAS_PGTStorage_AbstractStorage::getStorageType ()
 
 CAS_PGTStorage_AbstractStorage::getStorageInfo ()
 
 CAS_PGTStorage_AbstractStorage::setErrorMessage ($error_message)
 
 CAS_PGTStorage_AbstractStorage::getErrorMessage ()
 
 CAS_PGTStorage_AbstractStorage::isInitialized ()
 
 CAS_PGTStorage_AbstractStorage::init ()
 
 CAS_PGTStorage_AbstractStorage::write ($pgt, $pgt_iou)
 
 CAS_PGTStorage_AbstractStorage::read ($pgt_iou)
 

Variables

 CAS_Client::$_pgt_storage = null
 
 CAS_PGTStorage_AbstractStorage::$_error_message
 
 CAS_PGTStorage_AbstractStorage::$_initialized
 

Detailed Description

Function Documentation

◆ __construct()

CAS_PGTStorage_AbstractStorage::__construct (   $cas_parent)
protected

The constructor of the class, should be called only by inherited classes.

Parameters
CAS_Client$cas_parentthe CAS _client instance that creates the current object.
Returns
void

Definition at line 67 of file AbstractStorage.php.

References phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

◆ _initPGTStorage()

CAS_Client::_initPGTStorage ( )
private

This method is used to initialize the storage of PGT's. Halts on error.

Returns
void

Definition at line 2672 of file Client.php.

References CAS_Client\setPGTStorageFile().

Referenced by CAS_Client\_loadPGT(), and CAS_Client\_storePGT().

◆ _loadPGT()

CAS_Client::_loadPGT (   $pgt_iou)
private

This method reads a PGT from its Iou and deletes the corresponding storage entry.

Parameters
string$pgt_iouthe PGT Iou
Returns
string mul The PGT corresponding to the Iou, false when not found.

Definition at line 2707 of file Client.php.

References CAS_Client\_initPGTStorage().

Referenced by CAS_Client\_validatePGT().

◆ _storePGT()

CAS_Client::_storePGT (   $pgt,
  $pgt_iou 
)
private

This method stores a PGT. Halts on error.

Parameters
string$pgtthe PGT to store
string$pgt_iouits corresponding Iou
Returns
void

Definition at line 2691 of file Client.php.

References CAS_Client\_initPGTStorage().

◆ _validatePGT()

CAS_Client::_validatePGT ( $validate_url,
  $text_response,
  $tree_response 
)
private

This method is used to validate a PGT; halt on failure.

Parameters
string&$validate_urlthe URL of the request to the CAS server.
string$text_responsethe response of the CAS server, as is (XML text); result of CAS_Client::validateCAS10() or CAS_Client::validateCAS20().
DOMElement$tree_responsethe response of the CAS server, as a DOM XML tree; result of CAS_Client::validateCAS10() or CAS_Client::validateCAS20().
Returns
bool true when successfull and issue a CAS_AuthenticationException and false on an error
Exceptions
CAS_AuthenticationException

Definition at line 2823 of file Client.php.

References CAS_Client\_loadPGT(), CAS_Client\_setPGT(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\isAuthenticated().

◆ getErrorMessage()

CAS_PGTStorage_AbstractStorage::getErrorMessage ( )

This method returns an error message set by PGTStorage::setErrorMessage().

Returns
string an error message when set by PGTStorage::setErrorMessage(), FALSE otherwise.
Deprecated:
not used.

Definition at line 144 of file AbstractStorage.php.

References CAS_PGTStorage_AbstractStorage\$_error_message.

◆ getStorageInfo()

CAS_PGTStorage_AbstractStorage::getStorageInfo ( )

This virtual method returns an informational string giving informations on the parameters of the storage.(used for debugging purposes).

Returns
string

Definition at line 103 of file AbstractStorage.php.

References phpCAS\error().

◆ getStorageType()

CAS_PGTStorage_AbstractStorage::getStorageType ( )

This virtual method returns an informational string giving the type of storage used by the object (used for debugging purposes).

Returns
string

Definition at line 90 of file AbstractStorage.php.

References phpCAS\error().

◆ init()

CAS_PGTStorage_AbstractStorage::init ( )

This virtual method initializes the object.

Returns
void

Definition at line 178 of file AbstractStorage.php.

◆ isInitialized()

CAS_PGTStorage_AbstractStorage::isInitialized ( )
protected

This method tells if the storage has already been intialized.

Returns
bool

Definition at line 168 of file AbstractStorage.php.

References CAS_PGTStorage_AbstractStorage\$_initialized.

Referenced by CAS_PGTStorage_Db\createTable(), CAS_PGTStorage_File\init(), and CAS_PGTStorage_Db\init().

◆ read()

CAS_PGTStorage_AbstractStorage::read (   $pgt_iou)

This virtual method reads a PGT corresponding to a PGT Iou and deletes the corresponding storage entry.

Parameters
string$pgt_iouthe PGT iou
Returns
string
Note
Should never be called.

Definition at line 213 of file AbstractStorage.php.

References phpCAS\error().

◆ retrievePT()

CAS_Client::retrievePT (   $target_service,
$err_code,
$err_msg 
)

This method is used to retrieve PT's from the CAS server thanks to a PGT.

Parameters
string$target_servicethe service to ask for with the PT.
int&$err_codean error code (PHPCAS_SERVICE_OK on success).
string&$err_msgan error message (empty on success).
Returns
string|false a Proxy Ticket, or false on error.

Definition at line 2877 of file Client.php.

References $cas_url, CAS_Client\_getPGT(), CAS_Client\_readURL(), CAS_Client\getServerProxyURL(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\initializeProxiedService().

◆ setErrorMessage()

CAS_PGTStorage_AbstractStorage::setErrorMessage (   $error_message)

This method sets en error message, which can be read later by PGTStorage::getErrorMessage().

Parameters
string$error_messagean error message
Returns
void
Deprecated:
not used.

Definition at line 131 of file AbstractStorage.php.

◆ setPGTStorage()

CAS_Client::setPGTStorage (   $storage)

This method can be used to set a custom PGT storage object.

Parameters
CAS_PGTStorage_AbstractStorage$storagea PGT storage object that inherits from the CAS_PGTStorage_AbstractStorage class
Returns
void

Definition at line 2723 of file Client.php.

References CAS_Client\ensureIsProxy(), and phpCAS\error().

Referenced by CAS_Client\setPGTStorageDb(), and CAS_Client\setPGTStorageFile().

◆ setPGTStorageDb()

CAS_Client::setPGTStorageDb (   $dsn_or_pdo,
  $username = '',
  $password = '',
  $table = '',
  $driver_options = null 
)

This method is used to tell phpCAS to store the response of the CAS server to PGT requests in a database.

Parameters
string | PDO$dsn_or_pdoa dsn string to use for creating a PDO object or a PDO object
string$usernamethe username to use when connecting to the database
string$passwordthe password to use when connecting to the database
string$tablethe table to use for storing and retrieving PGTs
string$driver_optionsany driver options to use when connecting to the database
Returns
void

Definition at line 2758 of file Client.php.

References $driver_options, CAS_Client\ensureIsProxy(), and CAS_Client\setPGTStorage().

◆ setPGTStorageFile()

CAS_Client::setPGTStorageFile (   $path = '')

This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem.

Parameters
string$paththe path where the PGT's should be stored
Returns
void

Definition at line 2790 of file Client.php.

References CAS_Client\ensureIsProxy(), and CAS_Client\setPGTStorage().

Referenced by CAS_Client\_initPGTStorage().

◆ write()

CAS_PGTStorage_AbstractStorage::write (   $pgt,
  $pgt_iou 
)

This virtual method stores a PGT and its corresponding PGT Iuo.

Parameters
string$pgtthe PGT
string$pgt_iouthe PGT iou
Returns
void
Note
Should never be called.

Definition at line 198 of file AbstractStorage.php.

References phpCAS\error().

Variable Documentation

◆ $_error_message

CAS_PGTStorage_AbstractStorage::$_error_message

string used to store an error message. Written by PGTStorage::setErrorMessage(), read by PGTStorage::getErrorMessage().

Deprecated:
not used.

Definition at line 119 of file AbstractStorage.php.

Referenced by CAS_PGTStorage_AbstractStorage\getErrorMessage().

◆ $_initialized

CAS_PGTStorage_AbstractStorage::$_initialized

a boolean telling if the storage has already been initialized. Written by PGTStorage::init(), read by PGTStorage::isInitialized().

Definition at line 159 of file AbstractStorage.php.

Referenced by CAS_PGTStorage_AbstractStorage\isInitialized().

◆ $_pgt_storage

CAS_Client::$_pgt_storage = null
private

Definition at line 2664 of file Client.php.