phpCAS version 1.3.6

AuthenticationException.php
Go to the documentation of this file.
1 <?php
2
48 class CAS_AuthenticationException
49 extends RuntimeException
50 implements CAS_Exception
51 {
52
68 public function __construct($client,$failure,$cas_url,$no_response,
69 $bad_response='',$cas_response='',$err_code='',$err_msg=''
70 ) {
71 $messages = array();
72 phpCAS::traceBegin();
73 $lang = $client->getLangObj();
74 $client->printHTMLHeader($lang->getAuthenticationFailed());
75 printf(
76 $lang->getYouWereNotAuthenticated(),
77 htmlentities($client->getURL()),
78 isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
79 );
80 phpCAS::trace($messages[] = 'CAS URL: '.$cas_url);
81 phpCAS::trace($messages[] = 'Authentication failure: '.$failure);
82 if ( $no_response ) {
83 phpCAS::trace($messages[] = 'Reason: no response from the CAS server');
84 } else {
85 if ( $bad_response ) {
86 phpCAS::trace($messages[] = 'Reason: bad response from the CAS server');
87 } else {
88 switch ($client->getServerVersion()) {
89 case CAS_VERSION_1_0:
90 phpCAS::trace($messages[] = 'Reason: CAS error');
91 break;
92 case CAS_VERSION_2_0:
93 case CAS_VERSION_3_0:
94 if ( empty($err_code) ) {
95 phpCAS::trace($messages[] = 'Reason: no CAS error');
96 } else {
97 phpCAS::trace($messages[] = 'Reason: ['.$err_code.'] CAS error: '.$err_msg);
98 }
99 break;
100 }
101 }
102 phpCAS::trace($messages[] = 'CAS response: '.$cas_response);
103 }
104 $client->printHTMLFooter();
105 phpCAS::traceExit();
106
107 parent::__construct(implode("\n", $messages));
108 }
109
110 }
111 ?>
CAS_VERSION_1_0
const CAS_VERSION_1_0
Definition: CAS.php:74
$cas_url
$cas_url
Definition: config.example.php:89
phpCAS\traceExit
static traceExit()
Definition: CAS.php:661
CAS_VERSION_3_0
const CAS_VERSION_3_0
Definition: CAS.php:82
phpCAS\trace
static trace($str)
Definition: CAS.php:579
$client
$client
Definition: create_pgt_storage_db_table.php:30
CAS_AuthenticationException\__construct
__construct($client, $failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='')
Definition: AuthenticationException.php:68
CAS_VERSION_2_0
const CAS_VERSION_2_0
Definition: CAS.php:78
phpCAS\traceBegin
static traceBegin()
Definition: CAS.php:591
CAS_Exception
Definition: Exception.php:55
CAS_AuthenticationException
Definition: AuthenticationException.php:48