Hello, everyone, do not speak English, I use a translator
.
I’m trying to work with this extension.
Examined the information in this topic and on the page of the expansion
It turned out all customized with the user in the config ‘admin’
Created for the user and he created the role with the operation test.* For the test controller with a view index.
there is a filter according to the instructions
pass by reference /test/index
Error 401
Access denied.
Yii user this has no effect, it was before it
and i try yii-auth 1.6 and 1.7
please! help!
this my config file main.php
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
// preloading 'log' component
'preload'=>array(
'log',
'bootstrap',
),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'application.extensions.*',
'application.modules.user.models.*',
'application.modules.user.components.*',
'application.modules.auth.*',
'application.modules.auth.components.*',
),
'modules' => array(
//phs//yii-user module
'user' => array(
# encrypting method (php hash function)
'hash' => 'md5',
# send activation email
'sendActivationMail' => true,
# allow access for non-activated users
'loginNotActiv' => false,
# activate user on registration (only sendActivationMail = false)
'activeAfterRegister' => false,
# automatically login from registration
'autoLogin' => true,
# registration path
'registrationUrl' => array('/user/registration'),
# recovery password path
'recoveryUrl' => array('/user/recovery'),
# login form path
'loginUrl' => array('/user/login'),
# page after login
'returnUrl' => array('/user/profile'),
# page after logout
'returnLogoutUrl' => array('/user/login'),
'tableUsers' => 'users',
'tableProfiles' => 'profiles',
'tableProfileFields' => 'profiles_fields',
),
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
'auth' => array(
'strictMode' => true, // when enabled authorization items cannot be assigned children of the same type.
'userClass' => 'User', // the name of the user model class.
'userIdColumn' => 'id', // the name of the user id column.
'userNameColumn' => 'username', // the name of the user name column.
'appLayout' => 'application.views.layouts.main', // the layout used by the module.
'viewDir' => null, // the path to view files to use with this module.
),
),
// application components
'components'=>array(
//'user'=>array(
// enable cookie-based authentication
//'allowAutoLogin'=>true,
//),
// uncomment the following to enable URLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=tag',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
'authManager' => array(
//'class' => 'auth.components.CDbAuthManager',
'class' => 'auth.components.CachedDbAuthManager',
'cachingDuration' => 3600,
'behaviors' => array(
'auth' => array(
'class' => 'auth.components.AuthBehavior',
/**
* The 'admin', 'demo' are the usernames of superuser.
* These usernames must be the same as your login username.
* For example, if your login username does not need email, then these username does not need email.
*/
'admins' => array('admin'), // users with full access
),
),
),
'user' => array(
'class' => 'WebUser',
//'class' => 'auth.components.AuthWebUser',
//'admins' => array('demo'), // users with full access
'loginUrl' => array('/user/login'),
),
'bootstrap' => array(
'class' => 'application.yiibooster.components.Bootstrap',
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);