Commit 63cd1239 authored by Sebastian Castro's avatar Sebastian Castro

Fixs oauth login when parameters disabled

parent d9d175a8
......@@ -10,9 +10,9 @@ imports:
- { resource: "@BiopenCoreBundle/Resources/config/services.yml" }
- { resource: "@BiopenCoreBundle/Resources/config/services_admin.yml" }
- { resource: "@BiopenGeoDirectoryBundle/Resources/config/services.yml" }
- { resource: "@BiopenGeoDirectoryBundle/Resources/config/services_admin.yml" }
- { resource: "@BiopenSaasBundle/Resources/config/services.yml" }
- { resource: "@BiopenSaasBundle/Resources/config/services_admin.yml" }
- { resource: "@BiopenGeoDirectoryBundle/Resources/config/services_admin.yml" }
- { resource: "@BiopenSaasBundle/Resources/config/services.yml" }
- { resource: "@BiopenSaasBundle/Resources/config/services_admin.yml" }
- { resource: "@SonataUserBundle/Resources/config/services.yml" }
# Put parameters here that don't need to change on each machine where the app is deployed
......@@ -56,6 +56,9 @@ twig:
use_as_saas: '%use_as_saas%'
base_path: '%base_path%'
contact_email: '%contact_email%'
oauth_communs: '%oauth_communs_id%'
oauth_google: '%oauth_google_id%'
oauth_facebook: '%oauth_facebook_id%'
strict_variables: "%kernel.debug%"
paths:
"%kernel.root_dir%/../src/Biopen/GeoDirectoryBundle/Resources/views": BiopenGeoDirectory
......@@ -69,13 +72,13 @@ twig:
form:
resources:
- 'SonataFormatterBundle:Form:formatter.html.twig'
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
charset: UTF8
# Mongodb Configuration
doctrine_mongodb:
connections:
......@@ -86,7 +89,7 @@ doctrine_mongodb:
document_managers:
default:
auto_mapping: true
mappings:
mappings:
# gedmo_translatable:
# type: annotation
# prefix: Gedmo\Translatable\Document
......@@ -122,9 +125,9 @@ stof_doctrine_extensions:
timestampable: true
pix_sortable_behavior:
db_driver: mongodb
db_driver: mongodb
position_field:
default: position
default: position
entities:
Biopen\GeoDirectoryBundle\Document\Option: index
Biopen\GeoDirectoryBundle\Document\Category: index
......@@ -153,7 +156,6 @@ assetic:
# Error monitoring
sentry:
dsn: "https://6145d1aac36c429781fc1b0f79b0da48@sentry.io/1402018"
\ No newline at end of file
dsn: "https://6145d1aac36c429781fc1b0f79b0da48@sentry.io/1402018"
......@@ -26,16 +26,16 @@ class ConfigurationUserAdmin extends ConfigurationAbstractAdmin
$formMapper
->add('user.enableRegistration', 'checkbox', array('label' => "Autoriser la création de compte", 'required' => false))
->add('user.sendConfirmationEmail', 'checkbox', array('label' => "Valider la création avec un email de confirmation", 'required' => false));
// provide oauth id if configured
if ($container->getParameter('oauth_communs_id') != "disabled") {
$formMapper->add('user.loginWithLesCommuns', 'checkbox', array('label' => "Activer la connexion avec \"LesCommuns.org\"", 'required' => false));
$formMapper->add('user.loginWithMonPrintemps', 'checkbox', array('label' => "Activer la connexion avec MonPrintemps", 'required' => false));
}
if ($container->getParameter('oauth_google_id') != "disabled")
if ($container->getParameter('oauth_google_id') != "disabled")
$formMapper->add('user.loginWithGoogle', 'checkbox', array('label' => "Activer la connexion avec Google", 'required' => false));
if ($container->getParameter('oauth_facebook_id') != "disabled")
if ($container->getParameter('oauth_facebook_id') != "disabled")
$formMapper->add('user.loginWithFacebook', 'checkbox', array('label' => "Activer la connexion avec Facebook", 'required' => false));
}
}
\ No newline at end of file
<!-- Pop up message alerte-->
{% set oauthLoginAvailable = config.user.loginWithLesCommuns or config.user.loginWithMonPrintemps or config.user.loginWithGoogle or config.user.loginWithFacebook %}
{% set oauthLoginAvailable = config.user.loginWithLesCommuns and oauth_communs != 'disabled' or config.user.loginWithMonPrintemps and oauth_communs != 'disabled' or config.user.loginWithGoogle and oauth_google != 'disabled' or config.user.loginWithFacebook and oauth_facebook != 'disabled' %}
<div id="popup-login" class="modal page-modal {{ oauthLoginAvailable ? 'with-oauth' : 'without-oauth' }}">
<div class="modal-content page-modal-content">
<span class="icon btn-back gogo-icon-material-design-icons-1" onclick="$('#popup-login').closeModal()"></span>
<h1>Connexion</h1>
<h1>Connexion</h1>
<div class="row login-form">
{# OAuth LOGIN #}
{% if oauthLoginAvailable %}
{% if oauthLoginAvailable %}
<div class="col s12 m6 oauth-section section">
{% if config.user.loginWithLesCommuns %}
{% if config.user.loginWithLesCommuns and oauth_communs != 'disabled' %}
<a class="oauth-btn waves-effect waves-light communs" href="{{ hwi_oauth_login_url('communs') }}"><i class="icon gogo-icon-communs left"></i>LesCommuns.org</a>
{% endif %}
{% if config.user.loginWithMonPrintemps %}
{% if config.user.loginWithMonPrintemps and oauth_communs != 'disabled' %}
<a class="oauth-btn waves-effect waves-light printemps" href="{{ hwi_oauth_login_url('communs') }}"><i class="icon gogo-icon-printemps left"></i>Printemps de l'éducation</a>
{% endif %}
{% if config.user.loginWithGoogle %}
{% if config.user.loginWithGoogle and oauth_google != 'disabled' %}
<a class="oauth-btn waves-effect waves-light gplus" href="{{ hwi_oauth_login_url('gplus') }}"><i class="icon gogo-icon-gplus left"></i>Google</a>
{% endif %}
{% if config.user.loginWithFacebook %}
{% if config.user.loginWithFacebook and oauth_facebook != 'disabled' %}
<a class="oauth-btn waves-effect waves-light facebook" href="{{ hwi_oauth_login_url('facebook') }}"><i class="icon gogo-icon-facebook left"></i>Facebook</a>
<p class="facebook-alert">ATTENTION ! Si votre mail est privé sur Facebook, vous ne serez pas informé du l'évolution de vos contributions</p>
<p class="facebook-alert">ATTENTION ! Si votre mail est privé sur Facebook, vous ne serez pas informé du l'évolution de vos contributions</p>
{% endif %}
{#<a class="oauth-btn waves-effect waves-light yahoo" href="{{ hwi_oauth_login_url('yahoo') }}"><i class="icon gogo-icon-yahoo left"></i>Se connecter avec Yahoo</a>#}
</div>
......@@ -62,9 +62,9 @@
<div class="register">Besoin d'un compte ? <a href="{{ path('fos_user_registration_register') }}">S'inscrire</a></div>
{% endif %}
</div>
</div>
<script>
// scripts are in header.html.twig
// scripts are in header.html.twig
</script>
\ No newline at end of file
......@@ -49,21 +49,21 @@
{% if logo %}<img src="{{ logo.imageUrl }}"/>{% endif %}
{{ config.appName }}
</a>
{% if config.user.loginWithMonPrintemps %}
{% if config.user.loginWithMonPrintemps and oauth_communs != 'disabled' %}
<a class="oauth-btn waves-effect waves-light printemps" href="{{ hwi_oauth_login_url('communs') }}"><i class="icon gogo-icon-printemps left"></i>Printemps de l'éducation</a>
{% endif %}
{% if config.user.loginWithLesCommuns %}
<a class="oauth-btn waves-effect waves-light communs" href="{{ hwi_oauth_login_url('communs') }}"><i class="icon gogo-icon-communs left"></i>LesCommuns.org</a>
{% if config.user.loginWithLesCommuns and oauth_communs != 'disabled' %}
<a class="oauth-btn waves-effect waves-light communs" href="{{ hwi_oauth_login_url('communs') }}"><i class="icon gogo-icon-communs left"></i>LesCommuns.org</a>
{% endif %}
{% if config.user.loginWithMonPrintemps %}
{% if config.user.loginWithMonPrintemps and oauth_communs != 'disabled' %}
</div>
<div class="oauth-section">
{% endif %}
{% if config.user.loginWithGoogle %}
<a class="oauth-btn waves-effect waves-light gplus" href="{{ hwi_oauth_login_url('gplus') }}"><i class="icon gogo-icon-gplus left"></i>Google</a>
{% if config.user.loginWithGoogle and oauth_google != 'disabled' %}
<a class="oauth-btn waves-effect waves-light gplus" href="{{ hwi_oauth_login_url('gplus') }}"><i class="icon gogo-icon-gplus left"></i>Google</a>
{% endif %}
{% if config.user.loginWithFacebook %}
<a class="oauth-btn waves-effect waves-light facebook" href="{{ hwi_oauth_login_url('facebook') }}"><i class="icon gogo-icon-facebook left"></i>Facebook</a>
{% if config.user.loginWithFacebook and oauth_facebook != 'disabled' %}
<a class="oauth-btn waves-effect waves-light facebook" href="{{ hwi_oauth_login_url('facebook') }}"><i class="icon gogo-icon-facebook left"></i>Facebook</a>
{% endif %}
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment