class UserAuthenticator in Social Post 8.2
Same name and namespace in other branches
- 3.x src/User/UserAuthenticator.php \Drupal\social_post\User\UserAuthenticator
Manages Drupal authentication tasks for Social Post.
Hierarchy
- class \Drupal\social_api\User\UserAuthenticator
- class \Drupal\social_post\User\UserAuthenticator
Expanded class hierarchy of UserAuthenticator
1 file declares its use of UserAuthenticator
- OAuth2ControllerBase.php in src/
Controller/ OAuth2ControllerBase.php
1 string reference to 'UserAuthenticator'
1 service uses UserAuthenticator
File
- src/
User/ UserAuthenticator.php, line 10
Namespace
Drupal\social_post\UserView source
class UserAuthenticator extends SocialApiUserAuthenticator {
/**
* The Social Post User Manager.
*
* @var \Drupal\social_post\User\UserManager
*/
protected $userManager;
/**
* Gets the Drupal user id based on the provider user id.
*
* @param string $provider_user_id
* User's id on provider.
*
* @return int|false
* The Drupal user id if it exists.
* False otherwise.
*/
public function getDrupalUserId($provider_user_id) {
return $this->userManager
->getDrupalUserId($provider_user_id);
}
/**
* Add user record in Social Post Entity.
*
* @param string $name
* The user name in the provider.
* @param int|string $provider_user_id
* Unique Social ID returned by social network.
* @param string $url
* The URL to the profile in the provider.
* @param string $token
* Token to be used for autoposting.
*
* @return bool
* True if User record was created or False otherwise
*/
public function addUserRecord($name, $provider_user_id, $url, $token) {
return $this->userManager
->addUserRecord($name, $this
->currentUser()
->id(), $provider_user_id, $url, $token);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UserAuthenticator:: |
protected | property | The current Drupal user. | |
UserAuthenticator:: |
protected | property | The Social API data handler. | |
UserAuthenticator:: |
protected | property | The entity type. | |
UserAuthenticator:: |
protected | property | The Drupal Entity Manager. | |
UserAuthenticator:: |
protected | property | The Drupal logger factory. | |
UserAuthenticator:: |
protected | property | The Messenger service. | |
UserAuthenticator:: |
protected | property | The implementer plugin id. | |
UserAuthenticator:: |
protected | property | Session keys to nullify is user could not be logged in. | |
UserAuthenticator:: |
protected | property |
The Social Post User Manager. Overrides UserAuthenticator:: |
|
UserAuthenticator:: |
public | function | Add user record in Social Post Entity. | |
UserAuthenticator:: |
public | function | Returns the current user. | |
UserAuthenticator:: |
public | function | Gets the Drupal user id based on the provider user id. | |
UserAuthenticator:: |
public | function | Gets the implementer plugin id. | |
UserAuthenticator:: |
public | function | Nullifies session keys if user could not logged in. | |
UserAuthenticator:: |
public | function | Sets the implementer plugin id. | |
UserAuthenticator:: |
public | function | Sets the session keys to nullify if user could not logged in. | |
UserAuthenticator:: |
public | function | Constructor. |