Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 23 2019 21:39
    WhatTheBuild starred 2amigos/yii2-usuario
  • Jan 21 2019 15:22
    qav-gabriela-castro starred 2amigos/yii2-usuario
  • Jan 17 2019 14:14
    ljfreelancer88 starred 2amigos/yii2-usuario
  • Jan 17 2019 07:40
    tsdogs opened #302
  • Jan 15 2019 15:59

    tonydspaniard on master

    Add nl_NL Dutch translation. Mi… Improve translations Merge pull request #301 from sq… (compare)

  • Jan 15 2019 15:59
    tonydspaniard closed #301
  • Jan 15 2019 15:57
    tonydspaniard commented #301
  • Jan 15 2019 15:05
    squio synchronize #301
  • Jan 15 2019 10:17
    squio opened #301
  • Jan 04 2019 13:40
    maxxer commented #298
  • Jan 04 2019 13:20
    theonedemon starred 2amigos/yii2-usuario
  • Jan 04 2019 12:50
    schmunk42 opened #298
  • Dec 31 2018 10:31
    maxxer closed #293
  • Dec 31 2018 10:31
    maxxer commented #293
  • Dec 31 2018 10:30

    maxxer on master

    Fix password expire service #293 (compare)

  • Dec 19 2018 15:34
    steelice starred 2amigos/yii2-usuario
  • Dec 19 2018 10:22
    tonydspaniard commented #289
  • Dec 19 2018 07:47
    bscheshirwork commented #289
  • Dec 18 2018 21:01
  • Dec 12 2018 16:35
    maxxer commented #289
pasquale
@paskuale75
@jgoetz thanks, then it works ? I'll try it right awayI'll try it right away
John Goetz
@jgoetz
I apologize for the formatting of the config files!

My complete web.php configuration file:
<?php

$params = require DIR . '/params.php';
$db = require DIR . '/db.php';

$config = [
'id' => 'basic',
'basePath' => dirname(DIR),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@Da' => '@vendor/2amigos/yii2-usuario/src'
],
'modules' => [
'user' => [
'class' => Da\User\Module::class,
],
],
'components' => [
'authManager' => [
//'class' => 'yii\rbac\DbManager', // original setting
'class' => 'Da\User\Component\AuthDbManagerComponent',
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'M6Pdf__ZcD6xzjNa_nlUagM4rNZwhrSi',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'Da\User\Model\User',
'enableAutoLogin' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
],
],
'params' => $params,
];

if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    // uncomment the following to add your IP if you are not connecting from localhost.
    //'allowedIPs' => ['127.0.0.1', '::1'],
];

}

return $config;

pasquale
@paskuale75
@jgoetz Don't worry, you gave me good news, that the project is still alive, I thought otherwise, okay
John Goetz
@jgoetz

My "administrator migration" file:
<?php

use yii\db\Migration;

/**

  • Class m201202_021321_add_admin_user_and_role
    /
    class m201202_021321_add_admin_user_and_role extends Migration
    {
    /*

    • {@inheritdoc}
      */
      public function safeUp()
      {
      $auth = Yii::$app->authManager;

      // create a role named "administrator"
      $administratorRole = $auth->createRole('administrator');
      $administratorRole->description = 'Administrator';
      $auth->add($administratorRole);

      // create permission for certain tasks
      $permission = $auth->createPermission('user-management');
      $permission->description = 'User Management';
      $auth->add($permission);

      // let administrators do user management
      $auth->addChild($administratorRole, $auth->getPermission('user-management'));

      // create user "admin" with password "verysecret"
      $user = new \Da\User\Model\User([

       'scenario' => 'create',
       'email' => "email@example.com",
       'username' => "admin",
       'password' => "verysecret"  // >6 characters!

      ]);
      $user->confirmed_at = time();
      $user->save();

      // assign role to our admin-user
      $auth->assign($administratorRole, $user->id);
      }

      /**

    • {@inheritdoc}
      */
      public function safeDown()
      {
      $auth = Yii::$app->authManager;

      // delete permission
      $auth->remove($auth->getPermission('user-management'));

      // delete admin-user and administrator role
      $administratorRole = $auth->getRole("administrator");
      $user = \Da\User\Model\User::findOne(['name'=>"admin"]);
      $auth->revoke($administratorRole, $user->id);
      $user->delete();
      $auth->remove($administratorRole);
      }

      /*
      // Use up()/down() to run migration code without a transaction.
      public function up()
      {

      }

      public function down()
      {
      echo "m201202_021321_add_admin_user_and_role cannot be reverted.\n";

      return false;
      }
      */
      }

Anyone attempting this should be able to copy and paste my file content into their Basic Template files. I wasn't able to get the tabs/spacing set up to look pretty here.
Negruzzi Cristian
@EndErr
I can't figure out how to register new user with social account, followed the documentation and i have a page in existing user profile (that is registered with email) where a social network can be linked, and after that user is able to connect with that social network and it works fine. But how to let user to register with a social network?
pasquale
@paskuale75
let's start well ... I installed everything as soon as I try to generate the first user admin (with migration) here is the first exception !! Trying to get property 'enableGdprCompliance' of non-object (/var/www/html/yii2-basic/vendor/2amigos/yii2-usuario/src/User/Model/User.php:167)
pasquale
@paskuale75
[SOLVED] I had to declare the user module in the config/console.php file since it is the migration of a command rightly...
John Goetz
@jgoetz
Yes! You found the fix! Nicely done, sir.
pasquale
@paskuale75
a question: if to extend I create my own module, and start extending models and controllers, should I also specify the path for the views? Or does it render from the extended controller then from its view without the need to specify a pathMap in the 'view' component? tnx
pasquale
@paskuale75
[auto-reply] it seems that it is necessary to specify the pathMap in component 'view'
pasquale
@paskuale75
@EndErr are you talking about the ConnectWidget? Can I ask you in what context do you use it? In login or registration? by default I find it in the login but I think it makes sense in the registration rather. And then I don't know why it opens a popup with the login view inside ...
Negruzzi Cristian
@EndErr
@paskuale75 i foundit in login but not in registration
pasquale
@paskuale75
@EndErr thank you so much, I'm reading here to understand how to exploit the ConnectWidget widget at least with facebook...does anyone have more detailed sources?
pasquale
@paskuale75
Hi all, I just discovered the reason why it did not redirect to the social url for the oAuth2, it is the rules of the urlManager component, any advice on how to make the Usuario url coexist? tnx
pasquale
@paskuale75
[SOLVED] I added this rule: 'user/<action:(auth)>' => '/user/security/<action>'
Claudio Alberti
@cloudeeo
Hello, thank you for the great extension! I was able to install and run it in the Basic Template, I run the migration to create the admin user and I can login, but when trying to access user/admin i get a 403 error... Any idea? Thank you!
pasquale
@paskuale75
@cloudeeo the admin user create it with the migration?
andrewbilham
@andrewbilham
Afternoon All, Has anyone done any work on moving this to bootstrap 4
kiatsing96
@kiatsing96
@cloudeeo i have the same problem, did you find any solution?
pasquale
@paskuale75
Can be solution add admin name in user module settings ?
TylerByte
@TylerByte666

Hey guys!

Having an issue implementing the recaptcha on the Login side of things. Has anyone got this working yet? I just get the error: verification code is incorrect.

2amigos/yii2-usuario#409

pasquale
@paskuale75
is it compatible with bootstrap 4.x ?
Bill
@OceanWind
I'm having a mysterious issue where I am getting logged out within seconds of logging in. I'm using the recommended Usario configuration. Any suggestions where I should look to solve this?
1 reply
pasquale
@paskuale75
@OceanWind it would appear to be a session problem. Try looking between settings such as session life time...
Anastasia
@kovaleva_a_m_twitter

Hello!
I'm having trouble with propper install of yii2-usuario.
It seems like i did all all 3 steps in Getting Started instruction (composer require, migrations and config of user module).
But now my index page gives errow: Getting unknown property: Da\User\Module::isGuest

I also tryed to create the first Administrator during a migration (as on https://yii2-usuario.readthedocs.io/en/latest/helpful-guides/first-steps/)
This was giving error: Exception: Trying to get property 'enableGdprCompliance' of non-object (/home/akovaleva/Projects/my_portret/vendor/2amigos/yii2-usuario/src/User/Model/User.php:167)

Unfortunatly I don't undestend where things went wrong...

config: console.php and web.php
    'authManager'  => [
        'class'        => 'yii\rbac\DbManager',
        //            'defaultRoles' => ['guest'],
    ],

    'user' => [
        'class' => Da\User\Module::class
    ],
pasquale
@paskuale75
There is a way to create the user even if the sending of the email fails ? Maybe the user tries again after sending the confirmation email. Thanks
Negruzzi Cristian
@EndErr
is there a tutorial how to enable social network registration with yii2-usuario?
can't figure out how to implement it, any help will be appreciated
Derek Gifford
@derekisbusy
Hi! I'm trying to get the Userario extension working... I'm receiving this error "Getting unknown property: Da\User\Model\User::isGuest" the isGuest property is not implemented I'm wondering if this is something I need to add. Can't find anything in the docs?
Negruzzi Cristian
@EndErr
You should use: Yii::$app->user->isGuest
Wei-Hwa Huang
@onigame
Hi, does anyone know of a guide to transition from dektrium yii2-user to yii2-usuario ?
Negruzzi Cristian
@EndErr
did anyone manage how to setup social network registration?
i cant figure out how to deal with the popup window on a PC, on mobile it works fine
Miriam Barroso
@miriambarroso
Hi, how to resolve the error: Getting unknown property: Da\User\Module::isGuest? I'm using yii2-usuario, my config/web.php this: <code>'user' => [
'class' => Da\User\Module::class,
'classMap' => [
'User' => app\models\User::class,
],
], </code>
osama.sado
@osama.sado:matrix.org
[m]
Hi, how can I install this extention with bootstrap5?
1 reply
  • yiisoft/yii2-bootstrap[2.0.1, ..., 2.0.8] require bower-asset/bootstrap 3.3. | 3.2. | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.3.7] but the package is fixed to v5.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Thiago Otaviani Vidal
@thiagovidal
Hey guys. Could some one help me? I use this extension for almost 2 years now... and sundely a new bug have arrived.