<commit_before><?php

namespace Controller;

class UserController extends Controller
{
	public function __construct(\Silex\Application $app)
	{
		$this->app = $app;
		$this->init();
	}

	public function index($username)
	{
		$profile = $this->app['user']->findByUsername($username);

		if (!$profile['data'])
		{
			return $this->app->redirect('/' . $this->app['board']['base']);
		}

		$loggedInUser = $this->app['session']->get('user');
		$following = false;

		if ($loggedInUser)
		{
			$following = $this->app['user']->checkFollowing($loggedInUser['id'], $profile['data']['id']);
		}

		return $this->app['twig']->render('User/index.twig', array(
			'title' 			=> $profile['data']['username'],
			'section'			=> 'profile',
			'profileId'			=> $profile['data']['id'],
			'profileUser'		=> $profile['data'],
			'profile'			=> $profile['data']['profile'],
			'following'			=> $following
		) + $this->extras);
	}

	public function settings ()
	{
		$user = $this->app['session']->get('user');

		if (!$user)
		{
			return $this->app->redirect('/' . $this->app['board']['base']);
		}

		// reset with profile information
		$user = $this->app['user']->findByUsername($user['username']);

		return $this->app['twig']->render('User/settings.twig', array(
			'title' 			=> 'Settings',
			'section'			=> 'settings',
			'user'				=> $user['data'],
			'profile'			=> $user['data']['profile'],
			'settings'			=> $user['data']['settings']
		) + $this->extras);
	}

	public function confirmEmail ($code)
	{
		list ($email, $user_id) = explode('-', base64_decode($code));

		$confirmed = $this->app['auth']->confirmEmail($email, $user_id);

		return $this->app['twig']->render('User/confirmEmail.twig', array(
			'title' 			=> 'Confirm email',
			'section'			=> 'members',
			'confirmed'			=> $confirmed
		) + $this->extras);
	}
}<commit_msg>fixed font awesome path and fixed user controller variable overwrite<commit_after><?php

namespace Controller;

class UserController extends Controller
{
	public function __construct(\Silex\Application $app)
	{
		$this->app = $app;
		$this->init();
	}

	public function index($username)
	{
		$profile = $this->app['user']->findByUsername($username);

		if (!$profile['data'])
		{
			return $this->app->redirect('/' . $this->app['board']['base']);
		}

		$loggedInUser = $this->app['session']->get('user');
		$following = false;

		if ($loggedInUser)
		{
			$following = $this->app['user']->checkFollowing($loggedInUser['id'], $profile['data']['id']);
		}

		return $this->app['twig']->render('User/index.twig', array(
			'title' 			=> $profile['data']['username'],
			'section'			=> 'profile',
			'profileId'			=> $profile['data']['id'],
			'profileUser'		=> $profile['data'],
			'profile'			=> $profile['data']['profile'],
			'following'			=> $following
		) + $this->extras);
	}

	public function settings ()
	{
		$user = $this->app['session']->get('user');

		if (!$user)
		{
			return $this->app->redirect('/' . $this->app['board']['base']);
		}

		$profile = $this->app['user']->findByUsername($user['username']);

		return $this->app['twig']->render('User/settings.twig', array(
			'title' 			=> 'Settings',
			'section'			=> 'settings',
			'user'				=> $user,
			'profile'			=> $profile['data']['profile'],
			'settings'			=> $profile['data']['settings']
		) + $this->extras);
	}

	public function confirmEmail ($code)
	{
		list ($email, $user_id) = explode('-', base64_decode($code));

		$confirmed = $this->app['auth']->confirmEmail($email, $user_id);

		return $this->app['twig']->render('User/confirmEmail.twig', array(
			'title' 			=> 'Confirm email',
			'section'			=> 'members',
			'confirmed'			=> $confirmed
		) + $this->extras);
	}
}
{'fraction_non_alphanumeric': 0.23967391304347826, 'fraction_numerical': 0.0010869565217391304, 'mean_word_length': 4.221276595744681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 89, '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': '5981232', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1277, 'n_words': 209}