ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CAS_AuthenticationException Class Reference

This interface defines methods that allow proxy-authenticated service handlers to interact with phpCAS. More...

+ Inheritance diagram for CAS_AuthenticationException:
+ Collaboration diagram for CAS_AuthenticationException:

Public Member Functions

 __construct ( $client, $failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='')
 This method is used to print the HTML output when the user was not authenticated. More...
 

Detailed Description

This interface defines methods that allow proxy-authenticated service handlers to interact with phpCAS.

Proxy service handlers must implement this interface as well as call phpCAS::initializeProxiedService($this) at some point in their implementation.

While not required, proxy-authenticated service handlers are encouraged to implement the CAS_ProxiedService_Testable interface to facilitate unit testing.

Definition at line 48 of file AuthenticationException.php.

Constructor & Destructor Documentation

◆ __construct()

CAS_AuthenticationException::__construct (   $client,
  $failure,
  $cas_url,
  $no_response,
  $bad_response = '',
  $cas_response = '',
  $err_code = '',
  $err_msg = '' 
)

This method is used to print the HTML output when the user was not authenticated.

Parameters
CAS_Client$clientphpcas client
string$failurethe failure that occured
string$cas_urlthe URL the CAS server was asked for
bool$no_responsethe response from the CAS server (other parameters are ignored if TRUE)
bool$bad_responsebad response from the CAS server ($err_code and $err_msg ignored if TRUE)
string$cas_responsethe response of the CAS server
int$err_codethe error code given by the CAS server
string$err_msgthe error message given by the CAS server

Definition at line 66 of file AuthenticationException.php.

References $_SERVER, $client, $failure, $lang, $messages, CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().

75  {
76  $messages = array();
78  $lang = $client->getLangObj();
79  $client->printHTMLHeader($lang->getAuthenticationFailed());
80  printf(
81  $lang->getYouWereNotAuthenticated(),
82  htmlentities($client->getURL()),
83  isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
84  );
85  phpCAS::trace($messages[] = 'CAS URL: ' . $cas_url);
86  phpCAS::trace($messages[] = 'Authentication failure: ' . $failure);
87  if ($no_response) {
88  phpCAS::trace($messages[] = 'Reason: no response from the CAS server');
89  } else {
90  if ($bad_response) {
91  phpCAS::trace($messages[] = 'Reason: bad response from the CAS server');
92  } else {
93  switch ($client->getServerVersion()) {
94  case CAS_VERSION_1_0:
95  phpCAS::trace($messages[] = 'Reason: CAS error');
96  break;
97  case CAS_VERSION_2_0:
98  case CAS_VERSION_3_0:
99  if (empty($err_code)) {
100  phpCAS::trace($messages[] = 'Reason: no CAS error');
101  } else {
102  phpCAS::trace($messages[] = 'Reason: [' . $err_code . '] CAS error: ' . $err_msg);
103  }
104  break;
105  }
106  }
107  phpCAS::trace($messages[] = 'CAS response: ' . $cas_response);
108  }
109  $client->printHTMLFooter();
111 
112  parent::__construct(implode("\n", $messages));
113  }
$failure
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
const CAS_VERSION_1_0
CAS version 1.0.
Definition: CAS.php:74
static traceExit()
This method is used to indicate the end of the execution of the program.
Definition: CAS.php:681
const CAS_VERSION_3_0
CAS version 3.0.
Definition: CAS.php:82
if($_SERVER['argc']< 4) $client
Definition: cron.php:12
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:599
$messages
Definition: en.php:5
const CAS_VERSION_2_0
Definition: CAS.php:78
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: