當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserInterface::setConfirmationToken方法代碼示例

本文整理匯總了PHP中FOS\UserBundle\Model\UserInterface::setConfirmationToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserInterface::setConfirmationToken方法的具體用法?PHP UserInterface::setConfirmationToken怎麽用?PHP UserInterface::setConfirmationToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FOS\UserBundle\Model\UserInterface的用法示例。


在下文中一共展示了UserInterface::setConfirmationToken方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onSuccess

 protected function onSuccess(UserInterface $user)
 {
     $user->setPlainPassword($this->getNewPassword());
     $user->setConfirmationToken(null);
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
 }
開發者ID:Anmoldev,項目名稱:FOSUserBundle,代碼行數:7,代碼來源:ResettingFormHandler.php

示例2: onSuccess

 /**
  * @param boolean $confirmation
  */
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $this->userManager->updateUser($user);
 }
開發者ID:leondejong,項目名稱:symfony2-bundle-examples,代碼行數:16,代碼來源:RegistrationFormHandler.php

示例3: process

 public function process(UserInterface $user)
 {
     $this->form->setData(new ResetPassword($user));
     if ('POST' == $this->request->getMethod()) {
         $this->form->bindRequest($this->request);
         if ($this->form->isValid()) {
             $user->setPlainPassword($this->getNewPassword());
             $user->setConfirmationToken(null);
             $user->setEnabled(true);
             $this->userManager->updateUser($user);
             return true;
         }
     }
     return false;
 }
開發者ID:nightchiller,項目名稱:UserBundle,代碼行數:15,代碼來源:ResettingFormHandler.php

示例4: onSuccess

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $user->setRoles(array('ROLE_CLIENT'));
     $user->setEnabled(true);
     $user->setLastLogin(new \DateTime());
 }
開發者ID:junjinZ,項目名稱:wealthbot,代碼行數:15,代碼來源:ClientRegistrationFormHandler.php

示例5: onSuccess

 /**
  * @param boolean $confirmation
  */
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $event = new FormEvent($this->form, $this->request);
     $this->event_dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
     $this->userManager->updateUser($user);
 }
開發者ID:bambamboole,項目名稱:AjaxFOSUserBundle,代碼行數:18,代碼來源:RegistrationFormHandler.php

示例6: onSuccess

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $user->setRoles(array('ROLE_RIA'));
     $riaCompanyInformation = new RiaCompanyInformation();
     $riaCompanyInformation->setName($user->getProfile()->getCompany());
     $riaCompanyInformation->setRia($user);
     $user->setRiaCompanyInformation($riaCompanyInformation);
     $this->userManager->updateUser($user);
     if ($riaCompanyInformation->getRelationshipType() === RiaCompanyInformation::RELATIONSHIP_TYPE_LICENSE_FEE) {
         $this->feeManager->resetRiaFee($user);
     }
 }
開發者ID:junjinZ,項目名稱:wealthbot,代碼行數:21,代碼來源:RiaRegistrationFormHandler.php

示例7: sendResettingEmailMessageURL

 /**
  * Send mail to reset user password (return URL)
  * 
  * @param UserInterface $user
  * @param string        $route_reset_connexion
  * @param string        $title
  * @param array         $parameters
  * 
  * @return string
  * @access public
  * @author Etienne de Longeaux <etienne.delongeaux@gmail.com>
  */
 public function sendResettingEmailMessageURL(UserInterface $user, $route_reset_connexion, $parameters = array())
 {
     $tokenGenerator = $this->container->get('fos_user.util.token_generator');
     $user->setConfirmationToken($tokenGenerator->generateToken());
     $em = $this->container->get('doctrine')->getManager();
     $em->persist($user);
     $em->flush();
     $this->container->get('request')->getSession()->set(static::SESSION_EMAIL, $this->getObfuscatedEmail($user));
     $parameters = array_merge($parameters, array('token' => $user->getConfirmationToken()));
     $url = $this->container->get('sfynx.tool.route.factory')->getRoute($route_reset_connexion, $parameters);
     $html_url = 'http://' . $this->container->get('request')->getHttpHost() . $this->container->get('request')->getBasePath() . $url;
     return $html_url;
 }
開發者ID:pigroupe,項目名稱:SfynxAuthBundle,代碼行數:25,代碼來源:PiMailerManager.php

示例8: tokenUser

 /**
  * Return the token object.
  * 
  * @param UserInterface $user
  * 
  * @return UsernamePasswordToken
  * @access public
  * @author Etienne de Longeaux <etienne.delongeaux@gmail.com>
  */
 public function tokenUser(UserInterface $user)
 {
     $tokenGenerator = $this->container->get('fos_user.util.token_generator');
     $user->setConfirmationToken($tokenGenerator->generateToken());
     $em = $this->container->get('doctrine')->getManager();
     $em->persist($user);
     $em->flush();
     $this->container->get('request')->getSession()->set(PiMailerManager::SESSION_EMAIL, $this->container->get('sfynx.auth.mailer')->getObfuscatedEmail($user));
     return $user->getConfirmationToken();
 }
開發者ID:pigroupe,項目名稱:SfynxAuthBundle,代碼行數:19,代碼來源:PiAuthenticateManager.php

示例9: onSuccess

 /**
  * @param UserInterface $user
  */
 protected function onSuccess(UserInterface $user)
 {
     // Disabling user password registration
     //        $user->setPlainPassword($this->getNewPassword());
     $user->setConfirmationToken(null);
     $user->setPasswordRequestedAt(null);
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
     // getting DB user
     $dbUser = $this->em->getRepository('SpiritDevDBoxUserBundle:User')->findOneByUsername($user->getUsername());
     // Updating LDAP Password
     $this->ldap->ldapUpdatePassword($dbUser, $this->getNewPassword());
 }
開發者ID:spirit-dev,項目名稱:dbox-user,代碼行數:16,代碼來源:ResettingFormHandler.php

示例10: onSuccess

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     // Note: if you plan on modifying the user then do it before calling the
     // parent method as the parent method will flush the changes
     //parent::onSuccess($user, $confirmation);
     if ($confirmation) {
         $user->setEnabled(false);
         $tokenGenerator = $this->container->get('fos_user.util.token_generator');
         $user->setConfirmationToken($tokenGenerator->generateToken());
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setConfirmationToken(null);
         $user->setEnabled(true);
     }
     $this->userManager->updateUser($user);
     // otherwise add your functionality here
 }
開發者ID:UNCHenryMelara,項目名稱:sca-mh-minsal,代碼行數:17,代碼來源:RegistrationFormHandler.php


注:本文中的FOS\UserBundle\Model\UserInterface::setConfirmationToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。