You are here

function theme_cas_service_validate_success in CAS 7

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

Returns a CAS 2.0 service response for a validation success.

Parameters

$variables: An associative array containing the keys:

  • 'name': CAS username.
  • 'attributes': (optional) CAS attributes.
2 theme calls to theme_cas_service_validate_success()
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 16
Response callbacks for the CAS Server module.

Code

function theme_cas_service_validate_success($variables) {
  $cas_name = $variables['name'];
  $output = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>\n";
  $output .= "<cas:authenticationSuccess>\n";
  $output .= "<cas:user>{$cas_name}</cas:user>\n";
  $output .= theme('cas_service_validate_attributes', $variables);
  $output .= "</cas:authenticationSuccess>\n";
  $output .= "</cas:serviceResponse>\n";
  return $output;
}