by

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
Yaroslav Annenkov
@Yannn
изображение.png

Hi Antonio, thanks for usario! Сan not add permission to roles (add a child),
getUnassignedItems($model) used for get items, but getUnassignedItems filters by current type!

'unassignedItems' => $this->authHelper->getUnassignedItems($model),
...
 $items = $this->getAuthManager()->getItems($model->getType(), $excludeItems);

Does this make any sense?

Ferenc Papp
@pappfer
Hi! I'm considering switching to this module from dektrium's one. I have a couple of questions.
  • Why did you create this module? Is it because dektrium's not going to be updated or is it because of something else?
  • Why didn't you completely fork dektrium's one?
  • Is it possible to block a user after x failed login attempts, or is it planned feature ?
    Thanks for your work.
    PS: a demo page would be nice. :smile:
Marc
@csa12

I'm trying to add a default Role for newly registered users via the Events option. But using the following code:

Event::on(RegistrationController::class, UserEvent::EVENT_AFTER_REGISTER, function (UserEvent $event) {
    $user = $event->getUser();

    // Yii2 Authorization, set default Role
    $auth = \Yii::$app->authManager;
    $authorRole = $auth->getRole('author');
    $auth->assign($authorRole, $user->getId());
});

I get the following error;

TypeError

Argument 1 passed to {closure}() must be an instance of Da\User\Event\UserEvent, instance of Da\User\Event\FormEvent given
Marc
@csa12

Another issue; I believe there's an error in AuthHelper function getUnassignedItems;

 $type = $model->getType() == Permission::TYPE_PERMISSION ? : null;

should be;

 $type = $model->getType() == Permission::TYPE_PERMISSION ? Permission::TYPE_PERMISSION: null;
idinarene
@idinarene
hi i'm trying to add a child permission to a permission but they are only roles in the list it doesn't display permissions
idinarene
@idinarene
image.png
if any one knows the cause please tell me
Jerry Ejonavi
@jerrynavi
Hello. I am having an issue adding yii2-usuario to my project. I keep getting these errors
Screenshot (238).png
Screenshot (239).png
Alexander Frolov
@Philosoft
@jerryasih 2amigos/yii2-usuario#63 latest comment. tl;dr - you just need to install fxp/composer-asset-plugin globally (composer global requirefxp/composer-asset-plugin:~1.0`)
Stefan Jacomeit
@Stefan39
Hello, how can i redirect after successfully login to another route than $this->goHome() without override the controller?
Stefan Jacomeit
@Stefan39
:-0 @tonydspaniard estas en mallorca
Kakada
@kakadanhem
Hi, I try to find out what do I have to input in "Class Name" when create a rule?
Roberto Braga
@bobonov

Hi I think I made all installation steps but I guess I missed something since when I load the site I get:
Invalid Configuration – yii\base\InvalidConfigException
Missing required parameter "id" when instantiating "Da\User\Module".

1. in /var/www/fatture.yiib/vendor/yiisoft/yii2/di/Container.php at line 460

I'm using basic template, tell me if I have to give you any other info, thanks in advance for your help.

Roberto Braga
@bobonov
bad on me.... even if I checked everything 10 times I realized now that I just replaced the user declaration in component rather than creating it in module.... a coffee is always helpfull
Antonio Ramirez
@tonydspaniard
@Stefan39 yes sir! Soy mallorquín de pura cepa :)
Antonio Ramirez
@tonydspaniard
@pappfer
  • I created this module because we, at 2amigos.us, were currently using Dektrium's and had to constantly make changes to the code (overriding classes, etc). Thats why we, as a company, decided to create our very own. Found that RBAC should have to be within and not splitted in different repos as our projects required them. And, as usual, we shared it with everybody as we strongly believe in Open Source.
  • I didn't fork dektrium's one because I personally disliked the way the code was written and I didn't want to wait for Dektrium (who I personally thank for his amazing work) to merge nor comply with my thoughts on the code.
  • I thought that should be up to the coder decision but, as we included reCaptcha, we may also add that in the future. I'll create an issue for that, Thanks for the suggestion.
  • Your are more than welcome... I use open source projects for our company, so is a common effort.
  • About the demo... sure! I am currently working (on my free time that is quite small right now) on a new version of Yiinitializr, highly modern and where all our packages will be demonized and pre-configured for your own projects... Stay tuned. Our idea is to build a tool to speed up development processes for us all.
@bobonov yep, you are right! Coffee is an awesome part of our toolkit :)
@Stefan39 yes, you need to override the Controller's action!
Antonio Ramirez
@tonydspaniard
@pappfer 2amigos/yii2-usuario#93 <--- there you go, thanks!
Pascal Erb Luzi
@ErbLuzi_twitter
Hello Guys
I have a problem and do not really find out whats wrong with this.
Fatal error: Uncaught Error: Class 'Yii' not found in /Applications/XAMPP/xamppfiles/htdocs/PascalGuamar/basic/vendor/2amigos/yii2-usuario/src/User/resources/views/registration/register.php:22 Stack trace: #0 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/PascalGuamar/basic/vendor/2amigos/yii2-usuario/src/User/resources/views/registration/register.php on line 22
Pascal Erb Luzi
@ErbLuzi_twitter
I followed the documentation of http://yii2-usuario.readthedocs.io/en/latest/
but somehow it will not happen ^^
Pascal Erb Luzi
@ErbLuzi_twitter
Bildschirmfoto 2017-10-24 um 12.40.36.png
Lorenzo Milesi
@maxxer
@tonydspaniard may I suggest to change all (most) of the strings with "Two Factor Autentication" to "2FA"? I can handle that, if you agree
pasquale
@paskuale75
Hi, how can force user logout ?
pasquale
@paskuale75
I've a link with data-method="post" but return me Method Not Allowed. This url can only handle the following request methods: POST.
pasquale
@paskuale75
solved ... in SecurityController I edit this:
'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post','get'], ], ],
pasquale
@paskuale75
Any example for add relation models in registration process (registrationForm file) ? tnx
Tõnis Ormisson
@TonisOrmisson
I am in a process of trying to migrate from dektrium to usuario and ran into some migration trouble
Im not really sure where the issue lies but maybe this rings a bell with anyone
I have the config migration set up as migrationNamespaces
and what I want to do is so a migration/mark on the 000001 ... 000005 (since I have the dektrium already) and then run only the last one which adds extra to dektrium
I get to mark the 000001 nicely, but after that I start getting problems
setting the 000002 throws me: Error: Unable to find the version '000000_000002'.
Tõnis Ormisson
@TonisOrmisson

$ php yii migrate
Yii Migration Tool (based on Yii v2.0.13.1)

Total 7 new migrations to be applied:
Da\User\Migration\m000000_000001_create_user_table
Da\User\Migration\m000000_000002_create_profile_table
Da\User\Migration\m000000_000003_create_social_account_table
Da\User\Migration\m000000_000004_create_token_table
Da\User\Migration\m000000_000005_add_last_login_at
Da\User\Migration\m000000_000006_add_two_factor_fields

I still see the 000001 there
Tõnis Ormisson
@TonisOrmisson
if I remove the migrationNamespaces from config and use the command line --migrationPath=@Da/User/Migration I am able to mark the necessary migrations
but then if I want to apply the 00006 I get an exception:
$ php yii migrate --migrationPath=@Da/User/Migration
Yii Migration Tool (based on Yii v2.0.13.1)

Total 1 new migration to be applied:
    m000000_000006_add_two_factor_fields

Apply the above migration? (yes|no) [no]:y
*** applying m000000_000006_add_two_factor_fields
Exception 'ReflectionException' with message 'Class m000000_000006_add_two_factor_fields does not exist'

in /var/www/html/vendor/yiisoft/yii2/di/Container.php:426

Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/di/Container.php(426): ReflectionClass->__construct('m000000_000006_...')
#1 /var/www/html/vendor/yiisoft/yii2/di/Container.php(364): yii\di\Container->getDependencies('m000000_000006_...')
#2 /var/www/html/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('m000000_000006_...', Array, Array)
#3 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('m000000_000006_...', Array, Array)
#4 /var/www/html/vendor/yiisoft/yii2/console/controllers/MigrateController.php(195): yii\BaseYii::createObject(Array)
#5 /var/www/html/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(724): yii\console\controllers\MigrateController->createMigration('m000000_000006_...')
#6 /var/www/html/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m000000_000006_...')
#7 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#8 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#9 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#10 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(135): yii\base\Controller->runAction('', Array)
#11 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#12 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#13 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#14 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#15 /var/www/html/yii(20): yii\base\Application->run()
#16 {main}
Tõnis Ormisson
@TonisOrmisson
OK, got it by RTFM
While operating namespaced migrations: creating new, reverting and so on, you should specify full namespace before migration name. Note that backslash () symbol is usually considered a special character in the shell, so you need to escape it properly to avoid shell errors or incorrect behavior. For example:
so this works for migrating from dektrium (and skipping the dektrium-related migrations):
php yii migrate/mark Da\\User\\Migration\\m000000_000002
Thank you for the module and your attention :)
kechad cherif
@kechadc
Hi every one I am new to Php and Yii i think use yii2-usuario but after executing migration i have problem with User Model
Unknown Method – yii\base\UnknownMethodException
Calling unknown method: common\models\User::getIsAdmin()
kechad cherif
@kechadc
Hi! I solved problem with enhance User model but I have another problem Forbidden (#403) when I try to access to role management, thanks in advance.
kechad cherif
@kechadc
I solved problem with adding user administrators thank you for the module :)