Question

I need an authentication module for my ZF2 project.

ZFCUser seems to be good and I installed it sucessfully. But now I'm a bit lost due to the lack of any further documentation (or I just don't know where to look for it).

1) I want to include ZFCUser-DoctrineORM but the readme says basically the name of the module and that's it. What do I have to do to get this working?

After trying for some time I found the login page under the URL /user/ and a code snippet which shows how to include the form on another page.

2) But how do I eg make login required for all my other pages or modules?

Was it helpful?

Solution

Question 1

Alright, figured it out now... it's actually pretty easy!

composer.json

"zf-commons/zfc-user-doctrine-orm": "dev-master"

Run

php composer.phar update

Add app under application.config

'ZfcUserDoctrineORM'

Run Doctrine CLI

doctrine-module orm:schema-tool:update --force

Question 2

Here are the options for checking the login state.

OTHER TIPS

Here is wiki for ZfcUser : https://github.com/ZF-Commons/ZfcUser/wiki

also you can look here if u already have not https://github.com/ZF-Commons/ZfcUser

Edit your composer.json's require section add

"require": {
    "zf-commons/zfc-base": "dev-master",
    "zf-commons/zfc-user": "dev-master",
    "doctrine/doctrine-orm-module": "dev-master"
}

Now tell composer to download by running the command:

$ php composer.phar update
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top