コード例 #1
0
ファイル: FormAuthentication.php プロジェクト: Okami-/ilios
 /**
  * Update users to the new password encoding when they login
  * @param  AuthenticationEntityInterface $authEntity
  * @param  string         $password
  */
 protected function updateLegacyPassword(AuthenticationEntityInterface $authEntity, $password)
 {
     if ($authEntity->isLegacyAccount()) {
         //we have to have a valid token to update the user because the audit log requires it
         $authenticatedToken = new PreAuthenticatedToken($authEntity->getUser(), 'fakekey', 'fakeProvider');
         $authenticatedToken->setAuthenticated(true);
         $this->tokenStorage->setToken($authenticatedToken);
         $authEntity->setPasswordSha256(null);
         $encodedPassword = $this->encoder->encodePassword($authEntity->getUser(), $password);
         $authEntity->setPasswordBcrypt($encodedPassword);
         $this->authManager->updateAuthentication($authEntity);
     }
 }
コード例 #2
0
ファイル: User.php プロジェクト: stopfstedt/ilios
 /**
  * {@inheritdoc}
  */
 public function setAuthentication(AuthenticationInterface $authentication = null)
 {
     $this->authentication = $authentication;
     $authentication->setUser($this);
 }