Installing Yii Users and Rights to Newly Created Yii app

Comparing #10 with #17

Revision #17 was created by Rajith R Rajith R on Feb 4, 2014, 5:39:29 AM.

mistake

Content

[...]
Create tables for user module
-----------------------------

then goto /protected/modules/user/data/schema.mysql.sql
** 
 
Need to update schema.mysql.sql to create field `lastvisit_at` instead of `lastvisit`

open the sql file ,and create the tables manually(that i prefer) , remove the 'tbl_' prefix from the tables(i prefer)
[...]
```php
$this->widget('zii.widgets.CMenu',array(
            'items'=>array(                 array('label'=>Yii::t('app','Home'), 'url'=>array('/site/index')), array('label'=>Yii::t('app','About'), 'url'=>array('/site/page', 'view'=>'about')), array('label'=>Yii::t('app','Contact'), 'url'=>array('/site/contact')),                 array('label'=>Yii::t('app','Login'), 'url'=>array('/user/login'),
 
         
'visible'=>Yii::app()->user->isGuest),
 
       array('label'=>Yii::t('app','Rights'), 'url'=>array('/rights')),  'visible'=>Yii::app()->user->isGuest),
 
array('label'=>
               array('label'=>Yii::t('app','Logout').' ('.Yii::app()->user->name.')', 'url'=>array('/user/logout'), 'visible'=>!Yii::app()->user->isGuest) ),
 
));
 
```
 
 
 
 
 
 
 
            ,
 
        )));
 
```
 
 
 
 
 
Add rights 
 
----------
 
 
Then add rights filter to all controller
 
 
like
 
 
 
 
 
```php 
public function filters()
 
{
 
return array(
 
'rights', // perform access control for CRUD operations
 

 
);
 
}
 
```
 
 
and change the extended controller to 'extends RController'.
 
 
then take rights in your url(according to url style) . 
 
 
 
continue
 
------------------
 
 
[http://www.yiiframework.com/wiki/448/assigning-dynamic-roles-to-a-user-using-yii-rights-module-at-the-time-of-user-creation-and-using-some-special-features-of-yii-rights/](http://www.yiiframework.com/wiki/448/assigning-dynamic-roles-to-a-user-using-yii-rights-module-at-the-time-of-user-creation-and-using-some-special-features-of-yii-rights/ "continue")