<commit_before><?php
	namespace FelixOnline\Admin;

	// Felix Admin App
	// by <NAME>

	// Released under the MIT license

	if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
		header('HTTP/1.1 403 Forbidden');

		echo '<h1>Forbidden</h1><p>This URL is for AJAX requests only.';
		die();
	}

	if($_SERVER['REQUEST_METHOD'] != 'POST') {
		header("HTTP/1.1 405 Invalid method");
		header("Cache-Control: no-cache, must-revalidate", false);
		header("Expires: Sat, 26 Jul 1997 05:00:00 GMT", false);
		header("Content-Type: text/json", false);

		echo json_encode(array("message" => 'POST requests only.', "widgets" => array()));
		exit;
	}

	require('core/setup.php');

	global $currentuser;
	$currentuser = new \FelixOnline\Core\CurrentUser();

	if(!$currentuser->isLoggedIn() && $_POST['q'] != 'login') {<commit_msg>Exempt the logout ajax call from authorisation so a user can click it if their session expires<commit_after><?php
	namespace FelixOnline\Admin;

	// Felix Admin App
	// by <NAME>

	// Released under the MIT license

	if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
		header('HTTP/1.1 403 Forbidden');

		echo '<h1>Forbidden</h1><p>This URL is for AJAX requests only.';
		die();
	}

	if($_SERVER['REQUEST_METHOD'] != 'POST') {
		header("HTTP/1.1 405 Invalid method");
		header("Cache-Control: no-cache, must-revalidate", false);
		header("Expires: Sat, 26 Jul 1997 05:00:00 GMT", false);
		header("Content-Type: text/json", false);

		echo json_encode(array("message" => 'POST requests only.', "widgets" => array()));
		exit;
	}

	require('core/setup.php');

	global $currentuser;
	$currentuser = new \FelixOnline\Core\CurrentUser();

	if(!$currentuser->isLoggedIn() && $_POST['q'] != 'login' && $_POST['q'] != 'logout') {
{'fraction_non_alphanumeric': 0.18449197860962566, 'fraction_numerical': 0.025668449197860963, 'mean_word_length': 5.016077170418006, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '3236938', 'n_tokens_mistral': 701, 'n_tokens_neox': 624, 'n_words': 150}