How to create admin user after first install bundle ?

Questions around the Aimeos bundle for the Symfony framework
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
ksicinski
Posts: 9
Joined: 05 Jul 2017, 07:18

How to create admin user after first install bundle ?

Post by ksicinski » 06 Jul 2017, 09:57

How to create admin user after first install bundle ?
or
How to create user and give him privilege to be admin?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to create admin user after first install bundle ?

Post by aimeos » 06 Jul 2017, 15:52

That highly depends on your used authentication configuration. Please have a look into the Symfony documentation for a deeper insight into authentication.

An example for setting up the FOS user bundle is described here:
https://aimeos.org/docs/Symfony/Configu ... ndle_login

There you can set up an admin account executing this command:

Code: Select all

bin/console aimeos:account --admin <your email>
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

ksicinski
Posts: 9
Joined: 05 Jul 2017, 07:18

Re: How to create admin user after first install bundle ?

Post by ksicinski » 10 Jul 2017, 20:44

I add this configuration and stop at lat command line ;/
./bin/console fos:user:promote <email address> ROLE_ADMIN
I got this error:
[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'salt' on entity 'Aimeos\ShopBundle\Entity\FosUser' in a field or discriminator column mapping.
any tips?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to create admin user after first install bundle ?

Post by aimeos » 11 Jul 2017, 12:39

ksicinski wrote:
./bin/console fos:user:promote <email address> ROLE_ADMIN
I got this error:
[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'salt' on entity 'Aimeos\ShopBundle\Entity\FosUser' in a field or discriminator column mapping.
We've release the new 2017.07 version today. Can you please update to that version and set up authentication like described in the documentation?
https://github.com/aimeos/aimeos-symfony#installation

Then, things should work as expected when using fos:user:promote
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

ksicinski
Posts: 9
Joined: 05 Jul 2017, 07:18

Re: How to create admin user after first install bundle ?

Post by ksicinski » 11 Jul 2017, 19:07

Your update help.

I have only one remark this is bad lousy solution:

Code: Select all

composer update --no-dev
I can forgot add this --no-dev parameters and add some new bundle and make update at production server this maibe crashed prod shop ;/

I thin better option will be create symfony console command to run all method hidden in this --no-dev parameters and add to manual information to run this command if user want install dev items.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to create admin user after first install bundle ?

Post by aimeos » 12 Jul 2017, 09:57

To be more precise, it should be

Code: Select all

SYMFONY_ENV=prod composer update --no-dev
like stated in the installation documentation at GitHub
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply