Skip to content

Commit

Permalink
made social-login optional
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Aug 16, 2018
1 parent 85fbac2 commit be51861
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
5 changes: 5 additions & 0 deletions DependencyInjection/SuluCommunityExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('services.xml');
$loader->load('validator.xml');

$bundles = $container->getParameter('kernel.bundles');
if (array_key_exists('HttplugBundle', $bundles) && array_key_exists('HWIOAuthBundle', $bundles)) {
$loader->load('social-media-login.xml');
}

if ($lastLoginEnabled) {
$lastLoginRefreshInterval = $config[Configuration::LAST_LOGIN][Configuration::REFRESH_INTERVAL];

Expand Down
7 changes: 0 additions & 7 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,5 @@
<argument type="service" id="templating"/>
<argument type="service" id="translator"/>
</service>

<!-- social-media -->
<service id="sulu_community.social_media.oauth_provider" class="Sulu\Bundle\CommunityBundle\SocialMedia\SocialMediaUserProvider">
<argument type="service" id="sulu_community.community_manager.registry"/>
<argument type="service" id="request_stack"/>
<argument type="service" id="doctrine"/>
</service>
</services>
</container>
13 changes: 13 additions & 0 deletions Resources/config/social-media-login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sulu_community.social_media.oauth_provider" class="Sulu\Bundle\CommunityBundle\SocialMedia\SocialMediaUserProvider">
<argument type="service" id="sulu_community.community_manager.registry"/>
<argument type="service" id="request_stack"/>
<argument type="service" id="doctrine"/>
</service>
</services>
</container>
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"symfony/routing": "^3.4",
"symfony/security": "^3.4",
"symfony/security-acl": "^2.8 || ^3.0",
"symfony/swiftmailer-bundle": "^2.6.4",
"hwi/oauth-bundle": "^0.6.2",
"php-http/httplug-bundle": "^1.10"
"symfony/swiftmailer-bundle": "^2.6.4"
},
"require-dev": {
"hwi/oauth-bundle": "^0.6.2",
"jackalope/jackalope-doctrine-dbal": "^1.2.5",
"massive/search-bundle": "@dev",
"php-http/httplug-bundle": "^1.10",
"phpstan/phpstan": "^0.10.0",
"phpunit/phpunit": "^6.5",
"symfony/browser-kit": "^3.4",
Expand All @@ -39,6 +39,10 @@
"zendframework/zend-stdlib": "~2.3",
"zendframework/zendsearch": "@dev"
},
"suggest": {
"hwi/oauth-bundle": "Allows register/login with social-media accounts",
"php-http/httplug-bundle": "Dependency of hwi/oauth-bundle"
},
"keywords": [
"registration",
"login",
Expand Down

0 comments on commit be51861

Please sign in to comment.