composer require dektrium/yii2-user
yii migrate/up --migrationPath=@vendor/dektrium/yii2-user/migrations
en common/config/main.php
'modules' => [
'user' => [
'class' => 'dektrium\user\Module',
'enableUnconfirmedLogin' => true,
'confirmWithin' => 21600,
'cost' => 12,
'admins' => ['admin']
],
],
en common/config/main-local.php
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@app/mailer',
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'hosttttttt',
'username' => 'XXXXXX@webazan.com.ar',
'password' => 'XXXXXX',
'port' => '465',
'encryption' => 'ssl',
],
],
en backend/config/main.php
quitar de components, el bloque de user, o comentarlo
/* 'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
],*/
ahora si entramos a backend/web
nos redirige a la pagina de logueo.
Para crear usuarios:
http://localhost/ecosocial2/backend/web/index.php?r=user%2Fregistration%2Fregister
No hay comentarios:
Publicar un comentario