It's a sample project for Lily module. Demo is here.
Lily requires several extensions to be installed:
- EOAuth (required by EAuth)
- Loid extension (required by EAuth)
- Yii mail (in order to send notification and activation mails for email authentication type)
- EAuth
- Lily
- Download lily sample project (git clone https://github.com/georgeee/yii-lily-sample.git)
- Create assets and protected/runtime directories
mkdir assets protected/runtime
- Download extensions listed above and put them into
protected/extensions
. - Put
framework
directory (or symbolic link to it) intoprotected
- Deploy your database (here code is shown for mysql), put corresponding code into db section of config:
<?php
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=lily-sample',
'emulatePrepare' => true,
'username' => 'root',
'password' => '****',
'charset' => 'utf8',
),
-
Deploy the DB tables:
./yiic migrate --migrationPath=ext.lily.migrations --migrationTable=lily_migration up
./yiic migrate up
- Create authManager tables into your DB. You can do it by importing protected/data/authManager.sql
-
Initialize RBAC structure:
- Run
./yiic lily_rbac
, it will install Lily's RBAC structure - Run
./yiic lily_rbac assign --user={uid} --role={role, default userAdmin}
to assign role to a user - Run
./yiic rbac_installer
, it will install app's RBAC structure - Run
./yiic rbac_installer assign --user={uid} --role={role, default articleAdmin}
to assign role to a user
- Run
-
Edit config/main.php, fill in your service data, configure yii-mail extension
Just try it out:) You can register several accounts, then merge users, the you can view merge history or find yourself in user list, and so on.