function _cas_server_save_ticket in CAS 6.2
Same name and namespace in other branches
- 5.4 cas_server.module \_cas_server_save_ticket()
- 5.3 cas_server.module \_cas_server_save_ticket()
- 6.3 cas_server.module \_cas_server_save_ticket()
- 7 cas_server.module \_cas_server_save_ticket()
Generate a one time use login ticket for the user in question.
Parameters
int $uid:
1 call to _cas_server_save_ticket()
File
- ./
cas_server.module, line 165 - Provides a protocol compliant version of CAS server 2.x
Code
function _cas_server_save_ticket($uid, $service) {
// Generate the ticket
$time = time();
$ticket = 'ST-' . user_password();
$ticket_data = array(
$uid,
$service,
$ticket,
$time,
);
// Save the ticket to the db
if ($uid && $service) {
db_query("INSERT INTO {cas_server_tickets} (uid, service, ticket, timestamp) VALUES (%d, '%s', '%s', %d)", $ticket_data);
}
return $ticket;
}