/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $me = $request->all(); $validator = $this->registrar->validator($request->all()); $confirmation_code = str_random(30); if ($validator->fails()) { //dd($validator); $this->throwValidationException($request, $validator); } // $this->auth->login($this->registrar->create($me)); $user = User::find(Input::get('email')); if ($user) { $this->auth->login($this->registrar->create($me)); } $confirm = new Confirm(); $confirm->name = Input::get('name'); $confirm->email = Input::get('email'); $confirm->password = Hash::make(Input::get('password')); $confirm->confirmation_code = $confirmation_code; $confirm->save(); if (Mail::send('emailverify', array('confirmation_code' => $confirmation_code, 'username' => Input::get("name")), function ($message) { $message->to(Input::get('email'), Input::get('username'))->subject('Verify your email address'); })) { return view('doverification')->with(["message" => 'please verify the email address (' . Input::get("email") . ') through verification code we sent to you on the registerd email-address!!!<br> plz also check you sapn folder', 'button_message' => 'Verify', 'button_url' => 'http://www' . Input::get("email") . '/']); } return "error"; }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } if (config('opciones.seguridad.Email')) { //Añadimos a la request nuevos parámetros a incluir en el usuario a crear $codigoConfirmacion = str_random(30); $request->request->add(['activo' => "1", 'confirmado' => "0", "codigo_confirmacion" => $codigoConfirmacion]); try { $envio = Mail::send('emails.verificacion', ["codigoConfirmacion" => $codigoConfirmacion], function ($message) use($request) { $message->from($request->get('email')); $message->to($request->get('email'))->subject('Verifica tu dirección de correos.'); }); } catch (\Exception $ex) { $envio = 0; } if ($envio == 0) { return Redirect('/')->with('mensaje', 'No se ha podido enviar el email de confirmación a tu cuenta de correos.Comprueba cortafuegos y/o antivirus.'); } $this->registrar->create($request->all()); return Redirect('/')->with('mensaje', 'Gracias por darte de alta, Por favor verifica tu cuenta de correos.'); } else { $request->request->add(['activo' => "1", 'confirmado' => "1", "codigo_confirmacion" => null]); $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); } }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function DoRegister(\Illuminate\Http\Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); return redirect('/'); }
/** * Handle a registration request for the application. * * @param \Illuminate\Foundation\Http\FormRequest $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = Validator::make($request->all(), ['name' => 'required|unique:users,name|not_in:ADMIN,SUPERVISOR,OPERATOR', 'password' => 'required|same:password_confirmation']); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->registrar->create($request->all()); $this->registrar->createRole($request->all()); return view('template.modal'); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } //$this->auth->login($this->registrar->create($request->all())); $this->registrar->create($request->all()); flash()->success('User has been successfully added!'); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function putRegister(Request $request) { if (!$this->user->canCreateUser()) { abort(403); } $validator = $this->registrationValidator(); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Execute the console command. * * @return mixed */ public function fire() { $email = $this->argument('email'); $password = $this->option('password'); $password_confirmation = $this->option('password_confirmation'); if (!$password) { $password = $this->secret('What password should the user have?'); } if (!$password_confirmation) { $password_confirmation = $this->secret('Please confirm the password.'); } $this->registrar->create(compact('email', 'password', 'password_confirmation')); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); $rules = $validator->getRules(); $rules['username'][] = "alpha_num"; $rules['username'][] = "unique:users,username"; $rules['username'][] = "unique:users,email"; $validator->setRules($rules); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException( $request, $validator ); } flash()->overlay('Thank you for registering. You are now logged in.','Success'); $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Process the sign-up form and save user * @var Request $request * @return \Redirect */ public function postSignup(Request $request) { $rules = ['first_name' => 'required|max:45', 'last_name' => 'required|max:45', 'email' => 'required|email|unique:users', 'password' => 'required|min:6|confirmed']; $this->validate($request, $rules); $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->registrar->create($request->all()); $data = $request->all(); //dd(); \Mail::send('Email.welcome', $data, function ($message) use($data) { //$message->from('*****@*****.**', 'Laravel'); //$message->to($data['email']);//->cc('*****@*****.**'); $message->to($data['email'], $data['first_name'] . ' ' . $data['last_name'])->subject('Welcome!'); }); //$this->auth->login($this->registrar->create($request->all())); return redirect('auth/register'); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { // return $request->all(); $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { // send back to the page with the input data and errors return redirect('/auth/register')->withErrors($validator); } if ($validator->fails()) { $this->throwValidationException($request, $validator); } $request = $request->all(); $request['user_type'] = 'normal'; $this->auth->login($this->registrar->create($request)); Session::flash('status', 'Congratulations, Your account has been created successfully, lets go shopping!'); return redirect($this->redirectPath()); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); $member = new Member(); $member->first_name = $request->first_name; $member->last_name = $request->last_name; $member->save(); $mail = new Mail(); $mail->mail = $request->email; $mail->code = rand(1000000, 9999999); $mail->save(); return redirect($this->redirectPath()); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Requests\UserRequest $request, Registrar $registrar) { $data = $request->all(); if (!array_key_exists('roleCheck', $data)) { $data['roleCheck'] = []; } $user = $registrar->create($data); $user->roles()->sync($data['roleCheck']); \Session::flash('message', 'Пользователь создан'); return redirect()->route('admin.user.index'); }
/** * @return \Illuminate\Http\JsonResponse */ public function postStore(Request $request, Registrar $registrar) { $is_exist = $this->user->where('email', $request->input('email'))->first(); if ($is_exist) { return response()->json(['status' => false, 'message' => '邮箱已存在!']); } $user = $registrar->create($request->all()); //添加默认用户组 $user->attachRole(Role::find(2)); return response()->json(['status' => $user ? 1 : 0]); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); Session::put('sessionstart', date("Y-m-d H:i:s")); Session::put('sessiontimer', date("Y-m-d H:i:s")); //thread // $threadedObj = new Sessionclass(); // $threadedObj->start(); //If regular user go to General Info page if ($request->get('type') == 'regular') { return redirect('generalinfos/create'); } else { //If company go to home page return redirect('companies/create'); } }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { // $validator = $this->registrar->validator($request->all()); // // if ($validator->fails()) { // $this->throwValidationException( // $request, $validator // ); // } $this->auth->login($this->registrar->create($request->all())); $user = \App\Models\User::find($this->auth->user()->id); $activationCode = $user->getActivationCode(); $activationURL = route('users.activate', ['id' => $user->id, 'activationCode' => $activationCode]); Mail::send('emails.auth.activate', ['user' => $user, 'activationURL' => $activationURL], function ($message) use($user) { $message->to($user->email, $user->first_name . ' ' . $user->last_name)->subject("Please confirm your email"); }); if ($request->ajax()) { return response()->json(['accessGranted' => true, 'is_activate' => false]); } else { return redirect($this->redirectPath()); } }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function postRegister(Request $request) { $recaptcha = new ReCaptcha(env('RECAPTCHA_PRIVATE_KEY')); $resp = $recaptcha->verify($request['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); if ($resp->isSuccess()) { } else { flash()->overlay('ReCAPTCHA incomplete!', 'Whoops.'); $validator = $this->registrar->validator($request->all()); $this->throwValidationException($request, $validator); } $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $this->auth->login($this->registrar->create($request->all())); //This will not error because of the statement above. $token = \Auth::user()->token; Mail::send('emails.activation', compact('token'), function ($message) { $message->from(env('MAIL_FROM_ADDRESS')); $message->to(\Auth::user()->email); $message->subject('Kora Account Activation'); }); return redirect($this->redirectPath()); }
/** * Obtain the user information from GitHub. * * @param Guard $auth * @param Registrar $registrar * @return Response */ public function handleProviderCallback(Guard $auth, Registrar $registrar) { $user = Socialite::driver('facebook')->user(); $details = array(); $found_user = User::findByEmailOrFail($user->getEmail()); if ($found_user) { $auth->loginUsingId($found_user->id); return redirect()->intended('/home'); } else { $details['name'] = $user->getName(); $details['email'] = $user->getEmail(); $details['user_type'] = 'normal'; $details['mobile_no'] = ''; $details['password'] = bcrypt(str_random(8)); $auth->login($registrar->create($details)); Session::flash('status', 'You have successfully logged in via Facebook.'); return redirect()->intended('/home'); } return 'Success'; }
/** * Execute the Repositories. * * @return void */ public function handle(Registrar $registrar, Guard $auth) { // Create and Register User $auth->login($registrar->create($this->request->all())); }
/** * @param CreateAdminRequest $request * @return RedirectResponse|Redirector */ public function store(CreateAdminRequest $request, Registrar $registrar) { $registrar->create($request->only(['name', 'password', 'email'])); return redirect()->route('admin.admins.index'); }