<commit_before><?php

class AccountController extends BaseController {

	### Sign In
	/* After submitting the sign-in form */
	public function postSignIn() {
		$validator = Validator::make(Input::all(),
			array(
				'username' 	=> 'required',
				'password'	=> '<PASSWORD>'
			)
		);
		if($validator->fails()) {
			// Redirect to the sign in page
			return Redirect::route('account-sign-in')
				->withErrors($validator)
				->withInput();   // redirect the input

		} else {

			$remember = (Input::has('remember')) ? true : false;
			$auth = Auth::attempt(array(
				'username' => Input::get('username'),
				'password' => Input::get('password')
			), $remember);
		} 

		if($auth) {
			
			return Redirect::intended('/');

		} else {
			
			return Redirect::route('account-sign-in')
				->with('global', 'Wrong Email or Wrong Password.');
		}

		return Redirect::route('account-sign-in')
			->with('global', 'There is a problem. Have you activated your account?');
	}

	/* Submitting the Create User form (POST) */
	public function postCreate() {
		$validator = Validator::make(Input::all(),
			array(
				'username'		=> 'required|max:20|min:3|unique:users',
				'password'		=> '<PASSWORD>',
				'password_again'=> '<PASSWORD>'
			)
		);

		if($validator->fails()) {
			return Redirect::route('account-create')
				->withErrors($validator)
				->withInput();   // fills the field with the old inputs what were correct

		} else {
			// create an account
			$username	= Input::get('username');
			$password 	= Input::get('password');

			$userdata = User::create(array(
				'username' 	=> $username,
				'password' 	=> Hash::make($password)	// Changed the default column for Password
			));

			if($userdata) {			


				return Redirect::route('account-sign-in')
					->with('global', 'Your account has been created. We have sent you an email to activate your accout');				
			}
		}
	}

	public function getSignIn() {
		return View::make('account.signin');
	}

	/* Viewing the form (GET) */
	public function getCreate() {
		return View::make('account.create');
	}

	### Sign Out
	public function getSignOut() {
		Auth::logout();
		return Redirect::route('home');<commit_msg>fix typo<commit_after><?php

class AccountController extends BaseController {

	### Sign In
	/* After submitting the sign-in form */
	public function postSignIn() {
		$validator = Validator::make(Input::all(),
			array(
				'username' 	=> 'required',
				'password'	=> '<PASSWORD>'
			)
		);
		if($validator->fails()) {
			// Redirect to the sign in page
			return Redirect::route('account-sign-in')
				->withErrors($validator)
				->withInput();   // redirect the input

		} else {

			$remember = (Input::has('remember')) ? true : false;
			$auth = Auth::attempt(array(
				'username' => Input::get('username'),
				'password' => Input::get('password')
			), $remember);
		} 

		if($auth) {
			
			return Redirect::intended('/');

		} else {
			
			return Redirect::route('account-sign-in')
				->with('global', 'Wrong Email or Wrong Password.');
		}

		return Redirect::route('account-sign-in')
			->with('global', 'There is a problem. Have you activated your account?');
	}

	/* Submitting the Create User form (POST) */
	public function postCreate() {
		$validator = Validator::make(Input::all(),
			array(
				'username'		=> 'required|max:20|min:3|unique:users',
				'password'		=> '<PASSWORD>',
				'password_again'=> '<PASSWORD>'
			)
		);

		if($validator->fails()) {
			return Redirect::route('account-create')
				->withErrors($validator)
				->withInput();   // fills the field with the old inputs what were correct

		} else {
			// create an account
			$username	= Input::get('username');
			$password 	= Input::get('password');

			$userdata = User::create(array(
				'username' 	=> $username,
				'password' 	=> <PASSWORD>($password)	// Changed the default column for Password
			));

			if($userdata) {			


				return Redirect::route('account-sign-in')
					->with('global', 'Your account has been created. We have sent you an email to activate your account');				
			}
		}
	}

	public function getSignIn() {
		return View::make('account.signin');
	}

	/* Viewing the form (GET) */
	public function getCreate() {
		return View::make('account.create');
	}

	### Sign Out
	public function getSignOut() {
		Auth::logout();
		return Redirect::route('home');
{'fraction_non_alphanumeric': 0.17525298988040477, 'fraction_numerical': 0.0013799448022079118, 'mean_word_length': 3.4835051546391753, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 46, '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': '5200251', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1368, 'n_words': 332}