<commit_before><?php
/*
	Copyright 2002-2007 <NAME> <<EMAIL>>

	This file is part of LL.

	LL is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	LL is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with LL.  If not, see <http://www.gnu.org/licenses/>.
*/
class GetAvatar extends GetFile{

private $user = 0;

public function prepare()
	{
	$this->exitIfCached();

	/** We do not need any expencive security check */
	if (!$this->Io->isRequest('sessionid'))
		{
		$this->showWarning('Nur für Mitglieder!');
		}

	$this->getParams();
	}

protected function getParams()
	{
	try
		{
		$this->user = $this->Io->getInt('user');
		}
	catch (IoRequestException $e)
		{
		$this->showWarning('kein Benutzer angegeben');
		}
	}

public function show()
	{
	if (!($data = $this->ObjectCache->getObject('LL:GetAvatar:Data:'.$this->user)))
		{
		$this->initDB();
		try
			{
			$stm = $this->DB->prepare
				('
				SELECT
					type,
					name,
					content,
					size
				FROM
					avatars
				WHERE
					id = ?'
				);
			$stm->bindInteger($this->user);
			$data = $stm->getRow();
			$stm->close();
			$this->ObjectCache->addObject('LL:GetAvatar:Data:'.$this->user, $data, 60*60);
			}
		catch (DBNoDataException $e)
			{
			$stm->close();
			$this->Io->setStatus(Io::NOT_FOUND);
			$this->showWarning('Datei nicht gefunden');
			}
		}

	$this->sendInlineFile($data['type'], $data['name'], $data['size'], $data['content']);
	}
}

?><commit_msg>removed caching of avatars; there only few hits anyway<commit_after><?php
/*
	Copyright 2002-2007 <NAME> <<EMAIL>>

	This file is part of LL.

	LL is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	LL is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with LL.  If not, see <http://www.gnu.org/licenses/>.
*/
class GetAvatar extends GetFile{

private $user = 0;

protected function getParams()
	{
	try
		{
		$this->user = $this->Io->getInt('user');
		}
	catch (IoRequestException $e)
		{
		$this->showWarning('kein Benutzer angegeben');
		}
	}

public function show()
	{
	$this->initDB();
	try
		{
		$stm = $this->DB->prepare
			('
			SELECT
				type,
				name,
				content,
				size
			FROM
				avatars
			WHERE
				id = ?'
			);
		$stm->bindInteger($this->user);
		$data = $stm->getRow();
		$stm->close();
		}
	catch (DBNoDataException $e)
		{
		$stm->close();
		$this->Io->setStatus(Io::NOT_FOUND);
		$this->showWarning('Datei nicht gefunden');
		}

	$this->sendInlineFile($data['type'], $data['name'], $data['size'], $data['content']);
	}
}

?>
{'fraction_non_alphanumeric': 0.14122938530734633, 'fraction_numerical': 0.00719640179910045, 'mean_word_length': 3.489905787348587, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1505610', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1107, 'n_words': 348}