public function getConfirmation($code)
 {
     // dd($code);
     if ($user = \App\User::whereConfirmationCode($code)->first()) {
         $user->update(['confirmed' => 1]);
         $this->auth->login($user);
         return redirect()->intended($this->redirectPath())->with('message', trans('login.confirmation.confirmed'));
     }
     // return view('auth.confirmation_error');
 }
 public function confirmEmail($token)
 {
     $result = User::where('confirmation_code', '=', $token)->get();
     if (!$result->isEmpty()) {
         User::whereConfirmationCode($token)->firstOrFail()->confirmEmail();
         flash()->success('Your account was successfully registered.');
         return redirect('/');
     } else {
         flash()->error('That code was incorrect, please make sure you follow the link in the verification email.');
         return redirect('/');
     }
 }
Example #3
0
 public function confirm($confirmationcode)
 {
     $user = User::whereConfirmationCode($confirmationcode)->first();
     if (!$user) {
         return view("auth.invalid");
     } else {
         $user->confirmed = 1;
         $user->confirmation_code = null;
         $user->save();
         return view("auth.confirmed");
     }
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         abort(404);
     }
     $user = \App\User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         abort(404);
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     Session::flash('success', 'alt');
     return redirect('auth/login');
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         return $confirmation_code;
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         return view("doverification")->with(['message' => 'you are  already registered user please login', "button_message" => 'Login', 'button_url' => '/home']);
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     return view('doverification')->with(['message' => 'your account has been verifed !!!', 'button_message' => 'Login', 'button_url' => '/home']);
     //  return Redirect::route('login_path');
 }
 /**
  * Confirm a new user from email
  * @param $confirmation_code
  * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         return redirect('auth/login')->withErrors('You lose a confirmation code!');
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         return redirect('auth/login')->withErrors('Wrong confirmation code!');
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     Flash::message('You have successfully verified your account.');
     return redirect('auth/login');
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         return "error";
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         return "error";
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     $this->dispatch(new SendConfirmationEmail($user));
     return "confirmed";
 }
Example #8
0
 /**
  * Verify the user's account, via confirmation link.
  *
  * @param $confirmation_code
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  * @throws InvalidConfirmationCodeException
  */
 public function getVerify($confirmation_code = null)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException(trans('register-page.flash-2'));
     }
     $user = User::whereConfirmationCode($confirmation_code);
     if (!$user instanceof User) {
         throw new InvalidConfirmationCodeException(trans('register-page.flash-3'));
     }
     $user->confirmation_code = null;
     $user->active = 1;
     $user->save();
     Session::flash('flash_message', trans('register-page.flash-4'));
     return redirect('/');
 }
Example #9
0
 public function confirm($codigo)
 {
     if (!$codigo) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($codigo)->first();
     if (!$user) {
         throw new InvalidConfirmationCodeException();
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     \Session::flash('flash_message', 'Conta Verificada com Sucesso!');
     return redirect('home');
     //Ainda nao cadastrou, solicitar o cadastro
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         return Redirect('auth/login');
         //throw new InvalidConfirmationCodeException;
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         return Redirect('/');
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     Flash::message('You have successfully verified your account.');
     return Redirect('home');
 }
 public function confirm($email, $confirmation_code)
 {
     if (!$confirmation_code) {
         // throw new InvalidConfirmationCodeException;
     }
     $user = \App\User::whereConfirmationCode($confirmation_code)->whereEmail($email)->first();
     if (!$user) {
         // throw new InvalidConfirmationCodeException;
         // или подтвержден или нет такого пользователя или не правильный код
         return \Redirect::to('login');
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     \Session::flash('verify_message', 'You successfuly confirmed');
     return \Redirect::to('login');
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         echo "error ";
         exit;
     }
     $user->confirmed = 1;
     //$user->confirmation_code = null;
     $user->save();
     flash('Votre compte a été confirmé avec succès, vous êtes à présent connecté.');
     Auth::login($user);
     return redirect('/home');
 }
Example #13
0
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         //throw new InvalidConfirmationCodeException;
     }
     $user->activation = 1;
     $user->confirmation_code = null;
     $user->save();
     \Session::flash('status', 'You have been successfully verified!');
     return redirect('login');
 }
 /**
  * Get user by given confirmation code.
  * 
  * @param string $code
  *
  * @return \App\User
  */
 public function getUserByCode($code)
 {
     return User::whereConfirmationCode($code)->whereConfirmed(false)->firstOrFail();
 }
 /**
  * @param $confirmation_code
  * @throws InvalidConfirmationCodeException if the confirmation_code or user are not found
  * @return mixed
  */
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException();
         //@todo setup Exception
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         throw new InvalidConfirmationCodeException();
         //@todo setup Exception
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     //        Flash::message('You have successfully verified your account.'); //@todo flash messaging untested, commenting out for now
     $this->sendWelcomeEmail($user);
     $this->auth->login($user);
     return redirect('home');
 }
Example #16
0
 public function confirmRegistration($code)
 {
     if (!$code) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($code)->first();
     if (!$user) {
         throw new InvalidConfirmationCodeException();
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     return Redirect::to('startjourney')->withMessage('Success !! Email verified successfully. Please login');
 }
 public function verify($confirmation_code, Request $request)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         throw new InvalidConfirmationCodeException();
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     Audit::log(null, trans('general.audit-log.category-register'), trans('general.audit-log.msg-email-validated', ['username' => $user->username]));
     if (Setting::get('auth.enable_user_on_validation')) {
         $user->enabled = true;
         Audit::log(null, trans('general.audit-log.category-register'), trans('general.audit-log.msg-account-enabled', ['username' => $user->username]));
     }
     $user->save();
     Flash::message(trans('general.status.email-validated'));
     $request->session()->reflash();
     return Redirect::route('home');
 }
 public function verify($confirmation_code)
 {
     User::whereConfirmationCode($confirmation_code)->firstOrFail()->confirmEmail();
     flash()->success('Verifying success , Please login.');
     return redirect('/login');
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         Session::flash('alert-class', 'alert-warning');
         return Redirect::to('users/dashboard')->with('message', 'That confirmtion link is bad. Click on accounts to send another one')->with('alert-class', 'alert-danger')->withInput();
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         Session::flash('alert-class', 'alert-warning');
         return Redirect::to('users/dashboard')->with('message', 'That confirmtion link is bad. Click on accounts to send another one')->with('alert-class', 'alert-danger')->withInput();
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     //if there is a live order then redirect to that quote page
     if (session::has('order')) {
         return Redirect::to('quote/' . session::get('order') . '')->with('registerMessage', 'You are now verified and logged in.')->with('type', 'success');
     }
     //otherwise go to the dashboard
     return Redirect::to('users/dashboard')->with('message', 'You are now verified and logged in.')->with('alert-class', 'alert-success')->withInput();
 }
 public function confirm($confirmation_code)
 {
     if (!$confirmation_code) {
         throw new InvalidConfirmationCodeException();
     }
     $user = User::whereConfirmationCode($confirmation_code)->first();
     if (!$user) {
         throw new InvalidConfirmationCodeException();
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     Session::flash('success', 'You have successfully verified your account.');
     return Redirect::to('login');
 }