コード例 #1
0
 /**
  * Store a newly created user in storage.
  *
  * @param UserRequest $request
  * @return Response
  */
 public function store(UserRequest $request)
 {
     $input = $request->only('username', 'email', 'password', 'password_confirmation');
     $this->userRepository->store($input);
     Flash::message('User created');
     return Redirect()->route('users');
 }
コード例 #2
0
ファイル: AuthController.php プロジェクト: mime55/lumenvue
 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  App\Repositories\UserRepository
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request, UserRepository $userRepository)
 {
     $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6']);
     $user = $userRepository->store($request);
     Auth::login($user);
     return redirect('/');
 }
コード例 #3
0
 public function postRegister(UserRequest $request)
 {
     $user = $this->userRepository->store($request->all());
     Auth::login($user);
     Flash::message('Cuenta Creada correctamente. se te ha enviado un correo con la información de usuario. Completa tu perfil por favor, es importante !');
     $this->mailer->welcome($user->toArray());
     try {
         $this->newsletterList->subscribeTo('Guanacaste Vende', $request->get('email'), $request->get('username'), '');
     } catch (\Mailchimp_Error $e) {
         Flash::message($e->getMessage());
     }
     return redirect()->route('profile.edit', $user->username);
 }
コード例 #4
0
ファイル: DatabaseSeeder.php プロジェクト: weopendata/medea
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $neo4j_config = \Config::get('database.connections.neo4j');
     // Create an admin
     $client = new Everyman\Neo4j\Client($neo4j_config['host'], $neo4j_config['port']);
     $client->getTransport()->setAuth($neo4j_config['username'], $neo4j_config['password']);
     // Check if the admin user already exists, if not create one.
     // Use the Person label, as described by the vocabulary the MEDEA project handles
     // Get the Person label
     $label = $client->makeLabel('Person');
     // Get all of the Person node with the admin email
     $nodes = $label->getNodes("email", "*****@*****.**");
     if ($nodes->count() == 0) {
         $users = new UserRepository();
         $admin = ['firstName' => 'Medea', 'lastName' => 'Admin', 'password' => 'foobar', 'email' => '*****@*****.**', 'verified' => true, 'description' => 'Dit is de generieke admin user van het MEDEA platform.', 'personType' => ['detectorist', 'validator', 'administrator', 'registrator', 'onderzoeker', 'vondstexpert'], 'showContactInfo' => 'never', 'passContactInfoToAgency' => false];
         $users->store($admin);
         $this->command->info("An admin user was created.");
     } else {
         $this->command->info("The admin user already exists.");
     }
     // Seed the values in the lists of MEDEA
     $this->call(ListValueSeeder::class);
 }
コード例 #5
0
ファイル: AuthController.php プロジェクト: thaida/CMS
 /**
  * Handle a registration request for the application.
  *
  * @param  App\Http\Requests\RegisterRequest  $request
  * @param  App\Repositories\UserRepository $user_gestion
  * @return Response
  */
 public function postRegister(RegisterRequest $request, UserRepository $user_gestion)
 {
     $user = $user_gestion->store($request->all(), $confirmation_code = str_random(30));
     //$this->dispatch(new SendMail($user));
     return redirect('/')->with('ok', trans('front/verify.message'));
 }
コード例 #6
0
ファイル: UserController.php プロジェクト: nitsmax/els
 /**
  * Store a newly created resource in storage.
  *
  * @param  App\requests\UserCreateRequest $request
  *
  * @return Response
  */
 public function store(UserCreateRequest $request)
 {
     $this->user_gestion->store($request->all());
     return redirect('user')->with('ok', trans('back/users.created'));
 }
コード例 #7
0
 /**
  * Handle a registration request for the application.
  *
  * @param  App\Http\Requests\RegisterRequest  $request
  * @param  App\Repositories\UserRepository $user_gestion
  * @return Response
  */
 public function postRegister(Guard $auth, Request $request, UserRepository $user_gestion, OperadorRepository $operador_gestion, ServiciosOperadorRepository $gestion)
 {
     $inputData = Input::get('formData');
     parse_str($inputData, $formFields);
     if ($inputData != "") {
         $userData = array('username' => $formFields['username'], 'email' => $formFields['email'], 'password' => $formFields['password'], 'email_confirmation' => $formFields['email_confirmation']);
     } else {
         $userData = array('username' => $request->input('username'), 'email' => $request->input('email'), 'password' => $request->input('password'), 'email_confirmation' => $request->input('email_confirmation'));
     }
     //Valida que los campos sean unicos y cumplan con los requerimientos
     $validator = Validator::make($userData, $this->validationRules);
     //Si el validador falla se ejecutan las acciones
     if ($validator->fails()) {
         return response()->json(array('fail' => true, 'errors' => $validator->getMessageBag()->toArray()));
     } else {
         $user = $user_gestion->store($userData, $confirmation_code = str_random(30));
         //Se almacenan los datos por default del contacto, se pueden modificar cuando ya ingrese
         $operadorData = array('nombre_contacto_operador_1' => $formFields['username'], 'telf_contacto_operador_1' => "", 'ip_registro_operador' => $this->getIp(), 'email_contacto_operador' => $formFields['email'], 'direccion_empresa_operador' => "", 'id_usuario' => $user->id, 'id_tipo_operador' => 3, 'estado_contacto_operador' => 1, 'id_usuario_op' => 0);
         //Almacena el operador y almacena en sesion su identificacion
         $operador = $operador_gestion->store($operadorData);
         $request->session()->put('operador_id', $operador->id);
         if ($request->session()->has('user_id')) {
             $request->session()->forget('user_id');
         }
         //Se realiza el login y redireccion
         $request->session()->put('user_name', $user->email);
         $auth->login($user);
         $email = $auth->user()->email;
         $nombre = $auth->user()->email;
         try {
             $this->dispatch(new SendMail($user));
         } catch (Exception $e) {
         }
         /* Busca si ya tiene servicios activos o no */
         //logica que comprueba si el usuario tiene servicios para ser modificados
         //caso contrario ingresa nuevos serviciosS
         $listServicios = $gestion->getServiciosidUsuario($user->id);
         if ($listServicios) {
             $data['id_usuario_op'] = $listServicios[0]->id_usuario_op;
             $request->session()->put('operador_id', $data['id_usuario_op']);
             $request->session()->put('tip_oper', $listServicios[0]->id_tipo_operador);
             return redirect('/detalleServicios')->with('user', $user->id);
         } else {
             $returnHTML = '/IguanaTrip/public/myProfileOp';
             //->with('user', $user->id);
             return response()->json(array('success' => true, 'redirectto' => $returnHTML));
         }
     }
 }
コード例 #8
0
 /**
  * Handle a registration request for the application.
  *
  * @param  App\Http\Requests\RegisterRequest  $request
  * @param  App\Repositories\UserRepository $user_gestion
  * @return Response
  */
 public function postRegister(RegisterRequest $request, UserRepository $user_gestion)
 {
     $user = $user_gestion->store($request->all());
     $this->auth->login($user);
     return redirect('/')->with('ok', trans('front/register.ok'));
 }
コード例 #9
0
 /**
  * Handle the registration of user.
  * 
  * @param type UserRegisterRequest $request 
  * @return type view
  */
 public function postRegister(UserRegisterRequest $request, User $user, Company $company)
 {
     $newUser = $user->store($request);
     if ($request->user_type) {
         $company->store($request, $newUser->id);
     }
     return Redirect::route('auth.register.success')->with('user', $newUser);
 }
コード例 #10
0
 public function postCreate(CreateRequest $request)
 {
     $this->userRepository->store($request->all());
     return responseSuccess('添加成功', 'user/index');
 }