class SocialAuthController in Social Auth 8.2
Same name and namespace in other branches
- 8 src/Controller/SocialAuthController.php \Drupal\social_auth\Controller\SocialAuthController
- 3.x src/Controller/SocialAuthController.php \Drupal\social_auth\Controller\SocialAuthController
Manages login buttons settings and integration table renderization.
Hierarchy
- class \Drupal\social_auth\Controller\SocialAuthController extends \Drupal\social_api\Controller\SocialApiController
Expanded class hierarchy of SocialAuthController
File
- src/
Controller/ SocialAuthController.php, line 10
Namespace
Drupal\social_auth\ControllerView source
class SocialAuthController extends SocialApiController {
/**
* Sets the settings for the login button for the given social networking.
*
* @param string $module
* The module machine name.
* @param string $route
* The route name of the user authentication controller.
* @param string $img_path
* The path of the image for login.
*/
public static function setLoginButtonSettings($module, $route, $img_path) {
$config = \Drupal::configFactory()
->getEditable('social_auth.settings');
$img_path = drupal_get_path('module', $module) . '/' . $img_path;
$config
->set('auth.' . $module . '.route', $route)
->set('auth.' . $module . '.img_path', $img_path)
->save();
}
/**
* Delete the settings for the login button for the given social networking.
*
* @param string $module
* The module machine name.
*/
public static function deleteLoginButtonSettings($module) {
$config = \Drupal::configFactory()
->getEditable('social_auth.settings');
$config
->clear('auth.' . $module)
->save();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SocialAuthController:: |
public static | function | Delete the settings for the login button for the given social networking. | |
SocialAuthController:: |
public static | function | Sets the settings for the login button for the given social networking. |