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


PHP User::getPassword方法代码示例

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


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

示例1: authenticate

 /**
  * 认证用户
  */
 public function authenticate(User $user, $providerKey)
 {
     $authenticationToken = new UsernamePasswordToken($user, $user->getPassword(), $providerKey, $user->getRoles());
     $authenticationEvent = new InteractiveLoginEvent($this->request, $authenticationToken);
     $this->tokenStorage->setToken($authenticationToken);
     $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $authenticationEvent);
 }
开发者ID:timy-life,项目名称:segments,代码行数:10,代码来源:SymfonyAuthenticationService.php

示例2: testBasicGettersSetters

 public function testBasicGettersSetters()
 {
     $user = new User();
     $user->setUsername('Toto');
     $user->setEmail('toto@tata.com');
     $user->setIsActive(false);
     $user->setPassword('1234');
     $this->assertEquals('Toto', $user->getUsername());
     $this->assertEquals('toto@tata.com', $user->getEmail());
     $this->assertEquals(false, $user->isActive());
     $this->assertEquals('1234', $user->getPassword());
 }
开发者ID:Pamoi,项目名称:photo-gallery-api,代码行数:12,代码来源:UserTest.php

示例3: __construct

 /**
  * UserModel constructor.
  * @param User $user
  */
 public function __construct(User $user)
 {
     $this->setId($user->getId());
     $this->setUsername($user->getUsername());
     $this->setUserFirstName($user->getUserFirstName());
     $this->setUserLastName($user->getUserLastName());
     $this->setEmail($user->getEmail());
     $this->setPassword($user->getPassword());
     $this->setApiKey($user->getApiKey());
     $role = $this->determineTheBiggestRole($user);
     if ($role) {
         $this->setRole(new RoleModel($role));
     }
 }
开发者ID:Gardax,项目名称:studentsSystem,代码行数:18,代码来源:UserModel.php

示例4: editAction

 /**
  * @param User    $user
  * @param Request $request
  *
  * @return Response
  *
  * @Route("/{id}", name="app_users_edit", requirements={"id": "^\d+$"}, methods={"GET", "POST"})
  * @Security("has_role('ROLE_AUTH_USERS_EDIT')")
  */
 public function editAction(User $user, Request $request)
 {
     $originalPassword = $user->getPassword();
     $form = $this->get('form.factory')->create(UserType::class, $user, ['delete' => $this->isUserDeletable($user), 'activate' => $this->isUserActivate($user)]);
     if ($form->handleRequest($request) && $form->isValid()) {
         $manager = $this->get('doctrine.orm.entity_manager');
         // Delete section
         if ($form->has('delete') && $form->get('delete')->isClicked()) {
             $manager->remove($user);
             $manager->flush();
             $this->get('session')->getFlashBag()->add('notice', $this->get('translator')->trans('users.message.delete'));
             return new RedirectResponse($this->generateUrl('app_users_list'));
         }
         $this->get('app.password')->encodePassword($user, $originalPassword);
         $manager->flush();
         $this->get('session')->getFlashBag()->add('notice', $this->get('translator')->trans('users.message.edit'));
     }
     return $this->render('users/edit.html.twig', ['form' => $form->createView()]);
 }
开发者ID:nicolasdewez,项目名称:webhome-auth,代码行数:28,代码来源:UsersController.php

示例5: getPassword

 /**
  * {@inheritDoc}
  */
 public function getPassword()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPassword', []);
     return parent::getPassword();
 }
开发者ID:reathh,项目名称:MotikarqSystem,代码行数:8,代码来源:__CG__AppBundleEntityUser.php

示例6: fromUser

 public function fromUser(User $user)
 {
     $userContract = new self();
     //Force fetch
     $user->getMyContacts()->toArray();
     $user->getConversations()->toArray();
     $user->getContactsWithMe()->toArray();
     $userContract->id = $user->getId();
     $userContract->tkey = $user->getTkey();
     $userContract->avatar = $user->getAvatar();
     $userContract->birthday = $user->getBirthday();
     $userContract->cdate = $user->getCdate();
     $userContract->conversations = $user->getConversations();
     $userContract->connections = $user->getConnections();
     $userContract->contactsphones = $user->getContactsphones();
     $userContract->email = $user->getEmail();
     $userContract->fname = $user->getFname();
     $userContract->lastUpdate = $user->getLastUpdate();
     $userContract->lname = $user->getLname();
     $userContract->contactsWithMe = $user->getContactsWithMe();
     $user->getMyContacts()->toArray();
     $userContract->myContacts = $user->getMyContacts();
     $userContract->password = $user->getPassword();
     $userContract->phone = $user->getPhone();
     $userContract->username = $user->getUsername();
     return $userContract;
 }
开发者ID:jparaskakis,项目名称:thesis_back,代码行数:27,代码来源:UserContract.php

示例7: loginUser

 /**
  * Logs this user into the system
  *
  * @param User $user
  */
 public function loginUser(User $user)
 {
     $token = new UsernamePasswordToken($user, $user->getPassword(), 'main', $user->getRoles());
     $this->container->get('security.token_storage')->setToken($token);
 }
开发者ID:zcichanski,项目名称:symfony2-rest,代码行数:10,代码来源:BaseController.php

示例8: createUser

 /**
  * @param User $user
  *
  * @return UserDTO
  */
 public function createUser(User $user)
 {
     if ($user->getPositionLat() . $user->getPositionLong() != "") {
         $infos = Geocoder::getLocation($user->getPositionLat(), $user->getPositionLong());
         $city = Geocoder::getCityFromAddress($infos);
         $department = Geocoder::getDepartmentFromAddress($infos);
         $country = Geocoder::getCountryFromAddress($infos);
         $user->setPositionCity($city);
         $user->setPositionDep($department);
         $user->setPositionCountry($country);
     }
     $user->setPassword(sha1($user->getPassword()));
     if ($user->getPhoto() == "") {
         $user->setPhoto("https://randomuser.me/api/portraits/med/men/54.jpg");
     }
     $this->em->persist($user);
     $this->em->flush();
     return new UserDTO($user);
 }
开发者ID:gototog,项目名称:api-catwomap,代码行数:24,代码来源:CrudUserService.php

示例9: login

 private function login(User $user, $client)
 {
     // dummy call to bypass the hasPreviousSession check
     $crawler = $client->request('GET', '/');
     $firewall = 'main';
     $token = new UsernamePasswordToken($user, $user->getPassword(), $firewall, $user->getRoles());
     $session = $client->getContainer()->get('session');
     $session->set('_security_' . $firewall, serialize($token));
     $session->save();
 }
开发者ID:redaLaanait,项目名称:SYMF_MOCK,代码行数:10,代码来源:ApplicationAvailabilityFunctionalTest.php


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