ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
+ Collaboration diagram for Callback from the CAS server:

Functions

 CAS_Client::_setCallbackMode ($callback_mode)
 This method sets/unsets callback mode. More...
 
 CAS_Client::_isCallbackMode ()
 This method returns true when the CAs client is running i callback mode, false otherwise. More...
 
 CAS_Client::_getCallbackURL ()
 This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used). More...
 
 CAS_Client::setCallbackURL ($url)
 This method sets the callback url. More...
 
 CAS_Client::_callback ()
 This method is called by CAS_Client::CAS_Client() when running in callback mode. More...
 

Variables

 CAS_Client::$_callback_mode
 each PHP script using phpCAS in proxy mode is its own callback to get the PGT back from the CAS server. More...
 
 CAS_Client::$_callback_url
 the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter). More...
 

Detailed Description

Function Documentation

◆ _callback()

CAS_Client::_callback ( )
private

This method is called by CAS_Client::CAS_Client() when running in callback mode.

It stores the PGT and its PGT Iou, prints its output and halts.

Returns
void

Definition at line 2400 of file Client.php.

References $_GET, phpCAS\error(), CAS_Client\printHTMLFooter(), CAS_Client\printHTMLHeader(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().

Referenced by CAS_Client\_wasPreviouslyAuthenticated().

2401  {
2403  if (preg_match('/PGTIOU-[\.\-\w]/', $_GET['pgtIou'])) {
2404  if (preg_match('/[PT]GT-[\.\-\w]/', $_GET['pgtId'])) {
2405  $this->printHTMLHeader('phpCAS callback');
2406  $pgt_iou = $_GET['pgtIou'];
2407  $pgt = $_GET['pgtId'];
2408  phpCAS::trace('Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\')');
2409  echo '<p>Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\').</p>';
2410  $this->_storePGT($pgt, $pgt_iou);
2411  $this->printHTMLFooter();
2412  phpCAS::traceExit("Successfull Callback");
2413  } else {
2414  phpCAS::error('PGT format invalid' . $_GET['pgtId']);
2415  phpCAS::traceExit('PGT format invalid' . $_GET['pgtId']);
2416  }
2417  } else {
2418  phpCAS::error('PGTiou format invalid' . $_GET['pgtIou']);
2419  phpCAS::traceExit('PGTiou format invalid' . $_GET['pgtIou']);
2420  }
2421 
2422  // Flush the buffer to prevent from sending anything other then a 200
2423  // Success Status back to the CAS Server. The Exception would normally
2424  // report as a 500 error.
2425  flush();
2427  }
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
printHTMLFooter()
This method prints the footer of the HTML output (after filtering).
Definition: Client.php:129
static traceExit()
This method is used to indicate the end of the execution of the program.
Definition: CAS.php:661
$_GET["client_id"]
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:579
printHTMLHeader($title)
This method prints the header of the HTML output (after filtering).
Definition: Client.php:101
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:591
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getCallbackURL()

CAS_Client::_getCallbackURL ( )
private

This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used).

Returns
The callback URL

Definition at line 2360 of file Client.php.

References CAS_Client\$_callback_url, $_SERVER, and CAS_Client\_getClientUrl().

Referenced by CAS_Client\validateCAS20().

2361  {
2362  // the URL is built when needed only
2363  if ( empty($this->_callback_url) ) {
2364  $final_uri = '';
2365  // remove the ticket if present in the URL
2366  $final_uri = 'https://';
2367  $final_uri .= $this->_getClientUrl();
2368  $request_uri = $_SERVER['REQUEST_URI'];
2369  $request_uri = preg_replace('/\?.*$/', '', $request_uri);
2370  $final_uri .= $request_uri;
2371  $this->_callback_url = $final_uri;
2372  }
2373  return $this->_callback_url;
2374  }
_getClientUrl()
Try to figure out the phpCas client URL with possible Proxys / Ports etc.
Definition: Client.php:3577
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_callback_url
the URL that should be used for the PGT callback (in fact the URL of the current request without any ...
Definition: Client.php:2351
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isCallbackMode()

CAS_Client::_isCallbackMode ( )
private

This method returns true when the CAs client is running i callback mode, false otherwise.

Returns
A boolean.

Definition at line 2339 of file Client.php.

References CAS_Client\$_callback_mode.

Referenced by CAS_Client\__construct(), and CAS_Client\_wasPreviouslyAuthenticated().

2340  {
2341  return $this->_callback_mode;
2342  }
$_callback_mode
each PHP script using phpCAS in proxy mode is its own callback to get the PGT back from the CAS serve...
Definition: Client.php:2319
+ Here is the caller graph for this function:

◆ _setCallbackMode()

CAS_Client::_setCallbackMode (   $callback_mode)
private

This method sets/unsets callback mode.

Parameters
bool$callback_modetrue to set callback mode, false otherwise.
Returns
void

Definition at line 2328 of file Client.php.

Referenced by CAS_Client\__construct().

2329  {
2330  $this->_callback_mode = $callback_mode;
2331  }
+ Here is the caller graph for this function:

◆ setCallbackURL()

CAS_Client::setCallbackURL (   $url)

This method sets the callback url.

Parameters
string$urlurl to set callback
Returns
void

Definition at line 2383 of file Client.php.

References $url, and CAS_Client\ensureIsProxy().

2384  {
2385  // Sequence validation
2386  $this->ensureIsProxy();
2387  // Argument Validation
2388  if (gettype($url) != 'string')
2389  throw new CAS_TypeMismatchException($url, '$url', 'string');
2390 
2391  return $this->_callback_url = $url;
2392  }
$url
Definition: shib_logout.php:72
ensureIsProxy()
Ensure that this is actually a proxy object or fail with an exception.
Definition: Client.php:745
+ Here is the call graph for this function:

Variable Documentation

◆ $_callback_mode

CAS_Client::$_callback_mode
private

each PHP script using phpCAS in proxy mode is its own callback to get the PGT back from the CAS server.

callback_mode is detected by the constructor thanks to the GET parameters. a boolean to know if the CAS client is running in callback mode. Written by CAS_Client::setCallBackMode(), read by CAS_Client::_isCallbackMode().

Definition at line 2319 of file Client.php.

Referenced by CAS_Client\_isCallbackMode().

◆ $_callback_url

CAS_Client::$_callback_url
private

the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter).

Written and read by CAS_Client::_getCallbackURL().

Definition at line 2351 of file Client.php.

Referenced by CAS_Client\_getCallbackURL().