Code Monkey home page Code Monkey logo

sonatauserbundle's Introduction

SonataUserBundle

Symfony SonataUserBundle

Latest Stable Version Latest Unstable Version Psalm Type Coverage License

Total Downloads Monthly Downloads Daily Downloads

Branch Github Actions Code Coverage Documentation
5.x Test Coverage Status Documentation Status
6.x Test Coverage Status Documentation Status

Documentation

Check out the documentation on the official website.

Support

For general support and questions, please use StackOverflow.

If you think you found a bug or you have a feature idea to propose, feel free to open an issue after looking at the contributing guide.

License

This package is available under the MIT license.

sonatauserbundle's People

Contributors

bladrak avatar core23 avatar emmanuelvella avatar franmomu avatar gajdaw avatar greg0ire avatar gremo avatar hanmac avatar jcrombez avatar jordisala1991 avatar kunicmarko20 avatar mmf-amarcos avatar morgen2009 avatar mrcmorales avatar oskarstark avatar pborreli avatar petk avatar phansys avatar pulse00 avatar pulzarraider avatar rande avatar sagikazarmark avatar sonataci avatar soullivaneuh avatar sylvaindeloux avatar taluu avatar vincentlanglet avatar vyshkant avatar wbloszyk avatar whisller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonatauserbundle's Issues

Missing userManager property (when updating user)

As reported here, when trying to update an existing user in the user admin backend, a notice is thrown:

Notice: Undefined property: Brickstorm\ParliamentBundle\Admin 
\CitizenAdmin::$userManager in /homez.307/amndrc/www/__ac/vendor/ 
bundles/Sonata/UserBundle/Admin/Entity/UserAdmin.php line 83

This is because a) the userManager property is not defined in the class or its parent class, and b) it's not being set anywhere.

The following piece of code bypasses the problem, but might not be the best way to correctly solve this ;)

class UserAdmin extends Admin 
{ 
    protected $userManager; 
[...] 
    public function getUserManager() 
    { 
        if (!$this->userManager) { 
            $this->userManager = $this->configurationPool- 
>getContainer()->get('fos_user.user_manager'); 

        } 
        return $this->userManager; 
    } 
} 

to convert user entity to string

trying to see admin dashboard, i get the following:

An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class Symfony\Component\Security\Core\User\User could not be converted to string in /home/pajooh/web/app/cache/dev/twig/67/b2/dee9cd5a99bf1b282fb737c319bd.php line 24") in SonataUserBundle:Admin/Core:user_block.html.twig at line 1.

the problem is that in the user_block.html.twig, the {{ app.user}} can not be converted to string.

Usage of Doctrine built-in json_array type

Doctrine 2.3 has a json_array type, which does exactly the same thing than your custom json type.
You should use it instead ot make it easier for people to use the bundle as they would not need to register a custom type anymore.
You could then rename your custom type in the extensions to keep it as polyfill for people using doctrine 2.2

Unknown column type json requested.

i have this error when i tray to run php app/console doctrine:schema:update. If I change manually in /vendor/bundles/Sonata/UserBundle/Resources/config/doctrine/BaseUser.orm.xml all json strings for array works...

Translation issue on add/edit user

The locale resource bundle could not be loaded for locale "en"

I'm sure i'm doing something wrong, but this is what I get.

I have verified vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/49/names/en.res exists.

Any ideas?

Could not convert database value "" to Doctrine Type array on user listing in admin

After following manual and installing SonataUserBundle I have following exception at user-list page

An exception has been thrown during the rendering of a template ("Could not convert database value "" to Doctrine Type array") in SonataAdminBundle:CRUD:base_list.html.twig at line 28.

No modifications were applied, SonataUserBundle uses FOSUserBundle, 1 user was added via console tool with superadmin role. Default configuration etc. all seems like in manual.

After updating to latest version: Error with class Application\Sonata\UserBundle\Entity\Group : Property groups does not exist

After upgrading to the latest version of SUB I get:
xec] RuntimeException: Error with class Application\Sonata\UserBundle\Entity\Group : Property groups does not exist
[exec]
[exec] /var/lib/jenkins/jobs/Undervisningsflate/workspace/vendor/bundles/Sonata/EasyExtendsBundle/Mapper/DoctrineORMMapper.php:83
[exec] /var/lib/jenkins/jobs/Undervisningsflate/workspace/vendor/doctrine-common/lib/Doctrine/Common/EventManager.php:64
[exec] /var/lib/jenkins/jobs/Undervisningsflate/workspace/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:317
[exec] /var/lib/jenkins/jobs/Undervisningsflate/workspace/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:170
[exec] /var/lib/jenkins/jobs/Undervisningsflate/workspace/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:124

Setting deps.lock to 28fee65 solves the problem that I think is related to commit: cbd5801

Cannot edit users when there are any user groups!?

Hello,

I have a weird problem, when I create user groups and try to open up the users' edit page it crashes.
When trying to list the groups that I could add the user it looks for a PHP class with the name of the group I have defined!?

Here is my original post: https://groups.google.com/forum/?fromgroups#!topic/sonata-users/kCGVQ1Ad7Bw

I believe it has something to do with sonata_type_model, couse I've added 2 entities with One-To-Many relation, then tried to open the edit page and it was fine, but the little green button from which I could create groups and then add them to the list was gone. So, I've changed the type of the group field to sonata_type_model and the same issue appeared.

Maybe I'm missing something in the configuration..?

ErrorException: Notice: Undefined index: translation

After updating to the latest dev-master (fcec11), I'm getting this:

ErrorException: Notice: Undefined index: translation in /<...>/vendor/sonata-project/user-bundle/Sonata/UserBundle/DependencyInjection/SonataUserExtension.php line 162

Both on cli and browser

utility of the 'TwoStepVerificationCode' field

 [PDOException]                                                                               
  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'two_step_code' cannot be null 

Actually this is what i get because this field is mapped by the BaseUser from SonataUserBundle, i don't know the utility of this field ?

Should I add in my fixtures :

$user->setTwoStepVerificationCode(sha1(time())); or some random token ?

Thanks.

Is FOSUserBundle a dependency?

The docs are a bit confusing on this. They say that SonataUserBundle "Integrates the FOS/UserBundle in the Sonata Admin Project"

// You have 2 options to initialize the SonataUserBundle in your AppKernel,
// you can select which bundle SonataUserBundle extends
// extend the FOSUserBundle

If I want to get user table / authentication for free i.e. not wreite my own, do I need to install FOSUserBundle too?

Update schema always results in same query

When I run php app\console doctrine:schema:update --force this wil always result in the same query and other updates are ommited.

ALTER TABLE fos_user_user CHANGE facebook_data facebook_data LONGTEXT DEFAULT NU
LL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL, CHANGE gplus_data gp
lus_data LONGTEXT DEFAULT NULL;
ALTER TABLE notification__message CHANGE body body LONGTEXT NOT NULL

Also, according to the output, the queries are executed successfully.

edit errors

Default configuration from readme files

/profile/edit-authentication

The parameter "fos_user.template.theme" must be defined.

/profile/edit-profile

Could not load type "sonata_user_profile_form"

Problem with translation

hi all
i have put in config.yml
framework:
translator: { fallback: %locale% }

in parameter.ini the locale is it(italian)

but when i go to profile edit from sonata user......the all labels are in english while the page of register from fosuserbundle are in italian.......why? how can solve?
thx all

Docs contain wrong service name

Probably this is not related to bundle but to support site. At
http://sonata-project.org/bundles/user/2-0/doc/reference/profile_edition.html

    profile:  # Profile Form (firstname, lastname, etc ...)
        form:
            type:               sonata.user.profile
            handler:            sonata.user.profile.form.handler.default
            name:               sonata_user_profile_form
            validation_groups:  [Profile]

there is an error in type: sonata.user.profile, t should be

    profile:  # Profile Form (firstname, lastname, etc ...)
        form:
            type:               sonata_user_profile
            handler:            sonata.user.profile.form.handler.default
            name:               sonata_user_profile_form
            validation_groups:  [Profile]

MongoDB support

Hi,

Would you be interested with a MongoDB support ? I can work on it if you want.

UserBundle : cache:clear create exception !

When a cache:clear is processed after the composer.phar update of now with "dev-master" anywhere, the following ErrorException appears :

"Notice: Undefined index: translation in /home/path/to/project/vendor/sonata-project/user-bundle/Sonata/UserBundle/DependencyInjection/SonataUserExtension.php line 162 "

Profile validation_groups concern

Recently, someone implemented this:

protected $formOptions = array(
    'validation_groups' => 'Profile'
);

That's perfect for editing a user, because the plainpassword field will not be required in order to update the existing user. However, when creating a new user, it is possible to submit the form without a password which would cause a fatal error.

How can I use the "Profile" validation group for editing a user, and the "Registration" group when creating a new user?

Error while integrating SonataUserBundle + Admin + News

Hi,
Sorry for newbie question here,

I got this error while trying to integrate SonataUserBundle + Admin + News.

MappingException: Class Application\Sonata\UserBundle\Entity\User is not a valid entity or mapped super class

What should I do to fix this problem ?

Regards.

Changing from one group to another adds roles to the user

Let's say we have 2 groups: groupA and groupB. We also have 2 roles, roleA and roleB.
roleA is assigned to groupA, and roleB is assigned to groupB.

When I now change the group of the user from groupA to groupB, the user suddenly has got roleA AND roleB.
The roles of the user should not change when the user is assigned a group.

Basically it should be possible to manage roles solely with groups, not having roles assigned to the user directly.

unable to link Sonata User class with Already existed class

I find that documentation is lacking where we already have User class with custom field.
The docs dont tell anything how to link the already created User class with Sonata Usr bundle.

That may seem easy for experienced ones but diffuclt for new bies like me

What should need to be done for that case

Unknown column type json requested.

After updating the vendors and trying to run doctrine schema update, I got the error:
[Doctrine\DBAL\DBALException]
Unknown column type json requested.

It seems to me the issue resides with the file Resources/config/doctrine/BaseUser.orm,xml, line 25, 28 and 31 (and the same with mongodb), which set the type to json.

Versions compatibility

A 2.0 branch of this bundle have to be created, requiring corresponding (2.0.*?) version of sonata-project/admin-bundle in composer.json.

Change default controller

Is there a way to change the default user/group controller ?

As the admin services are defined with empty third argument, I don't see how to achieve this.

Confusion: Why would you not extend FOSUserBundle?

Hi,

The documentation offers 2 ways to initialize the bundle:

// You have 2 options to initialize the SonataUserBundle in your AppKernel,
// you can select which bundle SonataUserBundle extends
// extend the FOSUserBundle
new Sonata\UserBundle\SonataUserBundle('FOSUserBundle');
// OR
// the bundle will NOT extend FOSUserBundle
new Sonata\UserBundle\SonataUserBundle();

Why wouldn't you extend FOSUserBundle? The documentation does not make it clear.

Thanks,

Fish

Declaration of Sonata\UserBundle\Form\Type\SecurityRolesType::getDefaultOptions() must be compatible

After last commit 0d5f655 I get this error in Symfony 2.0.12, SonataAdmin Bundle Branch 2.0 while trying to add new user/group or edit one.

Fatal error: Declaration of Sonata\UserBundle\Form\Type\SecurityRolesType::getDefaultOptions()
must be compatible with that of Symfony\Component\Form\FormTypeInterface::getDefaultOptions()
in C:\wamp\www\fs\vendor\bundles\Sonata\UserBundle\Form\Type\SecurityRolesType.php on line 120

admin_orm.xml not being parsed

Hi,

I've used the SonataEasyExtends module to extend the bundle, and now I can easily modify the templates and user/group classes.

I'd like to change the configuration of the bundle so I copied /vendor/bundles/Sonata/UserBundle/Resources/config/admin_orm/xml to /app/Application/Sonata/UserBundle/Resources/config/admin_orm.xml, but the file is not being parsed.

Is there a way for me to get this file parsed?

Thanks,

Fish

filter by roles?

i have add this in UserAdmin for filter by roles, but not work

protected function configureDatagridFilters(DatagridMapper $filterMapper)
{
$filterMapper
->add('roles')
;
}

any help?

Fatal Error: Class (...)\BaseUser contains 1 abstract method...?

How do I fix this?

After completeing the instalation of SonataUserBundle I am getting

Fatal error: Class Sonata\UserBundle\Entity\BaseUser contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\Security\Core\User\UserInterface::equals) in D:\git\radiowww\vendor\bundles\Sonata\UserBundle\Entity\BaseUser.php on line 20

EDIT: This is probably happening becouse stof removed equals method from FOSUB

FriendsOfSymfony/FOSUserBundle@b2345aa

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'algorithm' cannot be null

Hi,

I am trying to use Sonata UserBundle to manage user from Sonata AdminBundle. Every time I am trying to add a new user I am getting this error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'algorithm' cannot be null

I know that I am doing something wrong somewhere. This is what I have in my config.yml file :

fos_user:
...
    encoder:
        algorithm:          sha512
        encode_as_base64:   false
        iterations:         1
...

Thanks !

Switch User failed: "Username "marc" does not exist."

Hello,

I have registered a User named marc, the list of users works well, but when I click in Icon to change to this User, then enter to this URL http://localhost:8888/app_dev.php/?_switch_user=marc

And then I obtained this error:

Switch User failed: "Username "marc" does not exist."

I have puted this route in routing.yml but problem persist.

homepage:
pattern: /
defaults: { _controller: SonataPgaeBundle:Page:catchAll }

What Can I do?

Thanks

Regards

Add easyextends bundle as dependency

SonataUserExtension has reference to an easyextends class so it must be included as dependency. I'm getting error during container cache building.

Fatal error: Class 'Sonata\EasyExtendsBundle\Mapper\DoctrineCollector' not found in /home/ken/dev/basketstats.dev/vendor/sonata-project/user-bundle/Sonata/UserBundle/DependencyInjection/SonataUserExtension.php on line 139

The options "choice_list", "choices" have a cyclic dependency

With sf2.1 and the master branch, when I go to edit or create a user I get this error:

The options "choice_list", "choices" have a cyclic dependency.
500 Internal Server Error - OptionDefinitionException

The problem appears to lie in UserBundle\Form\Type\SecurityRolesType.php about line 120

$resolver->setDefaults(array(
'choices' => function (Options $options) use ($roles) {
return empty($options['choices']) ? $roles : array();
},

I can fix this by putting

'choices' => $roles

But guess this isnt really right?

MongoDB compatibility

In Resources / config / doctrine / BaseUser.mongodb.xml there are references to type json for some fields, but json type is not standard in MongoDb and a custom type is not provided (where instead is provided as doctrine extension for ORM). Am I missing something?

Logout from ACP

I am logged in normally. Then I want to login to ACP - I am obliged to login once again. I think it's normal because of second, different firewall. But.. When I click logout in ACP, I am logged out from ACP and also from the site (main firewall). Is it a normal behavior? I have 2 different routes: /admin/logout and /logout. Shouldn't Symfony deal with it?

Route "admin_sonata_user_user_create" does not exist

After installation, I receive the following error when trying to access admin/dashboard:

An exception has been thrown during the rendering of a template ("Route "admin_sonata_user_user_create" does not exist.") in SonataAdminBundle:Core:dashboard.html.twig at line 32.

Embedded user form

How can I change a user form for the embedded forms?
For example, when adding a user (SonataUserBundle: User) I can select the role from the list of roles.
And I have some bundles of profiles with embedded forms of user (customers, employees, etc.). For them, the role I set in code.
How can I hide the choice from the list of roles in the embedded form?

ServiceNotFoundException

I've been trying to install the SonataUserBundle as per the documentation.

But when trying to generate the ApplicationSonataUserBundle as per the instruction here - [ http://sonata-project.org/bundles/user/master/doc/reference/installation.html#generate-the-applicationsonatauserbundle ] i am getting this exception:

ServiceNotFoundException: The service "sonata.user.form.type.security_roles" has a dependency on a non-existent service "sonata.admin.pool".

Am i missing something here..?
Could any one please guide me here...

Thank You.

Can't create user from the user Admin form

Hello,

I had this error : Column 'username_canonical' cannot be null while creating a new user.
I just changed the function preUpdate() to prePersist() in the file UserAdmin.php.
Now it works fine.

Migration diff always results in same query

When I run php app\console doctrine:migration:diff this will always result in the same query and other updates are ommited.

ALTER TABLE fos_user_user CHANGE facebook_data facebook_data LONGTEXT DEFAULT NU
LL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL, CHANGE gplus_data gp
lus_data LONGTEXT DEFAULT NULL;
ALTER TABLE notification__message CHANGE body body LONGTEXT NOT NULL

Also, according to the output, the queries are executed successfully.

Fatal error: Class 'Application\Sonata\UserBundle\SonataUserBundle' not found in .../app/AppKernel.php

I have been trying to install and integrate the SonataUserBundle, FOSUserBundle, and SonataAdminBundle. After getting FOSUserBundle installed ok, and SonataAdminBundle installed ok, I tried to install SonataUSerBundle. Initially this resulted in the dashboard showing the FOS User and Groups, but following the links to Add or List for User or Group threw the folowing exception:

Class Application\Sonata\UserBundle\Entity\User does not exist and could not be loaded.

I then installed the SonataEasyExtendsBundle, and successfully ran the command:

php app/console sonata:easy-extends:generate SonataUserBundle

I then changed the reference in AppKernel.php from:

new Sonata\UserBundle\SonataUserBundle(),

to

new Application\Sonata\UserBundle\SonataUserBundle(),

But now, I get a fatal error when for every request:

Fatal error: Class 'Application\Sonata\UserBundle\SonataUserBundle' not found in /home/scott/eclipse_indigo_workspace/reviews.co.uk/app/AppKernel.php

I'm guessing I need to modify my autoload.php but all attempts I have made at that have failed.

Exception when clicking "list users" on dashboard

Clicking on Sonata list user action in the dashboard i get the following exception:

An exception has been thrown during the rendering of a template
("Route "sonata_user_impersonating" does not exist.") in SonataUserBundle:Admin:Field/impersonating.html.twig at line 15.

if i comment this instructions in vendor/bundles/Sonata/UserBundle/Admin/Entity/UserAdmin.php:

    if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
        $listMapper
            ->add('impersonating', 'string', array('template' => 'SonataUserBundle:Admin:Field/impersonating.html.twig'))
        ;
    }

Everything works as expected; by the way, my admin user does not belong to ROLE_ALLOWED_TO_SWITCH

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.