當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。