ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Initialization
+ Collaboration diagram for Initialization:

Functions

static phpCAS::client ($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
 phpCAS client initializer. More...
 
static phpCAS::proxy ($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
 phpCAS proxy initializer. More...
 
static phpCAS::isInitialized ()
 Answer whether or not the client or proxy has been initialized. More...
 

Detailed Description

Function Documentation

◆ client()

static phpCAS::client (   $server_version,
  $server_hostname,
  $server_port,
  $server_uri,
  $changeSessionID = true 
)
static

phpCAS client initializer.

Parameters
string$server_versionthe version of the CAS server
string$server_hostnamethe hostname of the CAS server
string$server_portthe port the CAS server is running on
string$server_urithe URI the CAS server is responding on
bool$changeSessionIDAllow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
Returns
a newly created CAS_Client object
Note
Only one of the phpCAS::client() and phpCAS::proxy functions should be called, only once, and before all other methods (except phpCAS::getVersion() and phpCAS::setDebug()).

Definition at line 338 of file CAS.php.

340 {
342 if (is_object(self::$_PHPCAS_CLIENT)) {
343 phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')');
344 }
345
346 // store where the initializer is called from
347 $dbg = debug_backtrace();
348 self::$_PHPCAS_INIT_CALL = array (
349 'done' => true,
350 'file' => $dbg[0]['file'],
351 'line' => $dbg[0]['line'],
352 'method' => __CLASS__ . '::' . __FUNCTION__
353 );
354
355 // initialize the object $_PHPCAS_CLIENT
356 try {
357 self::$_PHPCAS_CLIENT = new CAS_Client(
358 $server_version, false, $server_hostname, $server_port, $server_uri,
359 $changeSessionID
360 );
361 } catch (Exception $e) {
362 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
363 }
365 }
The CAS_Client class is a client interface that provides CAS authentication to PHP applications.
Definition: Client.php:52
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:638
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
Definition: CAS.php:591
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:543

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

Referenced by ilCASAuth\__construct(), ilAuthProviderCAS\doAuthentication(), and ilAuthContainerCAS\initCAS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInitialized()

static phpCAS::isInitialized ( )
static

Answer whether or not the client or proxy has been initialized.

Returns
bool

Definition at line 416 of file CAS.php.

417 {
418 return (is_object(self::$_PHPCAS_CLIENT));
419 }

◆ proxy()

static phpCAS::proxy (   $server_version,
  $server_hostname,
  $server_port,
  $server_uri,
  $changeSessionID = true 
)
static

phpCAS proxy initializer.

Parameters
string$server_versionthe version of the CAS server
string$server_hostnamethe hostname of the CAS server
string$server_portthe port the CAS server is running on
string$server_urithe URI the CAS server is responding on
bool$changeSessionIDAllow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
Returns
a newly created CAS_Client object
Note
Only one of the phpCAS::client() and phpCAS::proxy functions should be called, only once, and before all other methods (except phpCAS::getVersion() and phpCAS::setDebug()).

Definition at line 382 of file CAS.php.

384 {
386 if (is_object(self::$_PHPCAS_CLIENT)) {
387 phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')');
388 }
389
390 // store where the initialzer is called from
391 $dbg = debug_backtrace();
392 self::$_PHPCAS_INIT_CALL = array (
393 'done' => true,
394 'file' => $dbg[0]['file'],
395 'line' => $dbg[0]['line'],
396 'method' => __CLASS__ . '::' . __FUNCTION__
397 );
398
399 // initialize the object $_PHPCAS_CLIENT
400 try {
401 self::$_PHPCAS_CLIENT = new CAS_Client(
402 $server_version, true, $server_hostname, $server_port, $server_uri,
403 $changeSessionID
404 );
405 } catch (Exception $e) {
406 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
407 }
409 }

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

+ Here is the call graph for this function: