<commit_before><?php
/**
 * OpenSSO integration library for PHP
 *
 * <NAME> <<EMAIL>>
 */

require_once('config.php');

class OpenSSO {
	private $cookiename;
	private $token;
	private $err;
	private $attributes;

	function OpenSSO($fetch_cookie_name = FALSE) {
		if ($fetch_cookie_name === TRUE) {
			// Fetch cookie name
			$res = $this->identity_query(OPENSSO_COOKIE_NAME_FETCH, 'POST');
			if (isset($res->error) || $res->code != '200') {
				if (!isset($res->error)) {
					$this->error = 'HTTP result = ' . $res->code;
				} else {
					$this->error = $res->error;
				}

				return;
			}

			$this->cookiename = preg_replace('/^string=/', '', $res->data);
		} else {
			$this->cookiename = OPENSSO_COOKIE_NAME;
		}

		/*
		 * Get user token
		 *
		 * Important! Internet Explorer has a BUG (Microsoft thinks it's a
		 * feature) that makes it ignore every cookie for domains with two
		 * letters (i.e xx.yy). Let's check GET parameter
		 * iPlanetDirectoryPro
		 */

		// Forzamos carga de parámetros _GET (para IE)
		parse_str($_SERVER['QUERY_STRING'], $_GET); 

		if (!isset($_COOKIE[$this->cookiename]) &&
				isset($_GET[$this->cookiename])) {
			// Fake OpenSSO cookie...
			$this_hostname = $_SERVER['SERVER_NAME'];
			setcookie($this->cookiename, $_GET[$this->cookiename],
					0, "/", $this_hostname);

			// Incorrect encoding of + to " "
			$this->token = preg_replace('/ /', '+',
					$_GET[$this->cookiename]);

		} elseif (isset($_COOKIE[$this->cookiename])) {
			// Incorrect encoding of + to " "
			$this->token = preg_replace('/ /', '+',
					$_COOKIE[$this->cookiename]);
		}
	}

	/**
	 * Check for errors
	 */
	function check_error() {
		if (!empty($this->error)) {
			return $this->error;
		} else {
			return FALSE;
		}
	}

	/**
	 * Forces OpenSSO login
	 *
	 * @param string	Return URL. If not specified, current URL is used<commit_msg>Deshago el cambio. Para IE y OpenSSO con el dominio .us.es la única solución posible es modificar el registro (fichero cookie.reg)<commit_after><?php
/**
 * OpenSSO integration library for PHP
 *
 * <NAME> <<EMAIL>>
 */

require_once('config.php');

class OpenSSO {
	private $cookiename;
	private $token;
	private $err;
	private $attributes;

	function OpenSSO($fetch_cookie_name = FALSE) {
		if ($fetch_cookie_name === TRUE) {
			// Fetch cookie name
			$res = $this->identity_query(OPENSSO_COOKIE_NAME_FETCH, 'POST');
			if (isset($res->error) || $res->code != '200') {
				if (!isset($res->error)) {
					$this->error = 'HTTP result = ' . $res->code;
				} else {
					$this->error = $res->error;
				}

				return;
			}

			$this->cookiename = preg_replace('/^string=/', '', $res->data);
		} else {
			$this->cookiename = OPENSSO_COOKIE_NAME;
		}

		if (isset($_COOKIE[$this->cookiename])) {
			// Incorrect encoding of + to " "
			$this->token = preg_replace('/ /', '+',
					$_COOKIE[$this->cookiename]);
		}
	}

	/**
	 * Check for errors
	 */
	function check_error() {
		if (!empty($this->error)) {
			return $this->error;
		} else {
			return FALSE;
		}
	}

	/**
	 * Forces OpenSSO login
	 *
	 * @param string	Return URL. If not specified, current URL is used
{'fraction_non_alphanumeric': 0.17592592592592593, 'fraction_numerical': 0.002234993614303959, 'mean_word_length': 3.1606905710491366, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, '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': '525129', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1093, 'n_words': 251}