/**
  * 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\Foundation\Http\FormRequest  $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('socialAuthenticator.activation')) {
         $activation_code = str_random(60) . $request->input('email');
         $user = new User();
         $user->name = $request->input('name');
         $user->email = $request->input('email');
         $user->password = bcrypt($request->input('password'));
         $user->activation_code = $activation_code;
         if ($user->save()) {
             $data = array('name' => $user->name, 'code' => $activation_code);
             Mail::queue('socialAuthenticator::activateAccount', $data, function ($message) use($user) {
                 $message->to($user->email, $user->name)->subject(config('socialAuthenticator.email_subject'));
             });
             return view('user.activateAccount');
         } else {
             Session::flash('message', 'Your account couldn\'t be create please try again');
             return redirect()->back()->withInput();
         }
     }
     $user = new User();
     $user->name = $request->input('name');
     $user->email = $request->input('email');
     $user->password = bcrypt($request->input('password'));
     $user->save();
     $this->auth->login($user);
     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)
    {
        $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);
     }
     $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\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 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());
	}
Exemple #10
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()));
     $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());
 }
 /**
  * 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->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)
 {
     $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)
 {
     $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());
 }