Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @author Bouteillier Nicolas <contact@kaizendo.fr>
* Date: 09/11/16
*/
namespace Acme\Bundle\Form;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
<?php
use Symfony\Component\Form\FormEvent;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
class ClassType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
<?php
/**
* view_entry.php
* Interface de visualisation d'une réservation
* Ce script fait partie de l'application GRR
* Dernière modification : $Date: 2010-04-07 15:38:14 $
* @author Laurent Delineau <laurent.delineau@ac-poitiers.fr>
* @copyright Copyright 2003-2008 Laurent Delineau
* @link http://www.gnu.org/licenses/licenses.html
* @package root
@nicolas-san
nicolas-san / GetAltFromImgName.php
Last active August 29, 2015 14:25
Get image Alt attribute from image filename
<?php
/**
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Bouteillier Nicolas <nicolas@kaizendo.fr>

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
<?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
<!-- Properties -->
<property name="dir.app" value="${project.basedir}/app" />
<property name="dir.src" value="${project.basedir}/src" />
<property name="dir.build" value="${project.basedir}/app/build" />
<property name="dir.docs" value="${dir.build}/docs" />
<property name="dir.docs.phpdoc" value="${dir.docs}/phpdoc" />
<property name="dir.docs.docblox" value="${dir.docs}/docblox" />
<property name="dir.reports" value="${dir.build}/logs" />