Support the ongoing development of Laravel.io →
Authentication Security Forms
Last updated 2 years ago.
0

I don't use sql inject me, so I am not sure how it works exactly, but can you post your controller code?

Last updated 9 years ago.
0
public function postSignIn(){
	$validator = Validator::make(Input::all(),
		array(
			'email' => 'required|email',
			'password' => 'required',
			)
		);

	if($validator->fails()) {
		return Redirect::route('account-sign-in')
				->withErrors($validator)
				->withInput();
	} else {

		// Checkbox recuerdame
		$remember = (Input::has('remember')) ? true : false;
		$auth = Auth::attempt(array(
			'email' => Input::get('email'),
			'password' => Input::get('password'),
			'active' => 1
		),$remember);

		if($auth){
			return Redirect::intended('/pe/mi-cuenta');
		} else {
			$user = User::where('email','=',Input::get('email'));

			if($user->count()){
				$user= $user->first();

				if($user->active == '0'){
					return Redirect::route('account-sign-in')
					->with('global','Debes confirmar tu "Dirección de correo electrónico" para iniciar sesión');
				}

				if($user->active == '2'){
					return Redirect::route('account-sign-in')
					->with('global','Debes realizar el pago de tu mensualidad:<br>
						<a href="emails/payments/fee">Indicaciones sobre como realizar el PAGO DE LA MENSUALIDAD</a><br>');
				}

				if($user->active == '5'){
					return Redirect::route('account-sign-in')
					->with('global','Servidor en mantenimiento. Disculpen las molestias');
				}

				if($user->active == '6'){
					return Redirect::route('account-sign-in')
					->with('global','Esta cuenta ha sido eliminada por su propietario');
				}

				return Redirect::route('account-sign-in')
					->with('global','Existe un problema a la hora de conectarse. Si el problema persiste, reporte la incidencia mediante: <a href="contacto">CONTACTO</a>');
				
			}
				return Redirect::route('account-sign-in')
					->with('global','La combinación "Dirección de correo electrónico"/"Contraseña" es incorrecta');
				
		}
	}
	return Redirect::route('account-sign-in')
		->with('global','Ha habido un problema a la hora de conectarte. Por favor, intentelo más tarde');
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

DiegoHeras diegoheras Joined 26 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.