ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
+ Collaboration diagram for Callback from the CAS server:

Functions

 CASClient::setCallbackMode ($callback_mode)
 This method sets/unsets callback mode. More...
 
 CASClient::isCallbackMode ()
 This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise. More...
 
 CASClient::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...
 
 CASClient::setCallbackURL ($url)
 This method sets the callback url. More...
 
 CASClient::callback ()
 This method is called by CASClient::CASClient() when running in callback mode. More...
 

Variables

 CASClient::$_callback_mode
 each PHP script using phpCAS in proxy mode is its own callback to get the PGT back from the CAS server. More...
 
 CASClient::$_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()

CASClient::callback ( )
private

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

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

Definition at line 1849 of file client.php.

References $_GET, exit, CASClient\printHTMLFooter(), CASClient\printHTMLHeader(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().

Referenced by CASClient\wasPreviouslyAuthenticated().

1850  {
1852  $this->printHTMLHeader('phpCAS callback');
1853  $pgt_iou = $_GET['pgtIou'];
1854  $pgt = $_GET['pgtId'];
1855  phpCAS::trace('Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\')');
1856  echo '<p>Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\').</p>';
1857  $this->storePGT($pgt,$pgt_iou);
1858  $this->printHTMLFooter();
1860  exit();
1861  }
exit
Definition: login.php:54
$_GET["client_id"]
printHTMLHeader($title)
This method prints the header of the HTML output (after filtering).
Definition: client.php:108
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
printHTMLFooter()
This method prints the footer of the HTML output (after filtering).
Definition: client.php:136
trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:569
traceExit()
This method is used to indicate the end of the execution of the program.
Definition: CAS.php:617
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCallbackURL()

CASClient::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 1796 of file client.php.

References CASClient\$_callback_url, CASClient\isHttps(), and CASClient\setCallbackURL().

Referenced by CASClient\validatePT(), and CASClient\validateST().

1797  {
1798  // the URL is built when needed only
1799  if ( empty($this->_callback_url) ) {
1800  $final_uri = '';
1801  // remove the ticket if present in the URL
1802  $final_uri = 'https://';
1803  /* replaced by Julien Marchal - v0.4.6
1804  * $this->uri .= $_SERVER['SERVER_NAME'];
1805  */
1806  if(empty($_SERVER['HTTP_X_FORWARDED_SERVER'])){
1807  /* replaced by teedog - v0.4.12
1808  * $final_uri .= $_SERVER['SERVER_NAME'];
1809  */
1810  if (empty($_SERVER['SERVER_NAME'])) {
1811  $final_uri .= $_SERVER['HTTP_HOST'];
1812  } else {
1813  $final_uri .= $_SERVER['SERVER_NAME'];
1814  }
1815  } else {
1816  $final_uri .= $_SERVER['HTTP_X_FORWARDED_SERVER'];
1817  }
1818  if ( ($this->isHttps() && $_SERVER['SERVER_PORT']!=443)
1819  || (!$this->isHttps() && $_SERVER['SERVER_PORT']!=80) ) {
1820  $final_uri .= ':';
1821  $final_uri .= $_SERVER['SERVER_PORT'];
1822  }
1823  $request_uri = $_SERVER['REQUEST_URI'];
1824  $request_uri = preg_replace('/\?.*$/','',$request_uri);
1825  $final_uri .= $request_uri;
1826  $this->setCallbackURL($final_uri);
1827  }
1828  return $this->_callback_url;
1829  }
setCallbackURL($url)
This method sets the callback url.
Definition: client.php:1838
$_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:1785
isHttps()
This method checks to see if the request is secured via HTTPS.
Definition: client.php:547
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCallbackMode()

CASClient::isCallbackMode ( )
private

This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise.

Returns
A boolean.

Definition at line 1772 of file client.php.

References CASClient\$_callback_mode.

Referenced by CASClient\CASClient(), and CASClient\wasPreviouslyAuthenticated().

1773  {
1774  return $this->_callback_mode;
1775  }
$_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:1750
+ Here is the caller graph for this function:

◆ setCallbackMode()

CASClient::setCallbackMode (   $callback_mode)
private

This method sets/unsets callback mode.

Parameters
$callback_modeTRUE to set callback mode, FALSE otherwise.

Definition at line 1759 of file client.php.

Referenced by CASClient\CASClient().

1760  {
1761  $this->_callback_mode = $callback_mode;
1762  }
+ Here is the caller graph for this function:

◆ setCallbackURL()

CASClient::setCallbackURL (   $url)
private

This method sets the callback url.

Parameters
$callback_urlurl to set callback

Definition at line 1838 of file client.php.

Referenced by CASClient\getCallbackURL().

1839  {
1840  return $this->_callback_url = $url;
1841  }
+ Here is the caller graph for this function:

Variable Documentation

◆ $_callback_mode

CASClient::$_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 CASClient::setCallBackMode(), read by CASClient::isCallbackMode().

Definition at line 1750 of file client.php.

Referenced by CASClient\hasPGT(), and CASClient\isCallbackMode().

◆ $_callback_url

CASClient::$_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 CASClient::getCallbackURL().

Definition at line 1785 of file client.php.

Referenced by CASClient\getCallbackURL(), and CASClient\isCallbackMode().