<commit_before><?php
/*
 * Incomming parameters:
 *  url
 *  ticket
 *
 */

if (!array_key_exists('url', $_GET))
  throw new Exception('Required URL query parameter [url] not provided. (CAS Server)');

$url = $_GET['url'];

if (!array_key_exists('ticket', $_GET))
  throw new Exception('Required URL query parameter [ticket] not provided. (CAS Server)');

$ticket = $_GET['ticket'];

/* Load simpleSAMLphp, configuration and metadata */
$casconfig = SimpleSAML_Configuration::getConfig('module_sbcasserver.php');	

/* Instantiate ticket store */
$ticketStoreConfig = $casconfig->getValue('ticketstore');
$ticketStoreClass = SimpleSAML_Module::resolveClass($ticketStoreConfig['class'],'Cas_TicketStore');
$ticketStore = new $ticketStoreClass($casconfig);

$ticketStore->removeTicket($ticket);

$auth = $casconfig->getValue('auth', 'saml2');

if (!in_array($auth, array('saml2', 'shib13')))
  throw new Exception('CAS Service configured to use [auth] = ' . $auth . ' only [saml2,shib13] is legal.');

$as = new SimpleSAML_Auth_Simple($casconfig->getValue('authsource'));

SimpleSAML_Logger::debug('sbcasserver config'.var_export($as,TRUE));

if ($as->isAuthenticated()) {
  SimpleSAML_Logger::debug('sbcasserver logged out: real logout');

  $as->logout($url);
} else {<commit_msg>removed ticket validation from logout<commit_after><?php
/*
 * Incomming parameters:
 *  url
 *  ticket
 *
 */

if (!array_key_exists('url', $_GET))
  throw new Exception('Required URL query parameter [url] not provided. (CAS Server)');

$url = $_GET['url'];

/* Load simpleSAMLphp, configuration and metadata */
$casconfig = SimpleSAML_Configuration::getConfig('module_sbcasserver.php');	

$auth = $casconfig->getValue('auth', 'saml2');

if (!in_array($auth, array('saml2', 'shib13')))
  throw new Exception('CAS Service configured to use [auth] = ' . $auth . ' only [saml2,shib13] is legal.');

$as = new SimpleSAML_Auth_Simple($casconfig->getValue('authsource'));

SimpleSAML_Logger::debug('sbcasserver config'.var_export($as,TRUE));

if ($as->isAuthenticated()) {
  SimpleSAML_Logger::debug('sbcasserver logged out: real logout');

  $as->logout($url);
} else {
{'fraction_non_alphanumeric': 0.17164179104477612, 'fraction_numerical': 0.0065298507462686565, 'mean_word_length': 6.422145328719723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3180762', 'n_tokens_mistral': 719, 'n_tokens_neox': 693, 'n_words': 155}