示例#1
2
 public function sendNewPassword(CanResetPassword $user)
 {
     $password = str_random(8);
     $user->password = $password;
     $user->save();
     $this->mailer->send('auth::emails.new_password', compact('user', 'password'), function ($m) use($user) {
         $m->to($user->getEmailForPasswordReset());
     });
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword|User|ServiceUser $user
  * @param  string                                                       $password
  */
 protected function resetPassword($user, $password)
 {
     $user->password_text = bcrypt($password);
     $user->save();
     /** @noinspection PhpUndefinedMethodInspection */
     Auth::login($user);
 }
示例#3
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $passwordService = new PasswordService();
     $user->user_pass = $passwordService->wp_hash_password($password);
     $user->save();
     Auth::guard($this->getGuard())->login($user);
 }
示例#4
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     event(new UserPasswordChanged($user, $password));
     Auth::login($user);
 }
示例#5
0
 /**
  * Send the password reminder e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @param  \Closure|null  $callback
  *
  * @return \Orchestra\Contracts\Notification\Receipt
  */
 public function emailResetLink(RemindableContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $data = ['user' => $user instanceof Arrayable ? $user->toArray() : $user, 'token' => $token];
     $message = Message::create($this->emailView, $data);
     return $this->mailer->send($user, $message, $callback);
 }
示例#6
0
 /**
  * Generate a token for password change and saves it in
  * the Reminder table with the email of the
  * user.
  *
  * @param CanResetPasswordContract $account An existent user.
  *
  * @return string Password reset token.
  */
 public function requestChangePassword(CanResetPasswordContract $account)
 {
     $token = $this->generateToken();
     $values = ['email' => $account->getEmailForPasswordReset(), 'token' => $token, 'created_at' => new \DateTime()];
     $reminder = $this->getReminder()->fill($values);
     $reminder->save();
     $this->sendEmail($account, $token);
     return $token;
 }
 /**
  * Send the password reset link via e-mail.
  * Overrides to use the mail queue.
  *
  * @override
  * @see PasswordBroker::emailResetLink()
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @param  \Closure|null  $callback
  * @return int
  */
 public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $view = $this->emailView;
     return $this->mailer->queue($view, compact('token', 'user'), function ($m) use($user, $token, $callback) {
         $m->to($user->getEmailForPasswordReset());
         if (!is_null($callback)) {
             call_user_func($callback, $m, $user, $token);
         }
     });
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     //$user->password = bcrypt($password);
     // Sentry hashes password for us
     $user->password = $password;
     $user->save();
     //Auth::login($user);
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     $this->auth->login($user);
 }
 /**
  * Send the password reset link via e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $token
  * @param  \stdClass $viewData
  * @param  \Closure|null $callback
  *
  * @return int
  */
 private function createEmailResetLink(CanResetPasswordContract $user, $token, \stdClass $viewData, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $email = $viewData;
     $email->token = $token;
     $this->mailer->send($this->emailView, compact('email'), function ($m) use($user, $token, $callback) {
         /**
          * @var \Illuminate\Mail\Message $m
          */
         $m->to($user->getEmailForPasswordReset());
         if (!is_null($callback)) {
             call_user_func($callback, $m, $user, $token);
         }
     });
 }
示例#11
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->passwd = Hash::make($user . $password);
     $user->save();
     Auth::login($user);
 }
示例#12
0
 /**
  * Send the password reset link via e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $token
  * @param  \Closure|null $callback
  * @return int
  */
 public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $view = $this->emailView;
     try {
         $this->mailer->send($view, compact('token', 'user'), function ($message) use($user, $token, $callback) {
             $message->from($user->getEmailForPasswordReset());
             $message->to($user->getEmailForPasswordReset());
             if (!is_null($callback)) {
                 call_user_func($callback, $message, $user, $token);
             }
         });
         return Redirect('/')->with('mensaje', 'Se ha enviado el link de cambio de contraseña a tu correo electrónico.');
     } catch (\Exception $ex) {
         switch ($ex->getCode()) {
             case 550:
                 break;
             default:
                 return Redirect('/')->with('mensaje', 'El servidor de correos no ha realizado el envío del link del cambio de contraseña.');
         }
     }
 }
示例#13
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password_301 = bcrypt($password);
     $user->save();
     // if redirect to user zone, we set new user on Auth
     //auth($this->getGuard())->login($user);
 }
示例#14
0
 /**
  * Determine if a reminder record exists and is valid.
  *
  * @param \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param string                                      $token
  *
  * @return bool
  */
 public function exists(CanResetPassword $user, $token)
 {
     $email = $user->getEmailForPasswordReset();
     $reminder = $this->makeSelect()->where('o.email = :email')->andWhere('o.token = :token')->setParameter('email', $email)->setParameter('token', $token)->getQuery()->getOneOrNullResult();
     return $reminder != null && !$this->reminderExpired($reminder);
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = $password;
     $user->save();
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     /*
      * --------------------------------------------------------------------------
      * Update password
      * --------------------------------------------------------------------------
      * Hash new password and update database related the user.
      */
     $user->password = bcrypt($password);
     $user->save();
     /*
      * --------------------------------------------------------------------------
      * Send email notification
      * --------------------------------------------------------------------------
      * Make sure user is noticed by email information that they recently change
      * their password.
      */
     Mail::send('emails.admin.reset', ['name' => $user->name], function ($message) use($user) {
         $message->from(env('MAIL_ADDRESS', '*****@*****.**'), env('MAIL_NAME', 'Infogue.id'));
         $message->replyTo('*****@*****.**', env('MAIL_NAME', 'Infogue.id'));
         $message->to($user->email)->subject('Password has been reset');
     });
     Auth::guard($this->getGuard())->login($user);
 }
 /**
  * Reset the given user's password.
  *
  * @param \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param string                                      $password
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     $this->fireEvent('reset.success', request(), 'Password reset', false);
     auth()->login($user);
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     /** @var $user User */
     $user->setPassword($this->hasher->make($password));
     $this->em->persist($user);
     $this->em->flush();
     Auth::guard($this->getGuard())->login($user);
 }
 /**
  * Determine if a token record exists and is valid.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @return bool
  */
 public function exists(CanResetPasswordContract $user, $token)
 {
     $email = $user->getEmailForPasswordReset();
     $token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();
     return $token && !$this->tokenExpired($token);
 }
示例#20
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string                                      $password
  * @author Cali
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     Auth::guard($this->getGuard())->login($user);
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = $password;
     // no need to bcrypt here as passwords are automatically hashed in User Model
     $user->save();
     Auth::login($user);
 }
示例#22
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = $password;
     $user->save();
     auth()->login($user);
 }
示例#23
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->setPassword($password);
     Auth::login($user);
 }
示例#24
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->forceFill(['password' => bcrypt($password), 'remember_token' => Str::random(60)])->save();
     $this->guard()->login($user);
 }
示例#25
0
 /**
  * Reset the given user's password.
  *
  * @param \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param string                                      $password
  *
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->forceFill(['password' => $password, 'remember_token' => str_random(60)])->save();
     \Auth::guard($this->getGuard())->login($user);
 }
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     // Do not crypt the password here, the User model does it.
     $user->password = $password;
     $user->save();
     $user->emailPasswordChange();
     Auth::login($user);
 }
 /**
  * Create a new token for the user.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @return string
  */
 public function createNewToken(CanResetPasswordContract $user)
 {
     $email = $user->getEmailForPasswordReset();
     $value = str_shuffle(sha1($email . spl_object_hash($this) . microtime(true)));
     return hash_hmac('sha1', $value, $this->hashKey);
 }
示例#28
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     Auth::login($user);
 }
示例#29
0
 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $password
  * @return sttring
  */
 protected function resetPassword($user, $password)
 {
     $user->password = bcrypt($password);
     $user->save();
     $token = JWTAuth::fromUser($user, $this->customClaims());
     return $token;
 }