Unverified Commit d5b2ebdf authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Fix sonata user override

parent 71707bfc
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b6ad312dcd87f7d6c7fdc4e50a3551e2",
"content-hash": "c83db3ec8f98cbe9e54ec352b18dd87a",
"packages": [
{
"name": "alcaeus/mongo-php-adapter",
......
......@@ -34,4 +34,6 @@ return [
Http\HttplugBundle\HttplugBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
App\Application\Sonata\UserBundle\ApplicationSonataUserBundle::class => ['all' => true],
App\Application\Sonata\Exporter\ApplicationSonataExporterBundle::class => ['all' => true],
];
......@@ -13,7 +13,7 @@ fos_user:
sender_name: "%env(instance_name)%"
group:
group_class: Application\Sonata\UserBundle\Document\Group
group_class: App\Application\Sonata\UserBundle\Document\Group
group_manager: sonata.user.mongodb.group_manager # If you're using doctrine orm (use sonata.user.mongodb.group_manager for mongodb)
service:
......
......@@ -4,7 +4,7 @@ sonata_user:
manager_type: mongodb # can be orm or mongodb
class: # Entity Classes
user: App\Document\User
group: Application\Sonata\UserBundle\Document\Group
group: App\Application\Sonata\UserBundle\Document\Group
admin: # Admin Classes
user:
......
......@@ -42,12 +42,34 @@ services:
# - { resource: "../src/Saas/Resources/config/services_admin.yml" }
# - { resource: "../src/Sonata/UserBundle/Resources/config/services.yml" }
gogo.authentication_handler:
class: Application\Sonata\UserBundle\Security\AuthenticationHandler
class: App\Application\Sonata\UserBundle\Security\AuthenticationHandler
public: true
arguments: [ '@router', '@session', "@security.token_storage"]
gogo_user.gamification:
class: App\Application\Sonata\UserBundle\Services\GamificationService
public: true
arguments: [ "@doctrine.odm.mongodb.document_manager" ]
gogo_user.registration.form.type:
class: App\Application\Sonata\UserBundle\Form\Type\RegistrationFormType
public: true
arguments: [ "%fos_user.model.user.class%" ]
tags:
- { name: "form.type", alias: "gogo_user_registration"}
gogo.registration.form.handler:
class: App\Application\Sonata\UserBundle\Form\Handler\RegistrationFormHandler
public: true
arguments:
- "@request_stack"
- "@fos_user.user_manager"
- "@fos_user.mailer"
- "@fos_user.util.token_generator"
- "@bazinga_geocoder.geocoder"
my_user_provider:
class: Application\Sonata\UserBundle\Security\FOSUBUserProvider
class: App\Application\Sonata\UserBundle\Security\FOSUBUserProvider
public: true
arguments: ["@fos_user.user_manager",{facebook: facebookUid, gplus: gplusUid, communs: communsUid}]
......@@ -78,7 +100,7 @@ services:
custom.sonata.security.handler.role:
public: true
class: Application\Sonata\UserBundle\Security\CustomRoleSecurityHandler
class: App\Application\Sonata\UserBundle\Security\CustomRoleSecurityHandler
arguments:
- "@security.authorization_checker"
- [ROLE_SUPER_ADMIN]
......
......@@ -8,7 +8,7 @@
namespace App\Admin\Element;
// custom iterator
use Application\Sonata\Exporter\Source\DoctrineODMQuerySourceIterator;
use App\Application\Sonata\Exporter\Source\DoctrineODMQuerySourceIterator;
use Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQuery;
// There is a chain of inherance to split ElementAdmin in different files
......
<?php
namespace App\Application\Sonata\Exporter;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://symfony.com/doc/current/book/bundles.html
*/
class ApplicationSonataExporterBundle extends Bundle
{
}
......@@ -14,7 +14,7 @@
in the source iterator. I've been modified the getValue method so I can use a hash, using the label as a key. See ElementAdmin.php
to see ho it is used
*/
namespace Application\Sonata\Exporter\Source;
namespace App\Application\Sonata\Exporter\Source;
use Doctrine\ODM\MongoDB\Query\Query;
use Doctrine\ORM\Internal\Hydration\IterableResult;
......@@ -150,7 +150,7 @@ class DoctrineODMQuerySourceIterator implements SourceIteratorInterface
* @return null|string
*/
protected function getValue($value, $name)
{
{
if (is_array($value)) {
$value = array_key_exists($name, $value) ? $value[$name] : null;
} elseif ($value instanceof \Traversable) {
......
<?php
namespace App\Application\Sonata\UserBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://symfony.com/doc/current/book/bundles.html
*/
class ApplicationSonataUserBundle extends Bundle
{
}
......@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Application\Sonata\UserBundle\Controller;
namespace App\Application\Sonata\UserBundle\Controller;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
......@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Exception\AccountStatusException;
use Application\Sonata\UserBundle\Form\Type\RegistrationFormType;
use App\Application\Sonata\UserBundle\Form\Type\RegistrationFormType;
use App\Document\User;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
......
......@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Application\Sonata\UserBundle\Document;
namespace App\Application\Sonata\UserBundle\Document;
use Sonata\UserBundle\Document\BaseGroup as BaseGroup;
......
......@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Application\Sonata\UserBundle\Form\Handler;
namespace App\Application\Sonata\UserBundle\Form\Handler;
use FOS\UserBundle\Model\UserManagerInterface;
use FOS\UserBundle\Model\UserInterface;
......
......@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Application\Sonata\UserBundle\Form\Type;
namespace App\Application\Sonata\UserBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
......
......@@ -4,10 +4,10 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="Application\Sonata\UserBundle\Document\Group" collection="fos_user_group">
<document name="App\Application\Sonata\UserBundle\Document\Group" collection="fos_user_group">
<field fieldName="id" id="true" strategy="INCREMENT" />
</document>
</doctrine-mongo-mapping>
......@@ -6,7 +6,7 @@
@author <yourname> <youremail>
-->
<class name="Application\Sonata\UserBundle\Document\Group" exclusion-policy="all" xml-root-name="_group">
<class name="App\Application\Sonata\UserBundle\Document\Group" exclusion-policy="all" xml-root-name="_group">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search" />
......
<?php
namespace Application\Sonata\UserBundle\Security;
namespace App\Application\Sonata\UserBundle\Security;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
......
<?php
namespace Application\Sonata\UserBundle\Security;
namespace App\Application\Sonata\UserBundle\Security;
use Sonata\AdminBundle\Security\Handler\RoleSecurityHandler as RoleSecurityHandler;
use Sonata\AdminBundle\Admin\AdminInterface;
......
Supports Markdown
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