Set up the SonataUserBundle

1,732 views
Skip to first unread message

Md Mostafizur Rahman milon

unread,
Jan 9, 2012, 10:03:51 AM1/9/12
to sonata-users
Hello everyone

i have problem when i try to setup SonataUserBundle its shows error.

[Symfony\Component\DependencyInjection\Exception
\ServiceNotFoundException]

The service "sonata.user.admin.user" has a dependency on a non-
existent service "sonata.admin.manager.orm".


why give this error ? anyone can help me how i can solved this
problem?


thanks

Thomas Rabaix

unread,
Jan 9, 2012, 10:07:56 AM1/9/12
to sonata...@googlegroups.com
you need to install the SonataDoctrineORMAdminBundle

If you want a ready to go solution, please use the sandbox.


--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.




--
Thomas Rabaix
http://rabaix.net | http://sonata-project.org

Md Mostafizur Rahman milon

unread,
Jan 9, 2012, 2:07:43 PM1/9/12
to sonata-users
Thanks for your quick repaly. yes i solved this. but my new questions
is what is relation between FOSUserBundle and SonataUserBundle ?

i have already instal FOSUserBundle .but problem after installing
SonataUserBundle i can't login using FOSUserBundle users
information. its show error:- Unrecognized field: usernameCanonical.

Thomas Rabaix

unread,
Jan 9, 2012, 5:29:07 PM1/9/12
to sonata...@googlegroups.com
The SonataUserBundle just add some AdminBunde related informations. I don't know the issue about the usernameCanonical error. I guess you haven't installed all the bundles properly.

Md Mostafizur Rahman milon

unread,
Jan 10, 2012, 2:30:24 AM1/10/12
to sonata-users
Pls see my configuration setting and tell me what is
misconfiguration.


# app/config/config.yml

imports:
- { resource: parameters.ini }
- { resource: security.yml }

framework:
#esi: ~
translator: ~
secret: %secret%
charset: UTF-8
router: { resource: "%kernel.root_dir%/config/
routing.yml" }
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ['twig'] } #assets_version:
SomeVersionScheme
session:
default_locale: %locale%
auto_start: true

# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%

# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
# java: /usr/bin/java
filters:
cssrewrite: ~
# closure:
# jar: %kernel.root_dir%/java/compiler.jar
# yui_css:
# jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar

# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8

orm:
# auto_mapping: true
entity_managers:
default:
mappings:
ApplicationSonataUserBundle: ~
SonataUserBundle: ~


# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%

jms_security_extra:
secure_controllers: true
secure_all_services: false

fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and
'propel'
firewall_name: main
user_class: Application\Sonata\UserBundle\Entity\User


# app/config/security.yml

security:
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN, ROLE_ADMIN,
ROLE_ALLOWED_TO_SWITCH]
SONATA:
- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are not using
acl then this line must be uncommented

providers:
fos_userbundle:
id: fos_user.user_manager

firewalls:
# -> custom firewall for the admin area of the URL
admin:
pattern: /admin(.*)
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: null
use_referer: true
logout:
path: /admin/logout
target: /admin/login

anonymous: true
# -> end custom configuration

# defaut login area for standard users
main:
pattern: .*
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
logout: true
anonymous: true

access_control:
# URL of FOSUserBundle which need to be available to anonymous
users
- { path: ^/_wdt, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/_profiler, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }

# -> custom access control for the admin area of the URL
- { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/logout$, role:
IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login-check$, role:
IS_AUTHENTICATED_ANONYMOUSLY }
# -> end

- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }

# Secured part of the site
# This config requires being logged for the whole site and
having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/admin, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

ask

unread,
Jan 11, 2012, 7:08:30 AM1/11/12
to sonata...@googlegroups.com
Add FoS user bundle to mapping info since. Then you'll need to update
your schema etc.

--
Regards,

Reply all
Reply to author
Forward
0 new messages