Skip to content
Merged

OAuth2 #5753

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor: Format code - refs BT#21881
  • Loading branch information
AngelFQC committed Aug 27, 2024
commit 4c930fe8116b25e510739ea13badf2a2c8c5b040
1 change: 1 addition & 0 deletions src/CoreBundle/Repository/ExtraFieldValuesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function findLegalAcceptByItemId($itemId)

/**
* @return ExtraFieldValues|array<ExtraFieldValues>|null
*
* @throws NonUniqueResultException
*/
public function findByVariableAndValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Chamilo\CoreBundle\ServiceHelper\AuthenticationConfigHelper;
use Cocur\Slugify\SlugifyInterface;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use KnpU\OAuth2ClientBundle\Client\OAuth2ClientInterface;
use League\OAuth2\Client\Provider\FacebookUser;
use League\OAuth2\Client\Token\AccessToken;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -52,7 +51,7 @@ protected function userLoader(AccessToken $accessToken): User
$user
->setFirstname($resourceOwner->getFirstName())
->setLastname($resourceOwner->getLastName())
//->setLocale($resourceOwner->getLocale())
// ->setLocale($resourceOwner->getLocale())
->setEmail($resourceOwner->getEmail())
->setUsername($this->changeToValidChamiloLogin($resourceOwner->getEmail()))
->setPlainPassword('facebook')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function userLoader(AccessToken $accessToken): User
$user = (new User())
->setFirstname('OAuth2 User default firstname')
->setLastname('OAuth2 User default firstname')
->setEmail('oauth2user_'.$resourceOwnerId.'@'.(gethostname() or 'localhost'))
->setEmail('oauth2user_'.$resourceOwnerId.'@'.(gethostname() ?: 'localhost'))
->setUsername($username)
->setPlainPassword($username)
->setStatus(STUDENT)
Expand Down Expand Up @@ -120,7 +120,7 @@ protected function userLoader(AccessToken $accessToken): User
}

/**
* Set user information from the resource owner's data or the user itself
* Set user information from the resource owner's data or the user itself.
*/
public function saveUserInfo(User $user, array $resourceOwnerData, array $providerParams): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
namespace Chamilo\CoreBundle\Security\Authenticator\OAuth2;

use Chamilo\CoreBundle\Entity\User;
use KnpU\OAuth2ClientBundle\Client\OAuth2ClientInterface;
use League\OAuth2\Client\Token\AccessToken;
use Stevenmaguire\OAuth2\Client\Provider\KeycloakResourceOwner;
use Symfony\Component\HttpFoundation\Request;
Expand Down