\n";
$output .= "\n";
$output .= "$cas_name\n";
$output .= theme('cas_service_validate_attributes', $variables);
$output .= "\n";
$output .= "\n";
return $output;
}
/**
* Returns CAS attributes as part of a CAS 2.0 service response.
*
* @param $variables
* An associative array containing the keys 'attributes' and 'style', where
* the value of 'style' must be one of:
* - 'jasig' (default)
* - 'rubycas'
* - 'name-value'
*/
function theme_cas_service_validate_attributes($variables) {
$attributes = $variables['attributes'];
$style = $variables['style'];
$output = '';
switch ($style) {
case 'jasig':
default:
$output .= "\n";
$output .= "Jasig\n";
foreach ($attributes as $name => $values) {
foreach ((array) $values as $value) {
$output .= strtr("!value\n", array('!name' => $name, '!value' => $value));
}
}
$output .= "\n";
break;
case 'rubycas':
$output .= "RubyCAS\n";
foreach ($attributes as $name => $values) {
foreach ((array) $values as $value) {
$output .= strtr("!value\n", array('!name' => $name, '!value' => $value));
}
}
break;
case 'name-value':
$output .= "\n";
foreach ($attributes as $name => $values) {
foreach ((array) $values as $value) {
$output .= strtr("\n", array('!name' => $name, '!value' => $value));
}
}
break;
}
return $output;
}
/**
* Returns a CAS 2.0 service response for a validation failure.
*
* @param $variables
* An associative array containing the keys 'ticket' and 'error_code'.
*/
function theme_cas_service_validate_failure($variables) {
$ticket = $variables['ticket'];
$error_code = $variables['error_code'];
$output = "\n";
$output .= "\n";
$output .= "Ticket $ticket not recognized.\n";
$output .= "\n";
$output .= "\n";
return $output;
}
/**
* Returns a CAS 2.0 service response for a service not on the whitelist.
*
* @param $variables
* An associative array containing the keys 'service' and 'error_code'.
*/
function theme_cas_service_validate_whitelist_failure($variables) {
$service = $variables['service'];
$error_code = $variables['error_code'];
$output = "\n" .
"\n" .
"Service $service not recognized.\n" .
"\n" .
"\n";
return $output;
}
/**
* Generate the Single Sign Out request.
*
* @param unknown_type $variables
* An associative array containing the key, date and logout id request
*/
function theme_cas_service_logout_request($variables) {
$id = $variables['id'];
$date = $variables['date'];
$ticket = $variables['ticket'];
$output = "\n";
$output .= "@NOT_USED@\n";
$output .= "$ticket\n";
$output .= "\n";
return $output;
}