/**
  * Attempt to do login
  *
  */
 public function postLogin()
 {
     $repo = App::make('UserRepository');
     $input = Input::all();
     if ($this->userRepo->login($input)) {
         return Redirect::intended('/');
     } else {
         if ($this->userRepo->isThrottled($input)) {
             $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
         } elseif ($this->userRepo->existsButNotConfirmed($input)) {
             $err_msg = Lang::get('confide::confide.alerts.not_confirmed');
         } else {
             $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
         }
         return Redirect::to('user/login')->withInput(Input::except('password'))->with('error', $err_msg);
     }
 }
Ejemplo n.º 2
0
 public function loginBeforePuchase()
 {
     $id = Input::get('purchase');
     if (Auth::check()) {
         return Redirect::to('purchase/' . $id);
     } else {
         $repo = App::make('UserRepository');
         $input = Input::only(array('username', 'password'));
         if ($this->userRepo->login($input)) {
             return Redirect::to('purchase/' . $id);
         } else {
             if ($this->userRepo->isThrottled($input)) {
                 $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
             } elseif ($this->userRepo->existsButNotConfirmed($input)) {
                 $err_msg = Lang::get('confide::confide.alerts.not_confirmed');
             } else {
                 $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
             }
             return Redirect::to('purchase/' . $id)->withInput(Input::except('password'))->with('error', $err_msg);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Attempt to do login
  *
  */
 public function postLogin()
 {
     //$repo = App::make('UserRepository');
     $input = Input::all();
     /*$input = array(
           'username'              =>Input::get('username'),
           'password'              =>Input::get('password'),            
       );*/
     $err_msg = "";
     if ($this->userRepo->login($input)) {
         //return Redirect::intended('/');
         //Administratorul platformei si utilizatorii care au acces la aplicatia vor putea continua
         if (Entrust::can('administrare_platforma') || $this->userRepo->hasAccessApp(1)) {
             if (Entrust::can('hostinger')) {
                 return Redirect::intended('/proba');
             } else {
                 self::registerLogin(Input::get('username'), Input::get('password'), 'Login OK');
                 Confide::getDepartamente();
                 return Redirect::intended('/dashboard');
             }
         } else {
             //altfel se afiseaza mesajul de eroare si sunt redirectionati la pagina de login
             $err_msg = Lang::get('confide::confide.alerts.access_denied');
         }
     } else {
         if ($this->userRepo->isThrottled($input)) {
             $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
         } elseif ($this->userRepo->existsButNotConfirmed($input)) {
             $err_msg = Lang::get('confide::confide.alerts.not_confirmed');
         } elseif ($this->userRepo->isUserBlocked($input)) {
             $err_msg = Lang::get('confide::confide.alerts.user_blocked');
         } else {
             $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
         }
     }
     self::registerLogin(Input::get('username'), Input::get('password'), $err_msg);
     return Redirect::to('user/login')->withInput(Input::except('password'))->with('error', $err_msg);
 }