<commit_before><?php

/**
 * This is the delete-action, it will deactivate and mark the user as deleted
 *
 * @package		backend
 * @subpackage	users
 *
 * @author		<NAME> <<EMAIL>>
 * @author		<NAME> <<EMAIL>>
 * @since		2.0
 */
class BackendUsersDelete extends BackendBaseActionDelete
{
	/**
	 * Execute the action
	 *
	 * @return	void
	 */
	public function execute()
	{
		// get parameters
		$this->id = $this->getParameter('id', 'int');

		// does the user exist
		if($this->id !== null && BackendUsersModel::exists($this->id) && BackendAuthentication::getUser()->getUserId() != $this->id)
		{
			// call parent, this will probably add some general CSS/JS or other required files
			parent::execute();

			// get data
			$this->record = (array) BackendUsersModel::get($this->id);

			// delete item
			BackendUsersModel::delete($this->id);

			// item was deleted, so redirect
			$this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . $this->record['settings']['nickname']);
		}

		// no user found, throw an exceptions, because somebody is fucking with our URL
		else $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
	}
}

?><commit_msg>Added todo to check if a user is God before deletion<commit_after><?php

/**
 * This is the delete-action, it will deactivate and mark the user as deleted
 *
 * @package		backend
 * @subpackage	users
 *
 * @author		<NAME> <<EMAIL>>
 * @author		<NAME> <<EMAIL>>
 * @since		2.0
 */
class BackendUsersDelete extends BackendBaseActionDelete
{
	/**
	 * Execute the action
	 *
	 * @return	void
	 */
	public function execute()
	{
		// get parameters
		$this->id = $this->getParameter('id', 'int');

		// does the user exist
		if($this->id !== null && BackendUsersModel::exists($this->id) && BackendAuthentication::getUser()->getUserId() != $this->id)
		{
			// call parent, this will probably add some general CSS/JS or other required files
			parent::execute();

			// get data
			$this->record = (array) BackendUsersModel::get($this->id);

			// @todo	check if god-user

			// delete item
			BackendUsersModel::delete($this->id);

			// item was deleted, so redirect
			$this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . $this->record['settings']['nickname']);
		}

		// no user found, throw an exceptions, because somebody is fucking with our URL
		else $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
	}
}

?>
{'fraction_non_alphanumeric': 0.16196615632554393, 'fraction_numerical': 0.0016116035455278, 'mean_word_length': 3.8590998043052838, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 41, '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': '3828805', 'n_tokens_mistral': 831, 'n_tokens_neox': 772, 'n_words': 210}