You are here

function theme_cas_service_validate_failure in CAS 7

Same name and namespace in other branches
  1. 6.3 cas_server.response.inc \theme_cas_service_validate_failure()

Returns a CAS 2.0 service response for a validation failure.

Parameters

$variables: An associative array containing the keys 'ticket' and 'error_code'.

2 theme calls to theme_cas_service_validate_failure()
cas_server_service_validate in ./cas_server.module
serviceValidate method using cas 2.0 Returns data in xml
cas_test_service_validate in tests/cas_test.module
Validate a ticket using the CAS 2.0 and CAS 3.0 protocols.

File

./cas_server.response.inc, line 83
Response callbacks for the CAS Server module.

Code

function theme_cas_service_validate_failure($variables) {
  $ticket = $variables['ticket'];
  $error_code = $variables['error_code'];
  $output = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>\n";
  $output .= "<cas:authenticationFailure code=\"{$error_code}\">\n";
  $output .= "Ticket {$ticket} not recognized.\n";
  $output .= "</cas:authenticationFailure>\n";
  $output .= "</cas:serviceResponse>\n";
  return $output;
}