当前位置: 首页>>代码示例>>PHP>>正文


PHP Auth\CanResetPassword类代码示例

本文整理汇总了PHP中Illuminate\Contracts\Auth\CanResetPassword的典型用法代码示例。如果您正苦于以下问题:PHP CanResetPassword类的具体用法?PHP CanResetPassword怎么用?PHP CanResetPassword使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CanResetPassword类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resetPassword

 /**
  * 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);
 }
开发者ID:rajeshpillai,项目名称:dfe-common,代码行数:13,代码来源:CommonPasswordController.php

示例2: resetPassword

 /**
  * 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);
 }
开发者ID:linhntaim,项目名称:katniss,代码行数:14,代码来源:PasswordController.php

示例3: resetPassword

 /**
  * 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);
 }
开发者ID:jjiko,项目名称:blog,代码行数:14,代码来源:ResetsPasswords.php

示例4: emailResetLink

 /**
  * 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);
 }
开发者ID:stevebauman,项目名称:auth,代码行数:18,代码来源:PasswordBroker.php

示例5: sendNewPassword

 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());
     });
 }
开发者ID:laravolt,项目名称:auth,代码行数:9,代码来源:Password.php

示例6: requestChangePassword

 /**
  * 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;
 }
开发者ID:master0mind,项目名称:Lavender,代码行数:18,代码来源:Password.php

示例7: emailResetLink

 /**
  * 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);
         }
     });
 }
开发者ID:causelabs,项目名称:laravel52-boilerplate,代码行数:25,代码来源:CustomPasswordBroker.php

示例8: resetPassword

 /**
  * 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);
 }
开发者ID:projnoah,项目名称:noah,代码行数:13,代码来源:ResetsPasswords.php

示例9: resetPassword

 /**
  * 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);
 }
开发者ID:hoangnd25,项目名称:laravel-boilerplate,代码行数:15,代码来源:PasswordController.php

示例10: resetPassword

 /**
  * 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);
 }
开发者ID:mycrazydog,项目名称:mm-shibboleth,代码行数:15,代码来源:PasswordController.php

示例11: resetPassword

 /**
  * 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);
 }
开发者ID:Jachase,项目名称:Laravel-shop,代码行数:13,代码来源:PasswordController.php

示例12: createEmailResetLink

 /**
  * 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);
         }
     });
 }
开发者ID:linguisticteam,项目名称:laravel-boilerplate,代码行数:27,代码来源:PasswordBroker.php

示例13: resetPassword

 /**
  * 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);
 }
开发者ID:huludini,项目名称:pw-web,代码行数:13,代码来源:PasswordController.php

示例14: resetPassword

 /**
  * 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);
 }
开发者ID:austinkregel,项目名称:laravel-auth-login,代码行数:13,代码来源:PasswordController.php

示例15: resetPassword

 /**
  * 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);
 }
开发者ID:darryldecode,项目名称:laravelbackend,代码行数:14,代码来源:PasswordController.php


注:本文中的Illuminate\Contracts\Auth\CanResetPassword类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。