function cas_test_service_validate in CAS 6.3
Same name and namespace in other branches
- 7 tests/cas_test.module \cas_test_service_validate()
Validate a ticket using the CAS 2.0 protocol.
1 string reference to 'cas_test_service_validate'
- cas_test_menu in tests/
cas_test.module - Implements hook_menu().
File
- tests/
cas_test.module, line 156 - Dummy module implementing a CAS Server.
Code
function cas_test_service_validate() {
// Prevent this page from being cached.
global $conf;
$conf['cache'] = FALSE;
// Set content type.
drupal_set_header('Content-Type: text/xml; charset=utf-8');
$ticket = $_GET['ticket'];
$service = $_GET['service'];
if ($cas_user = _cas_test_ticket_validate($service, $ticket)) {
print theme('cas_service_validate_success', $cas_user['name'], $cas_user['attributes']);
}
else {
$error_code = !$ticket || !$service ? 'INVALID_REQUEST' : 'INVALID_TICKET';
print theme('cas_service_validate_failure', $ticket, $error_code);
}
exit;
}