<commit_before><?php
/**
 * @author <NAME>  <<EMAIL>>
 * @copyright City of Edinburgh Council & <NAME>
 * @license Open Source under the 3-clause BSD License
 * @url https://github.com/City-Outdoors/City-Outdoors-Web
 */
require '../../includes/src/global.php';
require '../../includes/src/APIV1Funcs.php';
header('Content-type: application/xml');

$user = $loginToken = null;
$data = array_merge($_POST,$_GET);

if (isset($data['email']) && isset($data['password'])) {
	$user = User::loadByEmail($data['email']);
	if ($user && $user->checkPassword($data['password'])) {
		$loginToken = $user->getNewSessionID();
	}
} 


if ($user && $loginToken) { ?>
	<data>
		<user id="<?php print $user->getId() ?>" token="<?php print $loginToken ?>" email="<?php htmlspecialchars(print $user->getEmail()) ?>"  name="<?php htmlspecialchars(print $user->getName()) ?>">
		</user>
	</data>
<?php } else { ?>
	<data>
		<error>Log In Failed</error>
	</data><commit_msg>Include user current score in login API call results.<commit_after><?php
/**
 * @author <NAME>  <<EMAIL>>
 * @copyright City of Edinburgh Council & <NAME>
 * @license Open Source under the 3-clause BSD License
 * @url https://github.com/City-Outdoors/City-Outdoors-Web
 */
require '../../includes/src/global.php';
require '../../includes/src/APIV1Funcs.php';
header('Content-type: application/xml');

$user = $loginToken = null;
$data = array_merge($_POST,$_GET);

if (isset($data['email']) && isset($data['password'])) {
	$user = User::loadByEmail($data['email']);
	if ($user && $user->checkPassword($data['password'])) {
		$loginToken = $user->getNewSessionID();
	}
} 


if ($user && $loginToken) { ?>
	<data>
		<user id="<?php print $user->getId() ?>" token="<?php print $loginToken ?>" email="<?php htmlspecialchars(print $user->getEmail()) ?>"  name="<?php htmlspecialchars(print $user->getName()) ?>" score="<?php htmlspecialchars(print $user->getCachedScore()) ?>">
		</user>
	</data>
<?php } else { ?>
	<data>
		<error>Log In Failed</error>
	</data>
{'fraction_non_alphanumeric': 0.22847187655550025, 'fraction_numerical': 0.001991040318566451, 'mean_word_length': 4.964391691394659, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 51, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5063493', 'n_tokens_mistral': 667, 'n_tokens_neox': 670, 'n_words': 144}