ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
+ 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 2461 of file Client.php.

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

Referenced by CAS_Client\_wasPreviouslyAuthenticated().

2462  {
2464  if (preg_match('/PGTIOU-[\.\-\w]/', $_GET['pgtIou'])) {
2465  if (preg_match('/[PT]GT-[\.\-\w]/', $_GET['pgtId'])) {
2466  $this->printHTMLHeader('phpCAS callback');
2467  $pgt_iou = $_GET['pgtIou'];
2468  $pgt = $_GET['pgtId'];
2469  phpCAS::trace('Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\')');
2470  echo '<p>Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\').</p>';
2471  $this->_storePGT($pgt, $pgt_iou);
2472  $this->printHTMLFooter();
2473  phpCAS::traceExit("Successfull Callback");
2474  } else {
2475  phpCAS::error('PGT format invalid' . $_GET['pgtId']);
2476  phpCAS::traceExit('PGT format invalid' . $_GET['pgtId']);
2477  }
2478  } else {
2479  phpCAS::error('PGTiou format invalid' . $_GET['pgtIou']);
2480  phpCAS::traceExit('PGTiou format invalid' . $_GET['pgtIou']);
2481  }
2482 
2483  // Flush the buffer to prevent from sending anything other then a 200
2484  // Success Status back to the CAS Server. The Exception would normally
2485  // report as a 500 error.
2486  flush();
2488  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
printHTMLFooter()
This method prints the footer of the HTML output (after filtering).
Definition: Client.php:130
static traceExit()
This method is used to indicate the end of the execution of the program.
Definition: CAS.php:681
$_GET["client_id"]
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:599
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:611
_storePGT($pgt, $pgt_iou)
This method stores a PGT.
Definition: Client.php:2535
+ 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 2420 of file Client.php.

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

Referenced by CAS_Client\validateCAS20().

2421  {
2422  // the URL is built when needed only
2423  if (empty($this->_callback_url)) {
2424  $final_uri = '';
2425  // remove the ticket if present in the URL
2426  $final_uri = 'https://';
2427  $final_uri .= $this->_getClientUrl();
2428  $request_uri = $_SERVER['REQUEST_URI'];
2429  $request_uri = preg_replace('/\?.*$/', '', $request_uri);
2430  $final_uri .= $request_uri;
2431  $this->_callback_url = $final_uri;
2432  }
2433  return $this->_callback_url;
2434  }
_getClientUrl()
Try to figure out the phpCas client URL with possible Proxys / Ports etc.
Definition: Client.php:3702
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:2411
+ 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 2399 of file Client.php.

References CAS_Client\$_callback_mode.

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

2400  {
2401  return $this->_callback_mode;
2402  }
$_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:2379
+ 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 2388 of file Client.php.

Referenced by CAS_Client\__construct().

2389  {
2390  $this->_callback_mode = $callback_mode;
2391  }
+ 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 2443 of file Client.php.

References $url, and CAS_Client\ensureIsProxy().

2444  {
2445  // Sequence validation
2446  $this->ensureIsProxy();
2447  // Argument Validation
2448  if (gettype($url) != 'string') {
2449  throw new CAS_TypeMismatchException($url, '$url', 'string');
2450  }
2451 
2452  return $this->_callback_url = $url;
2453  }
ensureIsProxy()
Ensure that this is actually a proxy object or fail with an exception.
Definition: Client.php:754
$url
+ 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 2379 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 2411 of file Client.php.

Referenced by CAS_Client\_getCallbackURL().