2

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?

Ron
  • 22,128
  • 31
  • 108
  • 206

2 Answers2

5

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.

Ron
  • 22,128
  • 31
  • 108
  • 206
1

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
Maulik Shah
  • 421
  • 2
  • 10
  • 1
    to my first question, the wiki says nothing and your second link says: `Coming soon...` would be great if you could post a quick guide how to install it... and to my second question: interpreting the wiki, I guess you just have to add this auth check in every action? – Ron Jan 03 '13 at 08:35
  • i think `ZFCUser-DoctrineORM` is now installed (you left the important line out) with `"zf-commons/zfc-user-doctrine-orm": "dev-master"`. but how do i set it up? – Ron Jan 03 '13 at 09:31