public function GoogleLinkController::getSdk in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.2 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.3 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.4 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.5 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.6 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.7 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
- 8.8 modules/custom/social_auth_google/src/Controller/GoogleLinkController.php \Drupal\social_auth_google\Controller\GoogleLinkController::getSdk()
Returns the SDK instance or RedirectResponse when error occurred.
Return value
mixed|\Symfony\Component\HttpFoundation\RedirectResponse Can return an SDK instance or a RedirectResponse to the user edit form.
2 calls to GoogleLinkController::getSdk()
- GoogleLinkController::linkAccount in modules/
custom/ social_auth_google/ src/ Controller/ GoogleLinkController.php - Response for path 'social-api/link/google'.
- GoogleLinkController::linkAccountCallback in modules/
custom/ social_auth_google/ src/ Controller/ GoogleLinkController.php - Makes joining between account on this site and account on social network.
File
- modules/
custom/ social_auth_google/ src/ Controller/ GoogleLinkController.php, line 128
Class
- GoogleLinkController
- Class GoogleLinkController.
Namespace
Drupal\social_auth_google\ControllerCode
public function getSdk() {
$network_manager = $this->networkManager
->createInstance('social_auth_google');
if (!$network_manager
->isActive()) {
drupal_set_message($this
->t('@network is disallowed. Contact site administrator.', [
'@network' => $this
->t('Google'),
]), 'error');
return $this
->redirect('entity.user.edit_form', [
'user' => $this
->currentUser()
->id(),
]);
}
if (!($sdk = $network_manager
->getSdk())) {
drupal_set_message($this
->t('@network Auth not configured properly. Contact site administrator.', [
'@network' => $this
->t('Google'),
]), 'error');
return $this
->redirect('entity.user.edit_form', [
'user' => $this
->currentUser()
->id(),
]);
}
return $sdk;
}