ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
tickets.php
Go to the documentation of this file.
1 <?php
2 
3 function storeTicket($ticket, $path, $value ) {
4 
5  if (!is_dir($path))
6  throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. ');
7 
8  if (!is_writable($path))
9  throw new Exception('Directory for CAS Server ticket storage [' . $path . '] is not writable. ');
10 
11  $filename = $path . '/' . $ticket;
12  file_put_contents($filename, serialize($value));
13 }
14 
15 function retrieveTicket($ticket, $path, $unlink = true) {
16 
17  if (!preg_match('/^(ST|PT|PGT)-?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket');
18 
19  if (!is_dir($path))
20  throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. ');
21 
22  $filename = $path . '/' . $ticket;
23 
24  if (!file_exists($filename))
25  throw new Exception('Could not find ticket');
26 
27  $content = file_get_contents($filename);
28 
29  if ($unlink) {
30  unlink($filename);
31  }
32 
33  return unserialize($content);
34 }
35 
37  foreach ($legal_service_urls AS $legalurl) {
38  if (strpos($service, $legalurl) === 0) return TRUE;
39  }
40  return FALSE;
41 }
checkServiceURL($service, array $legal_service_urls)
Definition: tickets.php:36
$service
Definition: login.php:15
retrieveTicket($ticket, $path, $unlink=true)
Definition: tickets.php:15
Create styles array
The data for the language used.
$legal_service_urls
Definition: login.php:23
storeTicket($ticket, $path, $value)
Definition: tickets.php:3