You are here

function _cas_test_ticket_validate in CAS 7

Same name and namespace in other branches
  1. 6.3 tests/cas_test.module \_cas_test_ticket_validate()

Validate a one-time-use login ticket.

Parameters

$service: The service URL.

$ticket: The login or proxy ticket.

Return value

The CAS username corresponding to the ticket, or FALSE if the ticket is invalid.

2 calls to _cas_test_ticket_validate()
cas_test_service_validate in tests/cas_test.module
Validate a ticket using the CAS 2.0 and CAS 3.0 protocols.
cas_test_validate in tests/cas_test.module
Validate a ticket using the CAS 1.x protocol.

File

tests/cas_test.module, line 248
Dummy module implementing a CAS Server.

Code

function _cas_test_ticket_validate($service, $ticket) {

  // Look up the ticket
  $cas_name = FALSE;
  $tickets = variable_get('cas_test_tickets', array());
  if (isset($tickets[$service][$ticket])) {
    $cas_name = $tickets[$service][$ticket];
    unset($tickets[$service][$ticket]);
  }
  return $cas_name;
}