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


PHP UserInterface::setEnabled方法代码示例

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


在下文中一共展示了UserInterface::setEnabled方法的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

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     $user->setUsername($user->getUsername());
     $user->setLocked(false);
     $user->setEnabled(true);
     $user->setCreatedAt(new \DateTime('now'));
     $em = $this->container->get('doctrine.odm.mongodb.document_manager');
     parent::onSuccess($user, $confirmation);
 }
开发者ID:holtchesley,项目名称:Zeega,代码行数:9,代码来源:RegistrationFormHandler.php

示例3: onSuccess

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setConfirmationToken(null);
         $user->setEnabled(true);
     }
     $this->userManager->updateUser($user);
 }
开发者ID:Anmoldev,项目名称:FOSUserBundle,代码行数:11,代码来源:RegistrationFormHandler.php

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

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

示例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_CLIENT'));
     $user->setEnabled(true);
     $user->setLastLogin(new \DateTime());
 }
开发者ID:junjinZ,项目名称:wealthbot,代码行数:15,代码来源:ClientRegistrationFormHandler.php

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

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

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