__construct() public method

Constructor.
public __construct ( array $roles = [] )
$roles array
 public function __construct($user, array $attributes = array(), array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->casAttributes = $attributes;
     parent::setAuthenticated(true);
 }
Beispiel #2
0
 public function __construct($user, $attributes, array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->setAttributes($attributes);
     $this->userIsNew = false;
 }
Beispiel #3
0
 /**
  * @param string
  * @param array $attributes
  * @param array $roles
  */
 public function __construct($providerKey, $identity, array $roles = array())
 {
     parent::__construct($roles);
     $this->setAuthenticated(count($this->getRoles()) > 0);
     $this->providerKey = $providerKey;
     $this->identity = $identity;
 }
 public function __construct(array $roles = array())
 {
     parent::__construct($roles);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
     $this->setSessionToken();
 }
 public function __construct(SteamAuthUser $user, $roles = array())
 {
     parent::__construct($roles);
     parent::setUser($user);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
 }
 /**
  * Constructor.
  *
  * @param string          $key   The key shared with the authentication provider
  * @param string          $user  The user
  * @param RoleInterface[] $roles An array of roles
  */
 public function __construct($key, $user, array $roles = array())
 {
     parent::__construct($roles);
     $this->key = $key;
     $this->setUser($user);
     $this->setAuthenticated(true);
 }
Beispiel #7
0
 /**
  * Constructor.
  *
  * @param string          $secret A secret used to make sure the token is created by the app and not by a malicious client
  * @param string          $user   The user
  * @param RoleInterface[] $roles  An array of roles
  */
 public function __construct($secret, $user, array $roles = array())
 {
     parent::__construct($roles);
     $this->secret = $secret;
     $this->setUser($user);
     $this->setAuthenticated(true);
 }
Beispiel #8
0
 public function __construct($providerKey, array $roles = array())
 {
     parent::__construct($roles);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
     $this->providerKey = $providerKey;
 }
Beispiel #9
0
 public function __construct(array $roles = array())
 {
     parent::__construct($roles);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
     $this->workspaceName = '';
 }
Beispiel #10
0
 /**
  * @param string|object            $user         The username (like a nickname, email address, etc.),
  *                                               or a UserInterface instance
  *                                               or an object implementing a __toString method.
  * @param Organization             $organization The organization
  * @param RoleInterface[]|string[] $roles        An array of roles
  */
 public function __construct($user, Organization $organization, array $roles = [])
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->setOrganizationContext($organization);
     parent::setAuthenticated(count($roles) > 0);
 }
 public function __construct(OpauthResult $result, array $roles = array())
 {
     parent::__construct($roles);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
     $this->setAttribute('opauth', $result);
 }
Beispiel #12
0
 public function __construct($roles = array(), TokenResponseInterface $response)
 {
     parent::__construct($roles);
     $this->response = $response;
     $this->setAttribute('access_token', $response->getAccessToken());
     $this->setAttribute('via', $response->getProviderKey());
     $this->setAttribute('data', $response->getJson());
 }
Beispiel #13
0
 public function __construct($firewallName, $providerKey, $uid, array $role = [])
 {
     parent::__construct($role);
     $this->setAuthenticated(count($role) > 0);
     $this->setAttribute(self::UNIQUE_ID_ATTR, $uid);
     $this->setAttribute(self::PROVIDER_KEY_ATTR, $providerKey);
     $this->setAttribute(self::FIREWALL_NAME_ATTR, $firewallName);
 }
 /**
  * Constructor.
  *
  * @param string|object            $user        The user
  * @param mixed                    $context The user credentials
  * @param string                   $providerKey The provider key
  * @param RoleInterface[]|string[] $roles       An array of roles
  */
 public function __construct($user, $context, $providerKey, array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->credentials = $context;
     $this->providerKey = $providerKey;
     parent::setAuthenticated(count($roles) > 0);
 }
Beispiel #15
0
 public function __construct($usuario, $credenciales, array $roles = array())
 {
     parent::__construct($roles);
     // If the user has roles, consider it authenticated
     $this->setAuthenticated(count($roles) > 0);
     $this->credentials = $credenciales;
     $this->user = $usuario;
 }
 public function __construct($username, $password, array $roles = array('ROLE_USER'))
 {
     parent::__construct($roles);
     $this->setUser($username);
     $this->jira_username = $username;
     $this->jira_password = $password;
     $this->setAuthenticated(count($roles) > 0);
 }
Beispiel #17
0
 /**
  * @param User|string $user
  * @param string      $apiToken
  * @param string      $providerKey
  * @param array       $roles
  */
 public function __construct($user, $apiToken, $providerKey, array $roles = [])
 {
     parent::__construct($roles);
     $this->apiToken = $apiToken;
     $this->providerKey = $providerKey;
     $this->setUser($user);
     $this->setAuthenticated($user instanceof User && count($roles) > 0);
 }
 /**
  * @param array $infos
  */
 public function __construct(array $infos)
 {
     parent::__construct([]);
     $this->clientTokenInfos = isset($infos['client']['id']) ? $infos['client'] : null;
     $this->userTokenInfos = isset($infos['user']['id']) ? $infos['user'] : null;
     $this->impersonatedUserInfos = isset($infos['sudo']['id']) ? $infos['sudo'] : null;
     $this->setUser(isset($this->userTokenInfos['id']) ? $this->userTokenInfos['id'] : 'unknown');
 }
Beispiel #19
0
 /**
  * Constructor.
  *
  * @param string|object            $user        The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method.
  * @param array $scopes
  * @param string $client_id
  * @param RoleInterface[]|string[] $roles       An array of roles
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($user, array $scopes, $client_id, array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->client_id = $client_id;
     $this->scopes = $scopes;
     parent::setAuthenticated(count($roles) > 0);
 }
 public function __construct($uid = '', array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($uid);
     if (!empty($uid)) {
         $this->setAuthenticated(true);
     }
 }
 /**
  * @param mixed  $credentials
  * @param string $guardProviderKey Unique key that bind this token to a specific GuardAuthenticatorInterface
  */
 public function __construct($credentials, $guardProviderKey)
 {
     $this->credentials = $credentials;
     $this->guardProviderKey = $guardProviderKey;
     parent::__construct(array());
     // never authenticated
     parent::setAuthenticated(false);
 }
 /**
  * {@inheritDoc}
  */
 public function __construct($user, array $roles = null)
 {
     if (is_null($roles) && $user instanceof UserInterface) {
         $roles = $user->getRoles();
     }
     parent::__construct($roles ?: []);
     $this->setUser($user);
 }
 /**
  * @param mixed $user
  * @param array $roles
  * @param Account|null $account
  * @param string|null $accessToken
  * @param string|null $idToken
  */
 public function __construct($user, array $roles = array(), Account $account = null, $accessToken = null, $idToken = null)
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->account = $account;
     $this->accessToken = $accessToken;
     $this->idToken = $idToken;
     parent::setAuthenticated(count($roles) > 0);
 }
 public function __construct($providerKey, $clientId, $clientSecret, $redirectUri = '', array $roles = [])
 {
     parent::__construct($roles);
     $this->providerKey = $providerKey;
     $this->clientId = $clientId;
     $this->clientSecret = $clientSecret;
     $this->redirectUri = $redirectUri;
     parent::setAuthenticated(count($roles) > 0);
 }
 /**
  * {@inheritDoc}
  */
 public function __construct($providerKey, $gigyaUserId = '', array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($gigyaUserId);
     if (!empty($gigyaUserId)) {
         $this->setAuthenticated(true);
     }
     $this->providerKey = $providerKey;
 }
Beispiel #26
0
 /**
  * Constructor.
  *
  * @param User $user
  *
  * @throws UsernameNotFoundException
  */
 public function __construct(User $user)
 {
     if (!$user->authenticate()) {
         throw new UsernameNotFoundException('Invalid Contao user given.');
     }
     $this->setUser($user);
     $this->setAuthenticated(true);
     parent::__construct($this->getRolesFromUser($user));
 }
 /**
  * @param string $user
  * @param int    $expirationTime
  * @param string $ipAddress
  * @param string $signature
  * @param array  $roles
  */
 public function __construct($user, $expirationTime, $ipAddress, $signature, array $roles = [])
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->expirationTime = $expirationTime;
     $this->ipAddress = $ipAddress;
     $this->signature = $signature;
     $this->setAuthenticated(count($roles) > 0);
 }
 public function __construct($uid = '', $oauthVerifier, array $roles = array())
 {
     parent::__construct($roles);
     $this->oauthVerifier = $oauthVerifier;
     $this->setUser($uid);
     if (!empty($roles)) {
         parent::setAuthenticated(true);
     }
 }
Beispiel #29
0
 public function __construct($key, $user, $credentials, array $roles, TokenInterface $originalToken)
 {
     parent::__construct($roles);
     $this->originalToken = $originalToken;
     $this->credentials = $credentials;
     $this->key = $key;
     $this->setUser($user);
     $this->setAuthenticated(true);
 }
 /**
  * @param mixed $user
  * @param array $attributes 
  * @param array $roles
  * @throws \InvalidArgumentException
  */
 public function __construct($user = null, $attributes = array(), $roles = array())
 {
     if (empty($roles) && $user instanceof UserInterface) {
         $roles = $user->getRoles();
     }
     parent::__construct($roles);
     $this->setUser($user);
     $this->setAttributes($attributes);
 }