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


PHP CanResetPassword::getEmailForPasswordReset方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: exists

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

示例5: exists

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

示例6: 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

示例7: createNewToken

 /**
  * 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);
 }
开发者ID:visualturk,项目名称:framework,代码行数:12,代码来源:DatabaseTokenRepository.php

示例8: emailResetLink

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


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